xfs: stop using q_core counters in the quota code

Add counter fields to the incore dquot, and use that instead of the ones
in qcore.  This eliminates a bunch of endian conversions and will
eventually allow us to remove qcore entirely.

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>
此提交包含在:
Darrick J. Wong
2020-07-14 10:37:31 -07:00
父節點 d3537cf93e
當前提交 be37d40c1b
共有 7 個檔案被更改,包括 56 行新增62 行删除

查看文件

@@ -309,7 +309,6 @@ xfs_trans_apply_dquot_deltas(
int i, j;
struct xfs_dquot *dqp;
struct xfs_dqtrx *qtrx, *qa;
struct xfs_disk_dquot *d;
int64_t totalbdelta;
int64_t totalrtbdelta;
@@ -341,7 +340,6 @@ xfs_trans_apply_dquot_deltas(
/*
* adjust the actual number of blocks used
*/
d = &dqp->q_core;
/*
* The issue here is - sometimes we don't make a blkquota
@@ -362,25 +360,22 @@ xfs_trans_apply_dquot_deltas(
qtrx->qt_delrtb_delta;
#ifdef DEBUG
if (totalbdelta < 0)
ASSERT(be64_to_cpu(d->d_bcount) >=
-totalbdelta);
ASSERT(dqp->q_blk.count >= -totalbdelta);
if (totalrtbdelta < 0)
ASSERT(be64_to_cpu(d->d_rtbcount) >=
-totalrtbdelta);
ASSERT(dqp->q_rtb.count >= -totalrtbdelta);
if (qtrx->qt_icount_delta < 0)
ASSERT(be64_to_cpu(d->d_icount) >=
-qtrx->qt_icount_delta);
ASSERT(dqp->q_ino.count >= -qtrx->qt_icount_delta);
#endif
if (totalbdelta)
be64_add_cpu(&d->d_bcount, (xfs_qcnt_t)totalbdelta);
dqp->q_blk.count += totalbdelta;
if (qtrx->qt_icount_delta)
be64_add_cpu(&d->d_icount, (xfs_qcnt_t)qtrx->qt_icount_delta);
dqp->q_ino.count += qtrx->qt_icount_delta;
if (totalrtbdelta)
be64_add_cpu(&d->d_rtbcount, (xfs_qcnt_t)totalrtbdelta);
dqp->q_rtb.count += totalrtbdelta;
/*
* Get any default limits in use.
@@ -467,12 +462,9 @@ xfs_trans_apply_dquot_deltas(
(xfs_qcnt_t)qtrx->qt_icount_delta;
}
ASSERT(dqp->q_blk.reserved >=
be64_to_cpu(dqp->q_core.d_bcount));
ASSERT(dqp->q_ino.reserved >=
be64_to_cpu(dqp->q_core.d_icount));
ASSERT(dqp->q_rtb.reserved >=
be64_to_cpu(dqp->q_core.d_rtbcount));
ASSERT(dqp->q_blk.reserved >= dqp->q_blk.count);
ASSERT(dqp->q_ino.reserved >= dqp->q_ino.count);
ASSERT(dqp->q_rtb.reserved >= dqp->q_rtb.count);
}
}
}
@@ -675,7 +667,7 @@ xfs_trans_dqresv(
/*
* Change the reservation, but not the actual usage.
* Note that q_blk.reserved = q_core.d_bcount + resv
* Note that q_blk.reserved = q_blk.count + resv
*/
(*resbcountp) += (xfs_qcnt_t)nblks;
if (ninos != 0)
@@ -700,9 +692,9 @@ xfs_trans_dqresv(
XFS_TRANS_DQ_RES_INOS,
ninos);
}
ASSERT(dqp->q_blk.reserved >= be64_to_cpu(dqp->q_core.d_bcount));
ASSERT(dqp->q_rtb.reserved >= be64_to_cpu(dqp->q_core.d_rtbcount));
ASSERT(dqp->q_ino.reserved >= be64_to_cpu(dqp->q_core.d_icount));
ASSERT(dqp->q_blk.reserved >= dqp->q_blk.count);
ASSERT(dqp->q_rtb.reserved >= dqp->q_rtb.count);
ASSERT(dqp->q_ino.reserved >= dqp->q_ino.count);
xfs_dqunlock(dqp);
return 0;