aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_log_priv.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2008-11-27 22:23:38 -0500
committerNiv Sardi <xaiki@sgi.com>2008-11-30 19:37:25 -0500
commitb28708d6a0a3ed65a68f0dcd8e6d1c09f14e5cf3 (patch)
tree991ac374564600a60bb940e9c8c4b1315101fa14 /fs/xfs/xfs_log_priv.h
parent4805621a37d9b2b16641b5c68597651419e9e252 (diff)
[XFS] sanitize xlog_in_core_t definition
Move all fields from xlog_iclog_fields_t into xlog_in_core_t instead of having them in a substructure and the using #defines to make it look like they were directly in xlog_in_core_t. Also document that xlog_in_core_2_t is grossly misnamed, and make all references to it typesafe. (First sent on Semptember 15th) Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <david@fromorbit.com> Signed-off-by: Niv Sardi <xaiki@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_log_priv.h')
-rw-r--r--fs/xfs/xfs_log_priv.h46
1 files changed, 13 insertions, 33 deletions
diff --git a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h
index b39a1980e82d..654167be0efb 100644
--- a/fs/xfs/xfs_log_priv.h
+++ b/fs/xfs/xfs_log_priv.h
@@ -310,6 +310,16 @@ typedef struct xlog_rec_ext_header {
310} xlog_rec_ext_header_t; 310} xlog_rec_ext_header_t;
311 311
312#ifdef __KERNEL__ 312#ifdef __KERNEL__
313
314/*
315 * Quite misnamed, because this union lays out the actual on-disk log buffer.
316 */
317typedef union xlog_in_core2 {
318 xlog_rec_header_t hic_header;
319 xlog_rec_ext_header_t hic_xheader;
320 char hic_sector[XLOG_HEADER_SIZE];
321} xlog_in_core_2_t;
322
313/* 323/*
314 * - A log record header is 512 bytes. There is plenty of room to grow the 324 * - A log record header is 512 bytes. There is plenty of room to grow the
315 * xlog_rec_header_t into the reserved space. 325 * xlog_rec_header_t into the reserved space.
@@ -339,7 +349,7 @@ typedef struct xlog_rec_ext_header {
339 * We'll put all the read-only and l_icloglock fields in the first cacheline, 349 * We'll put all the read-only and l_icloglock fields in the first cacheline,
340 * and move everything else out to subsequent cachelines. 350 * and move everything else out to subsequent cachelines.
341 */ 351 */
342typedef struct xlog_iclog_fields { 352typedef struct xlog_in_core {
343 sv_t ic_force_wait; 353 sv_t ic_force_wait;
344 sv_t ic_write_wait; 354 sv_t ic_write_wait;
345 struct xlog_in_core *ic_next; 355 struct xlog_in_core *ic_next;
@@ -362,41 +372,11 @@ typedef struct xlog_iclog_fields {
362 372
363 /* reference counts need their own cacheline */ 373 /* reference counts need their own cacheline */
364 atomic_t ic_refcnt ____cacheline_aligned_in_smp; 374 atomic_t ic_refcnt ____cacheline_aligned_in_smp;
365} xlog_iclog_fields_t; 375 xlog_in_core_2_t *ic_data;
366 376#define ic_header ic_data->hic_header
367typedef union xlog_in_core2 {
368 xlog_rec_header_t hic_header;
369 xlog_rec_ext_header_t hic_xheader;
370 char hic_sector[XLOG_HEADER_SIZE];
371} xlog_in_core_2_t;
372
373typedef struct xlog_in_core {
374 xlog_iclog_fields_t hic_fields;
375 xlog_in_core_2_t *hic_data;
376} xlog_in_core_t; 377} xlog_in_core_t;
377 378
378/* 379/*
379 * Defines to save our code from this glop.
380 */
381#define ic_force_wait hic_fields.ic_force_wait
382#define ic_write_wait hic_fields.ic_write_wait
383#define ic_next hic_fields.ic_next
384#define ic_prev hic_fields.ic_prev
385#define ic_bp hic_fields.ic_bp
386#define ic_log hic_fields.ic_log
387#define ic_callback hic_fields.ic_callback
388#define ic_callback_lock hic_fields.ic_callback_lock
389#define ic_callback_tail hic_fields.ic_callback_tail
390#define ic_trace hic_fields.ic_trace
391#define ic_size hic_fields.ic_size
392#define ic_offset hic_fields.ic_offset
393#define ic_refcnt hic_fields.ic_refcnt
394#define ic_bwritecnt hic_fields.ic_bwritecnt
395#define ic_state hic_fields.ic_state
396#define ic_datap hic_fields.ic_datap
397#define ic_header hic_data->hic_header
398
399/*
400 * The reservation head lsn is not made up of a cycle number and block number. 380 * The reservation head lsn is not made up of a cycle number and block number.
401 * Instead, it uses a cycle number and byte number. Logs don't expect to 381 * Instead, it uses a cycle number and byte number. Logs don't expect to
402 * overflow 31 bits worth of byte offset, so using a byte number will mean 382 * overflow 31 bits worth of byte offset, so using a byte number will mean