Skip to content

Commit 2e06df5

Browse files
catherinehoangdchinner
authored andcommitted
xfs: remove warning counters from struct xfs_dquot_res
Warning counts are not used anywhere in the kernel. In addition, there are no use cases, test coverage, or documentation for this functionality. Remove the 'warnings' field from struct xfs_dquot_res and any other related code. Signed-off-by: Catherine Hoang <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Reviewed-by: Allison Henderson <[email protected]> Signed-off-by: Dave Chinner <[email protected]>
1 parent 5cc21e5 commit 2e06df5

File tree

4 files changed

+7
-29
lines changed

4 files changed

+7
-29
lines changed

fs/xfs/libxfs/xfs_quota_defs.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
* and quota-limits. This is a waste in the common case, but hey ...
1717
*/
1818
typedef uint64_t xfs_qcnt_t;
19-
typedef uint16_t xfs_qwarncnt_t;
2019

2120
typedef uint8_t xfs_dqtype_t;
2221

fs/xfs/xfs_dquot.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,7 @@ xfs_qm_adjust_res_timer(
136136
res->timer = xfs_dquot_set_timeout(mp,
137137
ktime_get_real_seconds() + qlim->time);
138138
} else {
139-
if (res->timer == 0)
140-
res->warnings = 0;
141-
else
142-
res->timer = 0;
139+
res->timer = 0;
143140
}
144141
}
145142

@@ -592,10 +589,6 @@ xfs_dquot_from_disk(
592589
dqp->q_ino.count = be64_to_cpu(ddqp->d_icount);
593590
dqp->q_rtb.count = be64_to_cpu(ddqp->d_rtbcount);
594591

595-
dqp->q_blk.warnings = be16_to_cpu(ddqp->d_bwarns);
596-
dqp->q_ino.warnings = be16_to_cpu(ddqp->d_iwarns);
597-
dqp->q_rtb.warnings = be16_to_cpu(ddqp->d_rtbwarns);
598-
599592
dqp->q_blk.timer = xfs_dquot_from_disk_ts(ddqp, ddqp->d_btimer);
600593
dqp->q_ino.timer = xfs_dquot_from_disk_ts(ddqp, ddqp->d_itimer);
601594
dqp->q_rtb.timer = xfs_dquot_from_disk_ts(ddqp, ddqp->d_rtbtimer);
@@ -637,9 +630,9 @@ xfs_dquot_to_disk(
637630
ddqp->d_icount = cpu_to_be64(dqp->q_ino.count);
638631
ddqp->d_rtbcount = cpu_to_be64(dqp->q_rtb.count);
639632

640-
ddqp->d_bwarns = cpu_to_be16(dqp->q_blk.warnings);
641-
ddqp->d_iwarns = cpu_to_be16(dqp->q_ino.warnings);
642-
ddqp->d_rtbwarns = cpu_to_be16(dqp->q_rtb.warnings);
633+
ddqp->d_bwarns = 0;
634+
ddqp->d_iwarns = 0;
635+
ddqp->d_rtbwarns = 0;
643636

644637
ddqp->d_btimer = xfs_dquot_to_disk_ts(dqp, dqp->q_blk.timer);
645638
ddqp->d_itimer = xfs_dquot_to_disk_ts(dqp, dqp->q_ino.timer);

fs/xfs/xfs_dquot.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,6 @@ struct xfs_dquot_res {
4444
* in seconds since the Unix epoch.
4545
*/
4646
time64_t timer;
47-
48-
/*
49-
* For root dquots, this is the maximum number of warnings that will
50-
* be issued for this quota type. Otherwise, this is the number of
51-
* warnings issued against this quota. Note that none of this is
52-
* implemented.
53-
*/
54-
xfs_qwarncnt_t warnings;
5547
};
5648

5749
static inline bool

fs/xfs/xfs_qm_syscalls.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,6 @@ xfs_qm_scall_setqlim(
343343

344344
if (xfs_setqlim_limits(mp, res, qlim, hard, soft, "blk"))
345345
xfs_dquot_set_prealloc_limits(dqp);
346-
if (newlim->d_fieldmask & QC_SPC_WARNS)
347-
res->warnings = newlim->d_spc_warns;
348346
if (newlim->d_fieldmask & QC_SPC_TIMER)
349347
xfs_setqlim_timer(mp, res, qlim, newlim->d_spc_timer);
350348

@@ -359,8 +357,6 @@ xfs_qm_scall_setqlim(
359357
qlim = id == 0 ? &defq->rtb : NULL;
360358

361359
xfs_setqlim_limits(mp, res, qlim, hard, soft, "rtb");
362-
if (newlim->d_fieldmask & QC_RT_SPC_WARNS)
363-
res->warnings = newlim->d_rt_spc_warns;
364360
if (newlim->d_fieldmask & QC_RT_SPC_TIMER)
365361
xfs_setqlim_timer(mp, res, qlim, newlim->d_rt_spc_timer);
366362

@@ -375,8 +371,6 @@ xfs_qm_scall_setqlim(
375371
qlim = id == 0 ? &defq->ino : NULL;
376372

377373
xfs_setqlim_limits(mp, res, qlim, hard, soft, "ino");
378-
if (newlim->d_fieldmask & QC_INO_WARNS)
379-
res->warnings = newlim->d_ino_warns;
380374
if (newlim->d_fieldmask & QC_INO_TIMER)
381375
xfs_setqlim_timer(mp, res, qlim, newlim->d_ino_timer);
382376

@@ -417,13 +411,13 @@ xfs_qm_scall_getquota_fill_qc(
417411
dst->d_ino_count = dqp->q_ino.reserved;
418412
dst->d_spc_timer = dqp->q_blk.timer;
419413
dst->d_ino_timer = dqp->q_ino.timer;
420-
dst->d_ino_warns = dqp->q_ino.warnings;
421-
dst->d_spc_warns = dqp->q_blk.warnings;
414+
dst->d_ino_warns = 0;
415+
dst->d_spc_warns = 0;
422416
dst->d_rt_spc_hardlimit = XFS_FSB_TO_B(mp, dqp->q_rtb.hardlimit);
423417
dst->d_rt_spc_softlimit = XFS_FSB_TO_B(mp, dqp->q_rtb.softlimit);
424418
dst->d_rt_space = XFS_FSB_TO_B(mp, dqp->q_rtb.reserved);
425419
dst->d_rt_spc_timer = dqp->q_rtb.timer;
426-
dst->d_rt_spc_warns = dqp->q_rtb.warnings;
420+
dst->d_rt_spc_warns = 0;
427421

428422
/*
429423
* Internally, we don't reset all the timers when quota enforcement

0 commit comments

Comments
 (0)