Skip to content

Commit 5cc21e5

Browse files
catherinehoangdchinner
authored andcommitted
xfs: remove quota warning limit from struct xfs_quota_limits
Warning limits in xfs quota is an unused feature that is currently documented as unimplemented, and it is unclear what the intended behavior of these limits are. Remove the ‘warn’ field from struct xfs_quota_limits and any other related code. Signed-off-by: Catherine Hoang <[email protected]> Reviewed-by: Allison Henderson <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Dave Chinner <[email protected]>
1 parent 86810a9 commit 5cc21e5

File tree

5 files changed

+7
-33
lines changed

5 files changed

+7
-33
lines changed

fs/xfs/xfs_qm.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -582,9 +582,6 @@ xfs_qm_init_timelimits(
582582
defq->blk.time = XFS_QM_BTIMELIMIT;
583583
defq->ino.time = XFS_QM_ITIMELIMIT;
584584
defq->rtb.time = XFS_QM_RTBTIMELIMIT;
585-
defq->blk.warn = XFS_QM_BWARNLIMIT;
586-
defq->ino.warn = XFS_QM_IWARNLIMIT;
587-
defq->rtb.warn = XFS_QM_RTBWARNLIMIT;
588585

589586
/*
590587
* We try to get the limits from the superuser's limits fields.
@@ -608,12 +605,6 @@ xfs_qm_init_timelimits(
608605
defq->ino.time = dqp->q_ino.timer;
609606
if (dqp->q_rtb.timer)
610607
defq->rtb.time = dqp->q_rtb.timer;
611-
if (dqp->q_blk.warnings)
612-
defq->blk.warn = dqp->q_blk.warnings;
613-
if (dqp->q_ino.warnings)
614-
defq->ino.warn = dqp->q_ino.warnings;
615-
if (dqp->q_rtb.warnings)
616-
defq->rtb.warn = dqp->q_rtb.warnings;
617608

618609
xfs_qm_dqdestroy(dqp);
619610
}

fs/xfs/xfs_qm.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ struct xfs_quota_limits {
3434
xfs_qcnt_t hard; /* default hard limit */
3535
xfs_qcnt_t soft; /* default soft limit */
3636
time64_t time; /* limit for timers */
37-
xfs_qwarncnt_t warn; /* limit for warnings */
3837
};
3938

4039
/* Defaults for each quota type: time limits, warn limits, usage limits */
@@ -134,10 +133,6 @@ struct xfs_dquot_acct {
134133
#define XFS_QM_RTBTIMELIMIT (7 * 24*60*60) /* 1 week */
135134
#define XFS_QM_ITIMELIMIT (7 * 24*60*60) /* 1 week */
136135

137-
#define XFS_QM_BWARNLIMIT 5
138-
#define XFS_QM_IWARNLIMIT 5
139-
#define XFS_QM_RTBWARNLIMIT 5
140-
141136
extern void xfs_qm_destroy_quotainfo(struct xfs_mount *);
142137

143138
/* quota ops */

fs/xfs/xfs_qm_syscalls.c

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -250,17 +250,6 @@ xfs_setqlim_limits(
250250
return true;
251251
}
252252

253-
static inline void
254-
xfs_setqlim_warns(
255-
struct xfs_dquot_res *res,
256-
struct xfs_quota_limits *qlim,
257-
int warns)
258-
{
259-
res->warnings = warns;
260-
if (qlim)
261-
qlim->warn = warns;
262-
}
263-
264253
static inline void
265254
xfs_setqlim_timer(
266255
struct xfs_mount *mp,
@@ -355,7 +344,7 @@ xfs_qm_scall_setqlim(
355344
if (xfs_setqlim_limits(mp, res, qlim, hard, soft, "blk"))
356345
xfs_dquot_set_prealloc_limits(dqp);
357346
if (newlim->d_fieldmask & QC_SPC_WARNS)
358-
xfs_setqlim_warns(res, qlim, newlim->d_spc_warns);
347+
res->warnings = newlim->d_spc_warns;
359348
if (newlim->d_fieldmask & QC_SPC_TIMER)
360349
xfs_setqlim_timer(mp, res, qlim, newlim->d_spc_timer);
361350

@@ -371,7 +360,7 @@ xfs_qm_scall_setqlim(
371360

372361
xfs_setqlim_limits(mp, res, qlim, hard, soft, "rtb");
373362
if (newlim->d_fieldmask & QC_RT_SPC_WARNS)
374-
xfs_setqlim_warns(res, qlim, newlim->d_rt_spc_warns);
363+
res->warnings = newlim->d_rt_spc_warns;
375364
if (newlim->d_fieldmask & QC_RT_SPC_TIMER)
376365
xfs_setqlim_timer(mp, res, qlim, newlim->d_rt_spc_timer);
377366

@@ -387,7 +376,7 @@ xfs_qm_scall_setqlim(
387376

388377
xfs_setqlim_limits(mp, res, qlim, hard, soft, "ino");
389378
if (newlim->d_fieldmask & QC_INO_WARNS)
390-
xfs_setqlim_warns(res, qlim, newlim->d_ino_warns);
379+
res->warnings = newlim->d_ino_warns;
391380
if (newlim->d_fieldmask & QC_INO_TIMER)
392381
xfs_setqlim_timer(mp, res, qlim, newlim->d_ino_timer);
393382

fs/xfs/xfs_quotaops.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ xfs_qm_fill_state(
4040
tstate->spc_timelimit = (u32)defq->blk.time;
4141
tstate->ino_timelimit = (u32)defq->ino.time;
4242
tstate->rt_spc_timelimit = (u32)defq->rtb.time;
43-
tstate->spc_warnlimit = defq->blk.warn;
44-
tstate->ino_warnlimit = defq->ino.warn;
45-
tstate->rt_spc_warnlimit = defq->rtb.warn;
43+
tstate->spc_warnlimit = 0;
44+
tstate->ino_warnlimit = 0;
45+
tstate->rt_spc_warnlimit = 0;
4646
if (tempqip)
4747
xfs_irele(ip);
4848
}

fs/xfs/xfs_trans_dquot.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,8 +597,7 @@ xfs_dqresv_check(
597597
if (softlimit && total_count > softlimit) {
598598
time64_t now = ktime_get_real_seconds();
599599

600-
if ((res->timer != 0 && now > res->timer) ||
601-
(res->warnings != 0 && res->warnings >= qlim->warn)) {
600+
if (res->timer != 0 && now > res->timer) {
602601
*fatal = true;
603602
return QUOTA_NL_ISOFTLONGWARN;
604603
}

0 commit comments

Comments
 (0)