aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_log_priv.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_log_priv.h')
-rw-r--r--fs/xfs/xfs_log_priv.h48
1 files changed, 15 insertions, 33 deletions
diff --git a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h
index e7d8f84443fa..654167be0efb 100644
--- a/fs/xfs/xfs_log_priv.h
+++ b/fs/xfs/xfs_log_priv.h
@@ -245,6 +245,7 @@ typedef struct xlog_ticket {
245 struct xlog_ticket *t_next; /* :4|8 */ 245 struct xlog_ticket *t_next; /* :4|8 */
246 struct xlog_ticket *t_prev; /* :4|8 */ 246 struct xlog_ticket *t_prev; /* :4|8 */
247 xlog_tid_t t_tid; /* transaction identifier : 4 */ 247 xlog_tid_t t_tid; /* transaction identifier : 4 */
248 atomic_t t_ref; /* ticket reference count : 4 */
248 int t_curr_res; /* current reservation in bytes : 4 */ 249 int t_curr_res; /* current reservation in bytes : 4 */
249 int t_unit_res; /* unit reservation in bytes : 4 */ 250 int t_unit_res; /* unit reservation in bytes : 4 */
250 char t_ocnt; /* original count : 1 */ 251 char t_ocnt; /* original count : 1 */
@@ -309,6 +310,16 @@ typedef struct xlog_rec_ext_header {
309} xlog_rec_ext_header_t; 310} xlog_rec_ext_header_t;
310 311
311#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
312/* 323/*
313 * - 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
314 * xlog_rec_header_t into the reserved space. 325 * xlog_rec_header_t into the reserved space.
@@ -338,7 +349,7 @@ typedef struct xlog_rec_ext_header {
338 * 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,
339 * and move everything else out to subsequent cachelines. 350 * and move everything else out to subsequent cachelines.
340 */ 351 */
341typedef struct xlog_iclog_fields { 352typedef struct xlog_in_core {
342 sv_t ic_force_wait; 353 sv_t ic_force_wait;
343 sv_t ic_write_wait; 354 sv_t ic_write_wait;
344 struct xlog_in_core *ic_next; 355 struct xlog_in_core *ic_next;
@@ -361,41 +372,11 @@ typedef struct xlog_iclog_fields {
361 372
362 /* reference counts need their own cacheline */ 373 /* reference counts need their own cacheline */
363 atomic_t ic_refcnt ____cacheline_aligned_in_smp; 374 atomic_t ic_refcnt ____cacheline_aligned_in_smp;
364} xlog_iclog_fields_t; 375 xlog_in_core_2_t *ic_data;
365 376#define ic_header ic_data->hic_header
366typedef union xlog_in_core2 {
367 xlog_rec_header_t hic_header;
368 xlog_rec_ext_header_t hic_xheader;
369 char hic_sector[XLOG_HEADER_SIZE];
370} xlog_in_core_2_t;
371
372typedef struct xlog_in_core {
373 xlog_iclog_fields_t hic_fields;
374 xlog_in_core_2_t *hic_data;
375} xlog_in_core_t; 377} xlog_in_core_t;
376 378
377/* 379/*
378 * Defines to save our code from this glop.
379 */
380#define ic_force_wait hic_fields.ic_force_wait
381#define ic_write_wait hic_fields.ic_write_wait
382#define ic_next hic_fields.ic_next
383#define ic_prev hic_fields.ic_prev
384#define ic_bp hic_fields.ic_bp
385#define ic_log hic_fields.ic_log
386#define ic_callback hic_fields.ic_callback
387#define ic_callback_lock hic_fields.ic_callback_lock
388#define ic_callback_tail hic_fields.ic_callback_tail
389#define ic_trace hic_fields.ic_trace
390#define ic_size hic_fields.ic_size
391#define ic_offset hic_fields.ic_offset
392#define ic_refcnt hic_fields.ic_refcnt
393#define ic_bwritecnt hic_fields.ic_bwritecnt
394#define ic_state hic_fields.ic_state
395#define ic_datap hic_fields.ic_datap
396#define ic_header hic_data->hic_header
397
398/*
399 * 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.
400 * 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
401 * 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
@@ -404,6 +385,7 @@ typedef struct xlog_in_core {
404typedef struct log { 385typedef struct log {
405 /* The following fields don't need locking */ 386 /* The following fields don't need locking */
406 struct xfs_mount *l_mp; /* mount point */ 387 struct xfs_mount *l_mp; /* mount point */
388 struct xfs_ail *l_ailp; /* AIL log is working with */
407 struct xfs_buf *l_xbuf; /* extra buffer for log 389 struct xfs_buf *l_xbuf; /* extra buffer for log
408 * wrapping */ 390 * wrapping */
409 struct xfs_buftarg *l_targ; /* buftarg of log */ 391 struct xfs_buftarg *l_targ; /* buftarg of log */