Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <catherine.hoang@oracle.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Dave Chinner <david@fromorbit.com>

authored by

Catherine Hoang and committed by
Dave Chinner
5cc21e52 86810a9e

+7 -33
-9
fs/xfs/xfs_qm.c
··· 582 582 defq->blk.time = XFS_QM_BTIMELIMIT; 583 583 defq->ino.time = XFS_QM_ITIMELIMIT; 584 584 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; 588 585 589 586 /* 590 587 * We try to get the limits from the superuser's limits fields. ··· 605 608 defq->ino.time = dqp->q_ino.timer; 606 609 if (dqp->q_rtb.timer) 607 610 defq->rtb.time = dqp->q_rtb.timer; 608 - if (dqp->q_blk.warnings) 609 - defq->blk.warn = dqp->q_blk.warnings; 610 - if (dqp->q_ino.warnings) 611 - defq->ino.warn = dqp->q_ino.warnings; 612 - if (dqp->q_rtb.warnings) 613 - defq->rtb.warn = dqp->q_rtb.warnings; 614 611 615 612 xfs_qm_dqdestroy(dqp); 616 613 }
-5
fs/xfs/xfs_qm.h
··· 34 34 xfs_qcnt_t hard; /* default hard limit */ 35 35 xfs_qcnt_t soft; /* default soft limit */ 36 36 time64_t time; /* limit for timers */ 37 - xfs_qwarncnt_t warn; /* limit for warnings */ 38 37 }; 39 38 40 39 /* Defaults for each quota type: time limits, warn limits, usage limits */ ··· 132 133 #define XFS_QM_BTIMELIMIT (7 * 24*60*60) /* 1 week */ 133 134 #define XFS_QM_RTBTIMELIMIT (7 * 24*60*60) /* 1 week */ 134 135 #define XFS_QM_ITIMELIMIT (7 * 24*60*60) /* 1 week */ 135 - 136 - #define XFS_QM_BWARNLIMIT 5 137 - #define XFS_QM_IWARNLIMIT 5 138 - #define XFS_QM_RTBWARNLIMIT 5 139 136 140 137 extern void xfs_qm_destroy_quotainfo(struct xfs_mount *); 141 138
+3 -14
fs/xfs/xfs_qm_syscalls.c
··· 251 251 } 252 252 253 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 - 264 - static inline void 265 254 xfs_setqlim_timer( 266 255 struct xfs_mount *mp, 267 256 struct xfs_dquot_res *res, ··· 344 355 if (xfs_setqlim_limits(mp, res, qlim, hard, soft, "blk")) 345 356 xfs_dquot_set_prealloc_limits(dqp); 346 357 if (newlim->d_fieldmask & QC_SPC_WARNS) 347 - xfs_setqlim_warns(res, qlim, newlim->d_spc_warns); 358 + res->warnings = newlim->d_spc_warns; 348 359 if (newlim->d_fieldmask & QC_SPC_TIMER) 349 360 xfs_setqlim_timer(mp, res, qlim, newlim->d_spc_timer); 350 361 ··· 360 371 361 372 xfs_setqlim_limits(mp, res, qlim, hard, soft, "rtb"); 362 373 if (newlim->d_fieldmask & QC_RT_SPC_WARNS) 363 - xfs_setqlim_warns(res, qlim, newlim->d_rt_spc_warns); 374 + res->warnings = newlim->d_rt_spc_warns; 364 375 if (newlim->d_fieldmask & QC_RT_SPC_TIMER) 365 376 xfs_setqlim_timer(mp, res, qlim, newlim->d_rt_spc_timer); 366 377 ··· 376 387 377 388 xfs_setqlim_limits(mp, res, qlim, hard, soft, "ino"); 378 389 if (newlim->d_fieldmask & QC_INO_WARNS) 379 - xfs_setqlim_warns(res, qlim, newlim->d_ino_warns); 390 + res->warnings = newlim->d_ino_warns; 380 391 if (newlim->d_fieldmask & QC_INO_TIMER) 381 392 xfs_setqlim_timer(mp, res, qlim, newlim->d_ino_timer); 382 393
+3 -3
fs/xfs/xfs_quotaops.c
··· 40 40 tstate->spc_timelimit = (u32)defq->blk.time; 41 41 tstate->ino_timelimit = (u32)defq->ino.time; 42 42 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; 46 46 if (tempqip) 47 47 xfs_irele(ip); 48 48 }
+1 -2
fs/xfs/xfs_trans_dquot.c
··· 597 597 if (softlimit && total_count > softlimit) { 598 598 time64_t now = ktime_get_real_seconds(); 599 599 600 - if ((res->timer != 0 && now > res->timer) || 601 - (res->warnings != 0 && res->warnings >= qlim->warn)) { 600 + if (res->timer != 0 && now > res->timer) { 602 601 *fatal = true; 603 602 return QUOTA_NL_ISOFTLONGWARN; 604 603 }