summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_quotaops.c
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2020-05-21 13:07:01 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2020-05-27 08:49:26 -0700
commite850301f0981741c47f5ee423380a2a963fce563 (patch)
treecb2d8ef1df1bc7ed4734803066bf6e01e4d8b1e7 /fs/xfs/xfs_quotaops.c
parentce6e7e79ced35a8ba4576d70bb999e8835f95769 (diff)
xfs: per-type quota timers and warn limits
Move timers and warnings out of xfs_quotainfo and into xfs_def_quota so that we can utilize them on a per-type basis, rather than enforcing them based on the values found in the first enabled quota type. Signed-off-by: Eric Sandeen <sandeen@redhat.com> [zlang: new way to get defquota in xfs_qm_init_timelimits] [zlang: remove redundant defq assign] Signed-off-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Eric Sandeen <sandeen@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/xfs_quotaops.c')
-rw-r--r--fs/xfs/xfs_quotaops.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/fs/xfs/xfs_quotaops.c b/fs/xfs/xfs_quotaops.c
index 411eeefa2a5c..bf809b77a316 100644
--- a/fs/xfs/xfs_quotaops.c
+++ b/fs/xfs/xfs_quotaops.c
@@ -21,9 +21,9 @@ xfs_qm_fill_state(
struct qc_type_state *tstate,
struct xfs_mount *mp,
struct xfs_inode *ip,
- xfs_ino_t ino)
+ xfs_ino_t ino,
+ struct xfs_def_quota *defq)
{
- struct xfs_quotainfo *q = mp->m_quotainfo;
bool tempqip = false;
tstate->ino = ino;
@@ -37,12 +37,12 @@ xfs_qm_fill_state(
tstate->flags |= QCI_SYSFILE;
tstate->blocks = ip->i_d.di_nblocks;
tstate->nextents = ip->i_df.if_nextents;
- tstate->spc_timelimit = (u32)q->qi_btimelimit;
- tstate->ino_timelimit = (u32)q->qi_itimelimit;
- tstate->rt_spc_timelimit = (u32)q->qi_rtbtimelimit;
- tstate->spc_warnlimit = q->qi_bwarnlimit;
- tstate->ino_warnlimit = q->qi_iwarnlimit;
- tstate->rt_spc_warnlimit = q->qi_rtbwarnlimit;
+ tstate->spc_timelimit = (u32)defq->btimelimit;
+ tstate->ino_timelimit = (u32)defq->itimelimit;
+ tstate->rt_spc_timelimit = (u32)defq->rtbtimelimit;
+ tstate->spc_warnlimit = defq->bwarnlimit;
+ tstate->ino_warnlimit = defq->iwarnlimit;
+ tstate->rt_spc_warnlimit = defq->rtbwarnlimit;
if (tempqip)
xfs_irele(ip);
}
@@ -77,11 +77,11 @@ xfs_fs_get_quota_state(
state->s_state[PRJQUOTA].flags |= QCI_LIMITS_ENFORCED;
xfs_qm_fill_state(&state->s_state[USRQUOTA], mp, q->qi_uquotaip,
- mp->m_sb.sb_uquotino);
+ mp->m_sb.sb_uquotino, &q->qi_usr_default);
xfs_qm_fill_state(&state->s_state[GRPQUOTA], mp, q->qi_gquotaip,
- mp->m_sb.sb_gquotino);
+ mp->m_sb.sb_gquotino, &q->qi_grp_default);
xfs_qm_fill_state(&state->s_state[PRJQUOTA], mp, q->qi_pquotaip,
- mp->m_sb.sb_pquotino);
+ mp->m_sb.sb_pquotino, &q->qi_prj_default);
return 0;
}