xfs: refactor default quota limits by resource
Now that we've split up the dquot resource fields into separate structs,
do the same for the default limits to enable further refactoring.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
index 1ef6663..8ab4dd4 100644
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
@@ -562,12 +562,12 @@ xfs_qm_set_defquota(
* Timers and warnings have been already set, let's just set the
* default limits for this quota type
*/
- defq->bhardlimit = dqp->q_blk.hardlimit;
- defq->bsoftlimit = dqp->q_blk.softlimit;
- defq->ihardlimit = dqp->q_ino.hardlimit;
- defq->isoftlimit = dqp->q_ino.softlimit;
- defq->rtbhardlimit = dqp->q_rtb.hardlimit;
- defq->rtbsoftlimit = dqp->q_rtb.softlimit;
+ defq->blk.hard = dqp->q_blk.hardlimit;
+ defq->blk.soft = dqp->q_blk.softlimit;
+ defq->ino.hard = dqp->q_ino.hardlimit;
+ defq->ino.soft = dqp->q_ino.softlimit;
+ defq->rtb.hard = dqp->q_rtb.hardlimit;
+ defq->rtb.soft = dqp->q_rtb.softlimit;
xfs_qm_dqdestroy(dqp);
}
@@ -584,12 +584,12 @@ xfs_qm_init_timelimits(
defq = xfs_get_defquota(qinf, type);
- defq->btimelimit = XFS_QM_BTIMELIMIT;
- defq->itimelimit = XFS_QM_ITIMELIMIT;
- defq->rtbtimelimit = XFS_QM_RTBTIMELIMIT;
- defq->bwarnlimit = XFS_QM_BWARNLIMIT;
- defq->iwarnlimit = XFS_QM_IWARNLIMIT;
- defq->rtbwarnlimit = XFS_QM_RTBWARNLIMIT;
+ defq->blk.time = XFS_QM_BTIMELIMIT;
+ defq->ino.time = XFS_QM_ITIMELIMIT;
+ defq->rtb.time = XFS_QM_RTBTIMELIMIT;
+ defq->blk.warn = XFS_QM_BWARNLIMIT;
+ defq->ino.warn = XFS_QM_IWARNLIMIT;
+ defq->rtb.warn = XFS_QM_RTBWARNLIMIT;
/*
* We try to get the limits from the superuser's limits fields.
@@ -608,17 +608,17 @@ xfs_qm_init_timelimits(
* more writing. If it is zero, a default is used.
*/
if (dqp->q_blk.timer)
- defq->btimelimit = dqp->q_blk.timer;
+ defq->blk.time = dqp->q_blk.timer;
if (dqp->q_ino.timer)
- defq->itimelimit = dqp->q_ino.timer;
+ defq->ino.time = dqp->q_ino.timer;
if (dqp->q_rtb.timer)
- defq->rtbtimelimit = dqp->q_rtb.timer;
+ defq->rtb.time = dqp->q_rtb.timer;
if (dqp->q_blk.warnings)
- defq->bwarnlimit = dqp->q_blk.warnings;
+ defq->blk.warn = dqp->q_blk.warnings;
if (dqp->q_ino.warnings)
- defq->iwarnlimit = dqp->q_ino.warnings;
+ defq->ino.warn = dqp->q_ino.warnings;
if (dqp->q_rtb.warnings)
- defq->rtbwarnlimit = dqp->q_rtb.warnings;
+ defq->rtb.warn = dqp->q_rtb.warnings;
xfs_qm_dqdestroy(dqp);
}