Skip to content

Commit

Permalink
xfs: get quota inode from mp & flags rather than dqp
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Sandeen authored and Dave Chinner committed Feb 8, 2016
1 parent a484bcd commit 4d4d952
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion fs/xfs/xfs_dquot.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,12 +464,13 @@ xfs_qm_dqtobp(
struct xfs_bmbt_irec map;
int nmaps = 1, error;
struct xfs_buf *bp;
struct xfs_inode *quotip = xfs_dq_to_quota_inode(dqp);
struct xfs_inode *quotip;
struct xfs_mount *mp = dqp->q_mount;
xfs_dqid_t id = be32_to_cpu(dqp->q_core.d_id);
struct xfs_trans *tp = (tpp ? *tpp : NULL);
uint lock_mode;

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

lock_mode = xfs_ilock_data_map_shared(quotip);
Expand Down
10 changes: 5 additions & 5 deletions fs/xfs/xfs_qm.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@ xfs_dquot_tree(
}

static inline struct xfs_inode *
xfs_dq_to_quota_inode(struct xfs_dquot *dqp)
xfs_quota_inode(xfs_mount_t *mp, uint dq_flags)
{
switch (dqp->dq_flags & XFS_DQ_ALLTYPES) {
switch (dq_flags & XFS_DQ_ALLTYPES) {
case XFS_DQ_USER:
return dqp->q_mount->m_quotainfo->qi_uquotaip;
return mp->m_quotainfo->qi_uquotaip;
case XFS_DQ_GROUP:
return dqp->q_mount->m_quotainfo->qi_gquotaip;
return mp->m_quotainfo->qi_gquotaip;
case XFS_DQ_PROJ:
return dqp->q_mount->m_quotainfo->qi_pquotaip;
return mp->m_quotainfo->qi_pquotaip;
default:
ASSERT(0);
}
Expand Down

0 comments on commit 4d4d952

Please sign in to comment.