aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/quota/xfs_quota_priv.h
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2010-04-13 01:06:51 -0400
committerAlex Elder <aelder@sgi.com>2010-05-19 10:58:11 -0400
commite6a81f13aa9aa20ef03174210aed24791865b05e (patch)
tree727202721a225004e2522f32278de294c3748e70 /fs/xfs/quota/xfs_quota_priv.h
parent368e136174344c417bad6ff0380b7b3f574bf120 (diff)
xfs: convert the dquot hash list to use list heads
Convert the dquot hash list on the filesystem to use listhead infrastructure rather than the roll-your-own in the quota code. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/quota/xfs_quota_priv.h')
-rw-r--r--fs/xfs/quota/xfs_quota_priv.h33
1 files changed, 0 insertions, 33 deletions
diff --git a/fs/xfs/quota/xfs_quota_priv.h b/fs/xfs/quota/xfs_quota_priv.h
index 6f4bbae51aca..3a1b9aa763fc 100644
--- a/fs/xfs/quota/xfs_quota_priv.h
+++ b/fs/xfs/quota/xfs_quota_priv.h
@@ -72,46 +72,13 @@
72 !dqp->q_core.d_rtbcount && \ 72 !dqp->q_core.d_rtbcount && \
73 !dqp->q_core.d_icount) 73 !dqp->q_core.d_icount)
74 74
75#define HL_PREVP dq_hashlist.ql_prevp
76#define HL_NEXT dq_hashlist.ql_next
77
78
79#define _LIST_REMOVE(h, dqp, PVP, NXT) \
80 { \
81 xfs_dquot_t *d; \
82 if (((d) = (dqp)->NXT)) \
83 (d)->PVP = (dqp)->PVP; \
84 *((dqp)->PVP) = d; \
85 (dqp)->NXT = NULL; \
86 (dqp)->PVP = NULL; \
87 (h)->qh_version++; \
88 (h)->qh_nelems--; \
89 }
90
91#define _LIST_INSERT(h, dqp, PVP, NXT) \
92 { \
93 xfs_dquot_t *d; \
94 if (((d) = (h)->qh_next)) \
95 (d)->PVP = &((dqp)->NXT); \
96 (dqp)->NXT = d; \
97 (dqp)->PVP = &((h)->qh_next); \
98 (h)->qh_next = dqp; \
99 (h)->qh_version++; \
100 (h)->qh_nelems++; \
101 }
102
103#define FOREACH_DQUOT_IN_FREELIST(dqp, qlist) \ 75#define FOREACH_DQUOT_IN_FREELIST(dqp, qlist) \
104for ((dqp) = (qlist)->qh_next; (dqp) != (xfs_dquot_t *)(qlist); \ 76for ((dqp) = (qlist)->qh_next; (dqp) != (xfs_dquot_t *)(qlist); \
105 (dqp) = (dqp)->dq_flnext) 77 (dqp) = (dqp)->dq_flnext)
106 78
107#define XQM_HASHLIST_INSERT(h, dqp) \
108 _LIST_INSERT(h, dqp, HL_PREVP, HL_NEXT)
109
110#define XQM_FREELIST_INSERT(h, dqp) \ 79#define XQM_FREELIST_INSERT(h, dqp) \
111 xfs_qm_freelist_append(h, dqp) 80 xfs_qm_freelist_append(h, dqp)
112 81
113#define XQM_HASHLIST_REMOVE(h, dqp) \
114 _LIST_REMOVE(h, dqp, HL_PREVP, HL_NEXT)
115#define XQM_FREELIST_REMOVE(dqp) \ 82#define XQM_FREELIST_REMOVE(dqp) \
116 xfs_qm_freelist_unlink(dqp) 83 xfs_qm_freelist_unlink(dqp)
117 84