diff options
author | Christoph Hellwig <hch@infradead.org> | 2012-02-19 21:31:25 -0500 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2012-02-22 23:19:53 -0500 |
commit | 28496968a6ac37c8b8c44b5156e633c581bb8378 (patch) | |
tree | 4e0c38612e2718e87219e00b7a3152d53393d145 /fs/xfs/xfs_log_priv.h | |
parent | 14a7235fba4302a82d61150eda92ec90d3ae9cfb (diff) |
xfs: add the xlog_grant_head structure
Add a new data structure to allow sharing code between the log grant and
regrant code.
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_log_priv.h')
-rw-r--r-- | fs/xfs/xfs_log_priv.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h index d8c5e47bbc2f..eba4ec925a45 100644 --- a/fs/xfs/xfs_log_priv.h +++ b/fs/xfs/xfs_log_priv.h | |||
@@ -470,6 +470,16 @@ struct xfs_cil { | |||
470 | #define XLOG_CIL_HARD_SPACE_LIMIT(log) (3 * (log->l_logsize >> 4)) | 470 | #define XLOG_CIL_HARD_SPACE_LIMIT(log) (3 * (log->l_logsize >> 4)) |
471 | 471 | ||
472 | /* | 472 | /* |
473 | * ticket grant locks, queues and accounting have their own cachlines | ||
474 | * as these are quite hot and can be operated on concurrently. | ||
475 | */ | ||
476 | struct xlog_grant_head { | ||
477 | spinlock_t lock ____cacheline_aligned_in_smp; | ||
478 | struct list_head waiters; | ||
479 | atomic64_t grant; | ||
480 | }; | ||
481 | |||
482 | /* | ||
473 | * The reservation head lsn is not made up of a cycle number and block number. | 483 | * The reservation head lsn is not made up of a cycle number and block number. |
474 | * Instead, it uses a cycle number and byte number. Logs don't expect to | 484 | * Instead, it uses a cycle number and byte number. Logs don't expect to |
475 | * overflow 31 bits worth of byte offset, so using a byte number will mean | 485 | * overflow 31 bits worth of byte offset, so using a byte number will mean |
@@ -520,17 +530,8 @@ typedef struct log { | |||
520 | /* lsn of 1st LR with unflushed * buffers */ | 530 | /* lsn of 1st LR with unflushed * buffers */ |
521 | atomic64_t l_tail_lsn ____cacheline_aligned_in_smp; | 531 | atomic64_t l_tail_lsn ____cacheline_aligned_in_smp; |
522 | 532 | ||
523 | /* | 533 | struct xlog_grant_head l_reserve_head; |
524 | * ticket grant locks, queues and accounting have their own cachlines | 534 | struct xlog_grant_head l_write_head; |
525 | * as these are quite hot and can be operated on concurrently. | ||
526 | */ | ||
527 | spinlock_t l_grant_reserve_lock ____cacheline_aligned_in_smp; | ||
528 | struct list_head l_reserveq; | ||
529 | atomic64_t l_grant_reserve_head; | ||
530 | |||
531 | spinlock_t l_grant_write_lock ____cacheline_aligned_in_smp; | ||
532 | struct list_head l_writeq; | ||
533 | atomic64_t l_grant_write_head; | ||
534 | 535 | ||
535 | /* The following field are used for debugging; need to hold icloglock */ | 536 | /* The following field are used for debugging; need to hold icloglock */ |
536 | #ifdef DEBUG | 537 | #ifdef DEBUG |