aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_log_priv.h
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2010-12-20 20:02:25 -0500
committerDave Chinner <david@fromorbit.com>2010-12-20 20:02:25 -0500
commit1054794198e39103cb986618c4c10ec2252b7089 (patch)
treebc1d6a3eece9385bef892c2df7d6dba6f39d3088 /fs/xfs/xfs_log_priv.h
parent9552e7f2f3dd13a7580e488a7a3582332daad4f5 (diff)
xfs: convert log grant ticket queues to list heads
The grant write and reserve queues use a roll-your-own double linked list, so convert it to a standard list_head structure and convert all the list traversals to use list_for_each_entry(). We can also get rid of the XLOG_TIC_IN_Q flag as we can use the list_empty() check to tell if the ticket is in a list or not. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/xfs_log_priv.h')
-rw-r--r--fs/xfs/xfs_log_priv.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h
index c1ce505313e9..a5b3c021a406 100644
--- a/fs/xfs/xfs_log_priv.h
+++ b/fs/xfs/xfs_log_priv.h
@@ -132,12 +132,10 @@ static inline uint xlog_get_client_id(__be32 i)
132 */ 132 */
133#define XLOG_TIC_INITED 0x1 /* has been initialized */ 133#define XLOG_TIC_INITED 0x1 /* has been initialized */
134#define XLOG_TIC_PERM_RESERV 0x2 /* permanent reservation */ 134#define XLOG_TIC_PERM_RESERV 0x2 /* permanent reservation */
135#define XLOG_TIC_IN_Q 0x4
136 135
137#define XLOG_TIC_FLAGS \ 136#define XLOG_TIC_FLAGS \
138 { XLOG_TIC_INITED, "XLOG_TIC_INITED" }, \ 137 { XLOG_TIC_INITED, "XLOG_TIC_INITED" }, \
139 { XLOG_TIC_PERM_RESERV, "XLOG_TIC_PERM_RESERV" }, \ 138 { XLOG_TIC_PERM_RESERV, "XLOG_TIC_PERM_RESERV" }
140 { XLOG_TIC_IN_Q, "XLOG_TIC_IN_Q" }
141 139
142#endif /* __KERNEL__ */ 140#endif /* __KERNEL__ */
143 141
@@ -244,8 +242,7 @@ typedef struct xlog_res {
244 242
245typedef struct xlog_ticket { 243typedef struct xlog_ticket {
246 sv_t t_wait; /* ticket wait queue : 20 */ 244 sv_t t_wait; /* ticket wait queue : 20 */
247 struct xlog_ticket *t_next; /* :4|8 */ 245 struct list_head t_queue; /* reserve/write queue */
248 struct xlog_ticket *t_prev; /* :4|8 */
249 xlog_tid_t t_tid; /* transaction identifier : 4 */ 246 xlog_tid_t t_tid; /* transaction identifier : 4 */
250 atomic_t t_ref; /* ticket reference count : 4 */ 247 atomic_t t_ref; /* ticket reference count : 4 */
251 int t_curr_res; /* current reservation in bytes : 4 */ 248 int t_curr_res; /* current reservation in bytes : 4 */
@@ -519,8 +516,8 @@ typedef struct log {
519 516
520 /* The following block of fields are changed while holding grant_lock */ 517 /* The following block of fields are changed while holding grant_lock */
521 spinlock_t l_grant_lock ____cacheline_aligned_in_smp; 518 spinlock_t l_grant_lock ____cacheline_aligned_in_smp;
522 xlog_ticket_t *l_reserve_headq; 519 struct list_head l_reserveq;
523 xlog_ticket_t *l_write_headq; 520 struct list_head l_writeq;
524 int l_grant_reserve_cycle; 521 int l_grant_reserve_cycle;
525 int l_grant_reserve_bytes; 522 int l_grant_reserve_bytes;
526 int l_grant_write_cycle; 523 int l_grant_write_cycle;