xfs: use a per-resource struct for incore dquot data
Introduce a new struct xfs_dquot_res that we'll use to track all the incore data for a particular resource type (block, inode, rt block). This will help us (once we've eliminated q_core) to declutter quota functions that currently open-code field access or pass around fields around explicitly. 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> Reviewed-by: Allison Collins <allison.henderson@oracle.com>
This commit is contained in:
@@ -29,8 +29,8 @@ xfs_fill_statvfs_from_dquot(
|
||||
if (limit && statp->f_blocks > limit) {
|
||||
statp->f_blocks = limit;
|
||||
statp->f_bfree = statp->f_bavail =
|
||||
(statp->f_blocks > dqp->q_res_bcount) ?
|
||||
(statp->f_blocks - dqp->q_res_bcount) : 0;
|
||||
(statp->f_blocks > dqp->q_blk.reserved) ?
|
||||
(statp->f_blocks - dqp->q_blk.reserved) : 0;
|
||||
}
|
||||
|
||||
limit = dqp->q_core.d_ino_softlimit ?
|
||||
@@ -39,8 +39,8 @@ xfs_fill_statvfs_from_dquot(
|
||||
if (limit && statp->f_files > limit) {
|
||||
statp->f_files = limit;
|
||||
statp->f_ffree =
|
||||
(statp->f_files > dqp->q_res_icount) ?
|
||||
(statp->f_files - dqp->q_res_icount) : 0;
|
||||
(statp->f_files > dqp->q_ino.reserved) ?
|
||||
(statp->f_files - dqp->q_ino.reserved) : 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user