summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_qm.h
diff options
context:
space:
mode:
authorChandra Seetharaman <sekharan@us.ibm.com>2013-06-28 00:25:06 +0200
committerBen Myers <bpm@sgi.com>2013-06-28 20:12:42 +0200
commit995961c4510460d9eef9b5ae46789aa2315545fe (patch)
treee568432e04df69b349d92ca79fe316cfe79291cb /fs/xfs/xfs_qm.h
parentxfs: Replace macro XFS_DQUOT_TREE with a function (diff)
downloadlinux-995961c4510460d9eef9b5ae46789aa2315545fe.tar.xz
linux-995961c4510460d9eef9b5ae46789aa2315545fe.zip
xfs: Replace macro XFS_DQ_TO_QIP 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>
Diffstat (limited to 'fs/xfs/xfs_qm.h')
-rw-r--r--fs/xfs/xfs_qm.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/xfs/xfs_qm.h b/fs/xfs/xfs_qm.h
index 96568c270670..051e43a5e20b 100644
--- a/fs/xfs/xfs_qm.h
+++ b/fs/xfs/xfs_qm.h
@@ -85,6 +85,22 @@ xfs_dquot_tree(
}
return NULL;
}
+
+static inline struct xfs_inode *
+xfs_dq_to_quota_inode(struct xfs_dquot *dqp)
+{
+ switch (dqp->dq_flags & XFS_DQ_ALLTYPES) {
+ case XFS_DQ_USER:
+ return dqp->q_mount->m_quotainfo->qi_uquotaip;
+ case XFS_DQ_GROUP:
+ case XFS_DQ_PROJ:
+ return dqp->q_mount->m_quotainfo->qi_gquotaip;
+ default:
+ ASSERT(0);
+ }
+ return NULL;
+}
+
extern int xfs_qm_calc_dquots_per_chunk(struct xfs_mount *mp,
unsigned int nbblks);
extern void xfs_trans_mod_dquot(xfs_trans_t *, xfs_dquot_t *, uint, long);