Skip to content

Commit 4d4d952

Browse files
Eric Sandeendchinner
authored andcommitted
xfs: get quota inode from mp & flags rather than dqp
Allow us to get the appropriate quota inode from any mp & quota flags, not necessarily associated with a particular dqp. Needed for when we are searching for the next active ID with quotas and we want to examine the quota inode. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
1 parent a484bcd commit 4d4d952

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

fs/xfs/xfs_dquot.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,12 +464,13 @@ xfs_qm_dqtobp(
464464
struct xfs_bmbt_irec map;
465465
int nmaps = 1, error;
466466
struct xfs_buf *bp;
467-
struct xfs_inode *quotip = xfs_dq_to_quota_inode(dqp);
467+
struct xfs_inode *quotip;
468468
struct xfs_mount *mp = dqp->q_mount;
469469
xfs_dqid_t id = be32_to_cpu(dqp->q_core.d_id);
470470
struct xfs_trans *tp = (tpp ? *tpp : NULL);
471471
uint lock_mode;
472472

473+
quotip = xfs_quota_inode(dqp->q_mount, dqp->dq_flags);
473474
dqp->q_fileoffset = (xfs_fileoff_t)id / mp->m_quotainfo->qi_dqperchunk;
474475

475476
lock_mode = xfs_ilock_data_map_shared(quotip);

fs/xfs/xfs_qm.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,15 @@ xfs_dquot_tree(
104104
}
105105

106106
static inline struct xfs_inode *
107-
xfs_dq_to_quota_inode(struct xfs_dquot *dqp)
107+
xfs_quota_inode(xfs_mount_t *mp, uint dq_flags)
108108
{
109-
switch (dqp->dq_flags & XFS_DQ_ALLTYPES) {
109+
switch (dq_flags & XFS_DQ_ALLTYPES) {
110110
case XFS_DQ_USER:
111-
return dqp->q_mount->m_quotainfo->qi_uquotaip;
111+
return mp->m_quotainfo->qi_uquotaip;
112112
case XFS_DQ_GROUP:
113-
return dqp->q_mount->m_quotainfo->qi_gquotaip;
113+
return mp->m_quotainfo->qi_gquotaip;
114114
case XFS_DQ_PROJ:
115-
return dqp->q_mount->m_quotainfo->qi_pquotaip;
115+
return mp->m_quotainfo->qi_pquotaip;
116116
default:
117117
ASSERT(0);
118118
}

0 commit comments

Comments
 (0)