aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/xfs/xfs_dquot.c2
-rw-r--r--fs/xfs/xfs_dquot.h4
-rw-r--r--fs/xfs/xfs_qm.h16
3 files changed, 17 insertions, 5 deletions
diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c
index 09af322653a2..7d184dead99a 100644
--- a/fs/xfs/xfs_dquot.c
+++ b/fs/xfs/xfs_dquot.c
@@ -573,7 +573,7 @@ xfs_qm_dqtobp(
573 xfs_bmbt_irec_t map; 573 xfs_bmbt_irec_t map;
574 int nmaps = 1, error; 574 int nmaps = 1, error;
575 xfs_buf_t *bp; 575 xfs_buf_t *bp;
576 xfs_inode_t *quotip = XFS_DQ_TO_QIP(dqp); 576 struct xfs_inode *quotip = xfs_dq_to_quota_inode(dqp);
577 xfs_mount_t *mp = dqp->q_mount; 577 xfs_mount_t *mp = dqp->q_mount;
578 xfs_dqid_t id = be32_to_cpu(dqp->q_core.d_id); 578 xfs_dqid_t id = be32_to_cpu(dqp->q_core.d_id);
579 xfs_trans_t *tp = (tpp ? *tpp : NULL); 579 xfs_trans_t *tp = (tpp ? *tpp : NULL);
diff --git a/fs/xfs/xfs_dquot.h b/fs/xfs/xfs_dquot.h
index 4f0ebfc43cc9..b596626249b8 100644
--- a/fs/xfs/xfs_dquot.h
+++ b/fs/xfs/xfs_dquot.h
@@ -143,10 +143,6 @@ static inline xfs_dquot_t *xfs_inode_dquot(struct xfs_inode *ip, int type)
143#define XFS_QM_ISUDQ(dqp) ((dqp)->dq_flags & XFS_DQ_USER) 143#define XFS_QM_ISUDQ(dqp) ((dqp)->dq_flags & XFS_DQ_USER)
144#define XFS_QM_ISPDQ(dqp) ((dqp)->dq_flags & XFS_DQ_PROJ) 144#define XFS_QM_ISPDQ(dqp) ((dqp)->dq_flags & XFS_DQ_PROJ)
145#define XFS_QM_ISGDQ(dqp) ((dqp)->dq_flags & XFS_DQ_GROUP) 145#define XFS_QM_ISGDQ(dqp) ((dqp)->dq_flags & XFS_DQ_GROUP)
146#define XFS_DQ_TO_QINF(dqp) ((dqp)->q_mount->m_quotainfo)
147#define XFS_DQ_TO_QIP(dqp) (XFS_QM_ISUDQ(dqp) ? \
148 XFS_DQ_TO_QINF(dqp)->qi_uquotaip : \
149 XFS_DQ_TO_QINF(dqp)->qi_gquotaip)
150 146
151extern int xfs_qm_dqread(struct xfs_mount *, xfs_dqid_t, uint, 147extern int xfs_qm_dqread(struct xfs_mount *, xfs_dqid_t, uint,
152 uint, struct xfs_dquot **); 148 uint, struct xfs_dquot **);
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(
85 } 85 }
86 return NULL; 86 return NULL;
87} 87}
88
89static inline struct xfs_inode *
90xfs_dq_to_quota_inode(struct xfs_dquot *dqp)
91{
92 switch (dqp->dq_flags & XFS_DQ_ALLTYPES) {
93 case XFS_DQ_USER:
94 return dqp->q_mount->m_quotainfo->qi_uquotaip;
95 case XFS_DQ_GROUP:
96 case XFS_DQ_PROJ:
97 return dqp->q_mount->m_quotainfo->qi_gquotaip;
98 default:
99 ASSERT(0);
100 }
101 return NULL;
102}
103
88extern int xfs_qm_calc_dquots_per_chunk(struct xfs_mount *mp, 104extern int xfs_qm_calc_dquots_per_chunk(struct xfs_mount *mp,
89 unsigned int nbblks); 105 unsigned int nbblks);
90extern void xfs_trans_mod_dquot(xfs_trans_t *, xfs_dquot_t *, uint, long); 106extern void xfs_trans_mod_dquot(xfs_trans_t *, xfs_dquot_t *, uint, long);