summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_qm.c
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2018-05-04 15:30:23 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2018-05-10 08:56:48 -0700
commit114e73ccfa2a51b47160f49524aa46f0d70cb8a9 (patch)
tree16762cedc8d858252ac47947e28e3201ff684149 /fs/xfs/xfs_qm.c
parentd63192c8904727fced1644f0dd0f7aa26b5f7dc4 (diff)
xfs: remove direct calls to _qm_dqread
The quota initialization code needs an "uncached" variant of _dqget to read in default quota limits and timers before the dquot cache is fully set up. We've already split up _dqget into its component pieces so create a fourth variant to address this need, and make dqread internal to xfs_dquot.c again. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/xfs_qm.c')
-rw-r--r--fs/xfs/xfs_qm.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
index f86b3608567d..fac649518101 100644
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
@@ -563,8 +563,7 @@ xfs_qm_set_defquota(
struct xfs_def_quota *defq;
int error;
- error = xfs_qm_dqread(mp, 0, type, 0, &dqp);
-
+ error = xfs_qm_dqget_uncached(mp, 0, type, &dqp);
if (!error) {
xfs_disk_dquot_t *ddqp = &dqp->q_core;
@@ -590,11 +589,12 @@ xfs_qm_set_defquota(
*/
STATIC int
xfs_qm_init_quotainfo(
- xfs_mount_t *mp)
+ struct xfs_mount *mp)
{
- xfs_quotainfo_t *qinf;
- int error;
- xfs_dquot_t *dqp;
+ struct xfs_quotainfo *qinf;
+ struct xfs_dquot *dqp;
+ uint type;
+ int error;
ASSERT(XFS_IS_QUOTA_RUNNING(mp));
@@ -637,12 +637,13 @@ xfs_qm_init_quotainfo(
* user/group/proj quota types, otherwise a default value is used.
* This should be split into different fields per quota type.
*/
- error = xfs_qm_dqread(mp, 0,
- XFS_IS_UQUOTA_RUNNING(mp) ? XFS_DQ_USER :
- (XFS_IS_GQUOTA_RUNNING(mp) ? XFS_DQ_GROUP :
- XFS_DQ_PROJ),
- 0, &dqp);
-
+ if (XFS_IS_UQUOTA_RUNNING(mp))
+ type = XFS_DQ_USER;
+ else if (XFS_IS_GQUOTA_RUNNING(mp))
+ type = XFS_DQ_GROUP;
+ else
+ type = XFS_DQ_PROJ;
+ error = xfs_qm_dqget_uncached(mp, 0, type, &dqp);
if (!error) {
xfs_disk_dquot_t *ddqp = &dqp->q_core;