diff options
author | Chandra Seetharaman <sekharan@us.ibm.com> | 2013-06-27 18:25:05 -0400 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2013-06-28 14:05:07 -0400 |
commit | 329e0875286984df9053d410df83f839f85bea6e (patch) | |
tree | 57c6d534e9c41e98aaa36364943dc9a93d1ceba9 | |
parent | 9cad19d2cb57a2c32887a303b516d74254aa4b1c (diff) |
xfs: Replace macro XFS_DQUOT_TREE with a function
In preparation for combined pquota/gquota support, for the sake
of readability, change the macro to an inline function.
Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
-rw-r--r-- | fs/xfs/xfs_dquot.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_qm.c | 6 | ||||
-rw-r--r-- | fs/xfs/xfs_qm.h | 22 |
3 files changed, 20 insertions, 10 deletions
diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c index 044e97a33c8d..09af322653a2 100644 --- a/fs/xfs/xfs_dquot.c +++ b/fs/xfs/xfs_dquot.c | |||
@@ -804,7 +804,7 @@ xfs_qm_dqget( | |||
804 | xfs_dquot_t **O_dqpp) /* OUT : locked incore dquot */ | 804 | xfs_dquot_t **O_dqpp) /* OUT : locked incore dquot */ |
805 | { | 805 | { |
806 | struct xfs_quotainfo *qi = mp->m_quotainfo; | 806 | struct xfs_quotainfo *qi = mp->m_quotainfo; |
807 | struct radix_tree_root *tree = XFS_DQUOT_TREE(qi, type); | 807 | struct radix_tree_root *tree = xfs_dquot_tree(qi, type); |
808 | struct xfs_dquot *dqp; | 808 | struct xfs_dquot *dqp; |
809 | int error; | 809 | int error; |
810 | 810 | ||
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c index 28a5e8ae3829..8e707d33e106 100644 --- a/fs/xfs/xfs_qm.c +++ b/fs/xfs/xfs_qm.c | |||
@@ -70,7 +70,7 @@ xfs_qm_dquot_walk( | |||
70 | void *data) | 70 | void *data) |
71 | { | 71 | { |
72 | struct xfs_quotainfo *qi = mp->m_quotainfo; | 72 | struct xfs_quotainfo *qi = mp->m_quotainfo; |
73 | struct radix_tree_root *tree = XFS_DQUOT_TREE(qi, type); | 73 | struct radix_tree_root *tree = xfs_dquot_tree(qi, type); |
74 | uint32_t next_index; | 74 | uint32_t next_index; |
75 | int last_error = 0; | 75 | int last_error = 0; |
76 | int skipped; | 76 | int skipped; |
@@ -189,7 +189,7 @@ xfs_qm_dqpurge( | |||
189 | xfs_dqfunlock(dqp); | 189 | xfs_dqfunlock(dqp); |
190 | xfs_dqunlock(dqp); | 190 | xfs_dqunlock(dqp); |
191 | 191 | ||
192 | radix_tree_delete(XFS_DQUOT_TREE(qi, dqp->q_core.d_flags), | 192 | radix_tree_delete(xfs_dquot_tree(qi, dqp->q_core.d_flags), |
193 | be32_to_cpu(dqp->q_core.d_id)); | 193 | be32_to_cpu(dqp->q_core.d_id)); |
194 | qi->qi_dquots--; | 194 | qi->qi_dquots--; |
195 | 195 | ||
@@ -1471,7 +1471,7 @@ xfs_qm_dqfree_one( | |||
1471 | struct xfs_quotainfo *qi = mp->m_quotainfo; | 1471 | struct xfs_quotainfo *qi = mp->m_quotainfo; |
1472 | 1472 | ||
1473 | mutex_lock(&qi->qi_tree_lock); | 1473 | mutex_lock(&qi->qi_tree_lock); |
1474 | radix_tree_delete(XFS_DQUOT_TREE(qi, dqp->q_core.d_flags), | 1474 | radix_tree_delete(xfs_dquot_tree(qi, dqp->q_core.d_flags), |
1475 | be32_to_cpu(dqp->q_core.d_id)); | 1475 | be32_to_cpu(dqp->q_core.d_id)); |
1476 | 1476 | ||
1477 | qi->qi_dquots--; | 1477 | qi->qi_dquots--; |
diff --git a/fs/xfs/xfs_qm.h b/fs/xfs/xfs_qm.h index 5d16a6e6900f..96568c270670 100644 --- a/fs/xfs/xfs_qm.h +++ b/fs/xfs/xfs_qm.h | |||
@@ -69,12 +69,22 @@ typedef struct xfs_quotainfo { | |||
69 | struct shrinker qi_shrinker; | 69 | struct shrinker qi_shrinker; |
70 | } xfs_quotainfo_t; | 70 | } xfs_quotainfo_t; |
71 | 71 | ||
72 | #define XFS_DQUOT_TREE(qi, type) \ | 72 | static inline struct radix_tree_root * |
73 | ((type & XFS_DQ_USER) ? \ | 73 | xfs_dquot_tree( |
74 | &((qi)->qi_uquota_tree) : \ | 74 | struct xfs_quotainfo *qi, |
75 | &((qi)->qi_gquota_tree)) | 75 | int type) |
76 | 76 | { | |
77 | 77 | switch (type) { | |
78 | case XFS_DQ_USER: | ||
79 | return &qi->qi_uquota_tree; | ||
80 | case XFS_DQ_GROUP: | ||
81 | case XFS_DQ_PROJ: | ||
82 | return &qi->qi_gquota_tree; | ||
83 | default: | ||
84 | ASSERT(0); | ||
85 | } | ||
86 | return NULL; | ||
87 | } | ||
78 | extern int xfs_qm_calc_dquots_per_chunk(struct xfs_mount *mp, | 88 | extern int xfs_qm_calc_dquots_per_chunk(struct xfs_mount *mp, |
79 | unsigned int nbblks); | 89 | unsigned int nbblks); |
80 | extern void xfs_trans_mod_dquot(xfs_trans_t *, xfs_dquot_t *, uint, long); | 90 | extern void xfs_trans_mod_dquot(xfs_trans_t *, xfs_dquot_t *, uint, long); |