aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2016-02-07 19:23:23 -0500
committerDave Chinner <david@fromorbit.com>2016-02-07 19:23:23 -0500
commit4d4d9523b4ebbd5d97c8b2557c6ee2a3f90b6b3a (patch)
tree97ed3923df9c7e80e59c5704a487c9949049c8de
parenta484bcdd1321b86de29a2969399da1fa6e9c7648 (diff)
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>
-rw-r--r--fs/xfs/xfs_dquot.c3
-rw-r--r--fs/xfs/xfs_qm.h10
2 files changed, 7 insertions, 6 deletions
diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c
index c9c7c2d89245..5dbde0d65f37 100644
--- a/fs/xfs/xfs_dquot.c
+++ b/fs/xfs/xfs_dquot.c
@@ -464,12 +464,13 @@ xfs_qm_dqtobp(
464 struct xfs_bmbt_irec map; 464 struct xfs_bmbt_irec map;
465 int nmaps = 1, error; 465 int nmaps = 1, error;
466 struct xfs_buf *bp; 466 struct xfs_buf *bp;
467 struct xfs_inode *quotip = xfs_dq_to_quota_inode(dqp); 467 struct xfs_inode *quotip;
468 struct xfs_mount *mp = dqp->q_mount; 468 struct xfs_mount *mp = dqp->q_mount;
469 xfs_dqid_t id = be32_to_cpu(dqp->q_core.d_id); 469 xfs_dqid_t id = be32_to_cpu(dqp->q_core.d_id);
470 struct xfs_trans *tp = (tpp ? *tpp : NULL); 470 struct xfs_trans *tp = (tpp ? *tpp : NULL);
471 uint lock_mode; 471 uint lock_mode;
472 472
473 quotip = xfs_quota_inode(dqp->q_mount, dqp->dq_flags);
473 dqp->q_fileoffset = (xfs_fileoff_t)id / mp->m_quotainfo->qi_dqperchunk; 474 dqp->q_fileoffset = (xfs_fileoff_t)id / mp->m_quotainfo->qi_dqperchunk;
474 475
475 lock_mode = xfs_ilock_data_map_shared(quotip); 476 lock_mode = xfs_ilock_data_map_shared(quotip);
diff --git a/fs/xfs/xfs_qm.h b/fs/xfs/xfs_qm.h
index 996a04064894..8901a01bc354 100644
--- a/fs/xfs/xfs_qm.h
+++ b/fs/xfs/xfs_qm.h
@@ -104,15 +104,15 @@ xfs_dquot_tree(
104} 104}
105 105
106static inline struct xfs_inode * 106static inline struct xfs_inode *
107xfs_dq_to_quota_inode(struct xfs_dquot *dqp) 107xfs_quota_inode(xfs_mount_t *mp, uint dq_flags)
108{ 108{
109 switch (dqp->dq_flags & XFS_DQ_ALLTYPES) { 109 switch (dq_flags & XFS_DQ_ALLTYPES) {
110 case XFS_DQ_USER: 110 case XFS_DQ_USER:
111 return dqp->q_mount->m_quotainfo->qi_uquotaip; 111 return mp->m_quotainfo->qi_uquotaip;
112 case XFS_DQ_GROUP: 112 case XFS_DQ_GROUP:
113 return dqp->q_mount->m_quotainfo->qi_gquotaip; 113 return mp->m_quotainfo->qi_gquotaip;
114 case XFS_DQ_PROJ: 114 case XFS_DQ_PROJ:
115 return dqp->q_mount->m_quotainfo->qi_pquotaip; 115 return mp->m_quotainfo->qi_pquotaip;
116 default: 116 default:
117 ASSERT(0); 117 ASSERT(0);
118 } 118 }