diff options
author | Dave Chinner <dchinner@redhat.com> | 2010-04-13 01:06:48 -0400 |
---|---|---|
committer | Alex Elder <aelder@sgi.com> | 2010-05-19 10:58:10 -0400 |
commit | 3a25404b3fccd41d36b2fda18d86011201608c38 (patch) | |
tree | 28979d8581760327c16a3389a2eb8752ed3f0665 /fs/xfs/quota/xfs_quota_priv.h | |
parent | 9abbc539bf7f299819ad0a235064a1b643ab6407 (diff) |
xfs: convert the per-mount dquot list to use list heads
Convert the dquot list on the filesytesm 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.h | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/fs/xfs/quota/xfs_quota_priv.h b/fs/xfs/quota/xfs_quota_priv.h index 8286b2842b6b..6f4bbae51aca 100644 --- a/fs/xfs/quota/xfs_quota_priv.h +++ b/fs/xfs/quota/xfs_quota_priv.h | |||
@@ -29,7 +29,6 @@ | |||
29 | 29 | ||
30 | #define XFS_DQ_IS_ADDEDTO_TRX(t, d) ((d)->q_transp == (t)) | 30 | #define XFS_DQ_IS_ADDEDTO_TRX(t, d) ((d)->q_transp == (t)) |
31 | 31 | ||
32 | #define XFS_QI_MPLRECLAIMS(mp) ((mp)->m_quotainfo->qi_dqreclaims) | ||
33 | #define XFS_QI_UQIP(mp) ((mp)->m_quotainfo->qi_uquotaip) | 32 | #define XFS_QI_UQIP(mp) ((mp)->m_quotainfo->qi_uquotaip) |
34 | #define XFS_QI_GQIP(mp) ((mp)->m_quotainfo->qi_gquotaip) | 33 | #define XFS_QI_GQIP(mp) ((mp)->m_quotainfo->qi_gquotaip) |
35 | #define XFS_QI_DQCHUNKLEN(mp) ((mp)->m_quotainfo->qi_dqchunklen) | 34 | #define XFS_QI_DQCHUNKLEN(mp) ((mp)->m_quotainfo->qi_dqchunklen) |
@@ -41,19 +40,6 @@ | |||
41 | #define XFS_QI_IWARNLIMIT(mp) ((mp)->m_quotainfo->qi_iwarnlimit) | 40 | #define XFS_QI_IWARNLIMIT(mp) ((mp)->m_quotainfo->qi_iwarnlimit) |
42 | #define XFS_QI_QOFFLOCK(mp) ((mp)->m_quotainfo->qi_quotaofflock) | 41 | #define XFS_QI_QOFFLOCK(mp) ((mp)->m_quotainfo->qi_quotaofflock) |
43 | 42 | ||
44 | #define XFS_QI_MPL_LIST(mp) ((mp)->m_quotainfo->qi_dqlist) | ||
45 | #define XFS_QI_MPLNEXT(mp) ((mp)->m_quotainfo->qi_dqlist.qh_next) | ||
46 | #define XFS_QI_MPLNDQUOTS(mp) ((mp)->m_quotainfo->qi_dqlist.qh_nelems) | ||
47 | |||
48 | #define xfs_qm_mplist_lock(mp) \ | ||
49 | mutex_lock(&(XFS_QI_MPL_LIST(mp).qh_lock)) | ||
50 | #define xfs_qm_mplist_nowait(mp) \ | ||
51 | mutex_trylock(&(XFS_QI_MPL_LIST(mp).qh_lock)) | ||
52 | #define xfs_qm_mplist_unlock(mp) \ | ||
53 | mutex_unlock(&(XFS_QI_MPL_LIST(mp).qh_lock)) | ||
54 | #define XFS_QM_IS_MPLIST_LOCKED(mp) \ | ||
55 | mutex_is_locked(&(XFS_QI_MPL_LIST(mp).qh_lock)) | ||
56 | |||
57 | #define xfs_qm_freelist_lock(qm) \ | 43 | #define xfs_qm_freelist_lock(qm) \ |
58 | mutex_lock(&((qm)->qm_dqfreelist.qh_lock)) | 44 | mutex_lock(&((qm)->qm_dqfreelist.qh_lock)) |
59 | #define xfs_qm_freelist_lock_nowait(qm) \ | 45 | #define xfs_qm_freelist_lock_nowait(qm) \ |
@@ -88,8 +74,6 @@ | |||
88 | 74 | ||
89 | #define HL_PREVP dq_hashlist.ql_prevp | 75 | #define HL_PREVP dq_hashlist.ql_prevp |
90 | #define HL_NEXT dq_hashlist.ql_next | 76 | #define HL_NEXT dq_hashlist.ql_next |
91 | #define MPL_PREVP dq_mplist.ql_prevp | ||
92 | #define MPL_NEXT dq_mplist.ql_next | ||
93 | 77 | ||
94 | 78 | ||
95 | #define _LIST_REMOVE(h, dqp, PVP, NXT) \ | 79 | #define _LIST_REMOVE(h, dqp, PVP, NXT) \ |
@@ -116,9 +100,6 @@ | |||
116 | (h)->qh_nelems++; \ | 100 | (h)->qh_nelems++; \ |
117 | } | 101 | } |
118 | 102 | ||
119 | #define FOREACH_DQUOT_IN_MP(dqp, mp) \ | ||
120 | for ((dqp) = XFS_QI_MPLNEXT(mp); (dqp) != NULL; (dqp) = (dqp)->MPL_NEXT) | ||
121 | |||
122 | #define FOREACH_DQUOT_IN_FREELIST(dqp, qlist) \ | 103 | #define FOREACH_DQUOT_IN_FREELIST(dqp, qlist) \ |
123 | for ((dqp) = (qlist)->qh_next; (dqp) != (xfs_dquot_t *)(qlist); \ | 104 | for ((dqp) = (qlist)->qh_next; (dqp) != (xfs_dquot_t *)(qlist); \ |
124 | (dqp) = (dqp)->dq_flnext) | 105 | (dqp) = (dqp)->dq_flnext) |
@@ -129,16 +110,10 @@ for ((dqp) = (qlist)->qh_next; (dqp) != (xfs_dquot_t *)(qlist); \ | |||
129 | #define XQM_FREELIST_INSERT(h, dqp) \ | 110 | #define XQM_FREELIST_INSERT(h, dqp) \ |
130 | xfs_qm_freelist_append(h, dqp) | 111 | xfs_qm_freelist_append(h, dqp) |
131 | 112 | ||
132 | #define XQM_MPLIST_INSERT(h, dqp) \ | ||
133 | _LIST_INSERT(h, dqp, MPL_PREVP, MPL_NEXT) | ||
134 | |||
135 | #define XQM_HASHLIST_REMOVE(h, dqp) \ | 113 | #define XQM_HASHLIST_REMOVE(h, dqp) \ |
136 | _LIST_REMOVE(h, dqp, HL_PREVP, HL_NEXT) | 114 | _LIST_REMOVE(h, dqp, HL_PREVP, HL_NEXT) |
137 | #define XQM_FREELIST_REMOVE(dqp) \ | 115 | #define XQM_FREELIST_REMOVE(dqp) \ |
138 | xfs_qm_freelist_unlink(dqp) | 116 | xfs_qm_freelist_unlink(dqp) |
139 | #define XQM_MPLIST_REMOVE(h, dqp) \ | ||
140 | { _LIST_REMOVE(h, dqp, MPL_PREVP, MPL_NEXT); \ | ||
141 | XFS_QI_MPLRECLAIMS((dqp)->q_mount)++; } | ||
142 | 117 | ||
143 | #define XFS_DQ_IS_LOGITEM_INITD(dqp) ((dqp)->q_logitem.qli_dquot == (dqp)) | 118 | #define XFS_DQ_IS_LOGITEM_INITD(dqp) ((dqp)->q_logitem.qli_dquot == (dqp)) |
144 | 119 | ||