提交 903b1fc2 编写于 作者: D Darrick J. Wong

xfs: widen quota block counters to 64-bit integers

Widen the incore quota transaction delta structure to treat block
counters as 64-bit integers.  This is a necessary addition so that we
can widen the i_delayed_blks counter to be a 64-bit integer.
Signed-off-by: NDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: NAllison Collins <allison.henderson@oracle.com>
Reviewed-by: NDave Chinner <dchinner@redhat.com>
Reviewed-by: NChristoph Hellwig <hch@lst.de>
上级 1fdeaea4
...@@ -113,12 +113,8 @@ xfs_quota_inode(xfs_mount_t *mp, uint dq_flags) ...@@ -113,12 +113,8 @@ xfs_quota_inode(xfs_mount_t *mp, uint dq_flags)
return NULL; return NULL;
} }
extern void xfs_trans_mod_dquot(struct xfs_trans *, extern void xfs_trans_mod_dquot(struct xfs_trans *tp, struct xfs_dquot *dqp,
struct xfs_dquot *, uint, long); uint field, int64_t delta);
extern int xfs_trans_reserve_quota_bydquots(struct xfs_trans *,
struct xfs_mount *, struct xfs_dquot *,
struct xfs_dquot *, struct xfs_dquot *,
long, long, uint);
extern void xfs_trans_dqjoin(struct xfs_trans *, struct xfs_dquot *); extern void xfs_trans_dqjoin(struct xfs_trans *, struct xfs_dquot *);
extern void xfs_trans_log_dquot(struct xfs_trans *, struct xfs_dquot *); extern void xfs_trans_log_dquot(struct xfs_trans *, struct xfs_dquot *);
......
...@@ -58,30 +58,33 @@ xfs_quota_chkd_flag( ...@@ -58,30 +58,33 @@ xfs_quota_chkd_flag(
*/ */
typedef struct xfs_dqtrx { typedef struct xfs_dqtrx {
struct xfs_dquot *qt_dquot; /* the dquot this refers to */ struct xfs_dquot *qt_dquot; /* the dquot this refers to */
ulong qt_blk_res; /* blks reserved on a dquot */
ulong qt_ino_res; /* inode reserved on a dquot */ uint64_t qt_blk_res; /* blks reserved on a dquot */
ulong qt_ino_res_used; /* inodes used from the reservation */ int64_t qt_bcount_delta; /* dquot blk count changes */
long qt_bcount_delta; /* dquot blk count changes */ int64_t qt_delbcnt_delta; /* delayed dquot blk count changes */
long qt_delbcnt_delta; /* delayed dquot blk count changes */
long qt_icount_delta; /* dquot inode count changes */ uint64_t qt_rtblk_res; /* # blks reserved on a dquot */
ulong qt_rtblk_res; /* # blks reserved on a dquot */ uint64_t qt_rtblk_res_used;/* # blks used from reservation */
ulong qt_rtblk_res_used;/* # blks used from reservation */ int64_t qt_rtbcount_delta;/* dquot realtime blk changes */
long qt_rtbcount_delta;/* dquot realtime blk changes */ int64_t qt_delrtb_delta; /* delayed RT blk count changes */
long qt_delrtb_delta; /* delayed RT blk count changes */
uint64_t qt_ino_res; /* inode reserved on a dquot */
uint64_t qt_ino_res_used; /* inodes used from the reservation */
int64_t qt_icount_delta; /* dquot inode count changes */
} xfs_dqtrx_t; } xfs_dqtrx_t;
#ifdef CONFIG_XFS_QUOTA #ifdef CONFIG_XFS_QUOTA
extern void xfs_trans_dup_dqinfo(struct xfs_trans *, struct xfs_trans *); extern void xfs_trans_dup_dqinfo(struct xfs_trans *, struct xfs_trans *);
extern void xfs_trans_free_dqinfo(struct xfs_trans *); extern void xfs_trans_free_dqinfo(struct xfs_trans *);
extern void xfs_trans_mod_dquot_byino(struct xfs_trans *, struct xfs_inode *, extern void xfs_trans_mod_dquot_byino(struct xfs_trans *, struct xfs_inode *,
uint, long); uint, int64_t);
extern void xfs_trans_apply_dquot_deltas(struct xfs_trans *); extern void xfs_trans_apply_dquot_deltas(struct xfs_trans *);
extern void xfs_trans_unreserve_and_mod_dquots(struct xfs_trans *); extern void xfs_trans_unreserve_and_mod_dquots(struct xfs_trans *);
extern int xfs_trans_reserve_quota_nblks(struct xfs_trans *, extern int xfs_trans_reserve_quota_nblks(struct xfs_trans *,
struct xfs_inode *, long, long, uint); struct xfs_inode *, int64_t, long, uint);
extern int xfs_trans_reserve_quota_bydquots(struct xfs_trans *, extern int xfs_trans_reserve_quota_bydquots(struct xfs_trans *,
struct xfs_mount *, struct xfs_dquot *, struct xfs_mount *, struct xfs_dquot *,
struct xfs_dquot *, struct xfs_dquot *, long, long, uint); struct xfs_dquot *, struct xfs_dquot *, int64_t, long, uint);
extern int xfs_qm_vop_dqalloc(struct xfs_inode *, xfs_dqid_t, xfs_dqid_t, extern int xfs_qm_vop_dqalloc(struct xfs_inode *, xfs_dqid_t, xfs_dqid_t,
prid_t, uint, struct xfs_dquot **, struct xfs_dquot **, prid_t, uint, struct xfs_dquot **, struct xfs_dquot **,
...@@ -121,14 +124,14 @@ xfs_qm_vop_dqalloc(struct xfs_inode *ip, xfs_dqid_t uid, xfs_dqid_t gid, ...@@ -121,14 +124,14 @@ xfs_qm_vop_dqalloc(struct xfs_inode *ip, xfs_dqid_t uid, xfs_dqid_t gid,
#define xfs_trans_apply_dquot_deltas(tp) #define xfs_trans_apply_dquot_deltas(tp)
#define xfs_trans_unreserve_and_mod_dquots(tp) #define xfs_trans_unreserve_and_mod_dquots(tp)
static inline int xfs_trans_reserve_quota_nblks(struct xfs_trans *tp, static inline int xfs_trans_reserve_quota_nblks(struct xfs_trans *tp,
struct xfs_inode *ip, long nblks, long ninos, uint flags) struct xfs_inode *ip, int64_t nblks, long ninos, uint flags)
{ {
return 0; return 0;
} }
static inline int xfs_trans_reserve_quota_bydquots(struct xfs_trans *tp, static inline int xfs_trans_reserve_quota_bydquots(struct xfs_trans *tp,
struct xfs_mount *mp, struct xfs_dquot *udqp, struct xfs_mount *mp, struct xfs_dquot *udqp,
struct xfs_dquot *gdqp, struct xfs_dquot *pdqp, struct xfs_dquot *gdqp, struct xfs_dquot *pdqp,
long nblks, long nions, uint flags) int64_t nblks, long nions, uint flags)
{ {
return 0; return 0;
} }
......
...@@ -80,7 +80,7 @@ xfs_trans_dup_dqinfo( ...@@ -80,7 +80,7 @@ xfs_trans_dup_dqinfo(
xfs_dqtrx_t *oq, *nq; xfs_dqtrx_t *oq, *nq;
int i, j; int i, j;
xfs_dqtrx_t *oqa, *nqa; xfs_dqtrx_t *oqa, *nqa;
ulong blk_res_used; uint64_t blk_res_used;
if (!otp->t_dqinfo) if (!otp->t_dqinfo)
return; return;
...@@ -137,7 +137,7 @@ xfs_trans_mod_dquot_byino( ...@@ -137,7 +137,7 @@ xfs_trans_mod_dquot_byino(
xfs_trans_t *tp, xfs_trans_t *tp,
xfs_inode_t *ip, xfs_inode_t *ip,
uint field, uint field,
long delta) int64_t delta)
{ {
xfs_mount_t *mp = tp->t_mountp; xfs_mount_t *mp = tp->t_mountp;
...@@ -194,7 +194,7 @@ xfs_trans_mod_dquot( ...@@ -194,7 +194,7 @@ xfs_trans_mod_dquot(
xfs_trans_t *tp, xfs_trans_t *tp,
xfs_dquot_t *dqp, xfs_dquot_t *dqp,
uint field, uint field,
long delta) int64_t delta)
{ {
xfs_dqtrx_t *qtrx; xfs_dqtrx_t *qtrx;
...@@ -219,14 +219,14 @@ xfs_trans_mod_dquot( ...@@ -219,14 +219,14 @@ xfs_trans_mod_dquot(
* regular disk blk reservation * regular disk blk reservation
*/ */
case XFS_TRANS_DQ_RES_BLKS: case XFS_TRANS_DQ_RES_BLKS:
qtrx->qt_blk_res += (ulong)delta; qtrx->qt_blk_res += delta;
break; break;
/* /*
* inode reservation * inode reservation
*/ */
case XFS_TRANS_DQ_RES_INOS: case XFS_TRANS_DQ_RES_INOS:
qtrx->qt_ino_res += (ulong)delta; qtrx->qt_ino_res += delta;
break; break;
/* /*
...@@ -245,7 +245,7 @@ xfs_trans_mod_dquot( ...@@ -245,7 +245,7 @@ xfs_trans_mod_dquot(
*/ */
case XFS_TRANS_DQ_ICOUNT: case XFS_TRANS_DQ_ICOUNT:
if (qtrx->qt_ino_res && delta > 0) { if (qtrx->qt_ino_res && delta > 0) {
qtrx->qt_ino_res_used += (ulong)delta; qtrx->qt_ino_res_used += delta;
ASSERT(qtrx->qt_ino_res >= qtrx->qt_ino_res_used); ASSERT(qtrx->qt_ino_res >= qtrx->qt_ino_res_used);
} }
qtrx->qt_icount_delta += delta; qtrx->qt_icount_delta += delta;
...@@ -255,7 +255,7 @@ xfs_trans_mod_dquot( ...@@ -255,7 +255,7 @@ xfs_trans_mod_dquot(
* rtblk reservation * rtblk reservation
*/ */
case XFS_TRANS_DQ_RES_RTBLKS: case XFS_TRANS_DQ_RES_RTBLKS:
qtrx->qt_rtblk_res += (ulong)delta; qtrx->qt_rtblk_res += delta;
break; break;
/* /*
...@@ -263,7 +263,7 @@ xfs_trans_mod_dquot( ...@@ -263,7 +263,7 @@ xfs_trans_mod_dquot(
*/ */
case XFS_TRANS_DQ_RTBCOUNT: case XFS_TRANS_DQ_RTBCOUNT:
if (qtrx->qt_rtblk_res && delta > 0) { if (qtrx->qt_rtblk_res && delta > 0) {
qtrx->qt_rtblk_res_used += (ulong)delta; qtrx->qt_rtblk_res_used += delta;
ASSERT(qtrx->qt_rtblk_res >= qtrx->qt_rtblk_res_used); ASSERT(qtrx->qt_rtblk_res >= qtrx->qt_rtblk_res_used);
} }
qtrx->qt_rtbcount_delta += delta; qtrx->qt_rtbcount_delta += delta;
...@@ -320,8 +320,8 @@ xfs_trans_apply_dquot_deltas( ...@@ -320,8 +320,8 @@ xfs_trans_apply_dquot_deltas(
struct xfs_dquot *dqp; struct xfs_dquot *dqp;
struct xfs_dqtrx *qtrx, *qa; struct xfs_dqtrx *qtrx, *qa;
struct xfs_disk_dquot *d; struct xfs_disk_dquot *d;
long totalbdelta; int64_t totalbdelta;
long totalrtbdelta; int64_t totalrtbdelta;
if (!(tp->t_flags & XFS_TRANS_DQ_DIRTY)) if (!(tp->t_flags & XFS_TRANS_DQ_DIRTY))
return; return;
...@@ -413,7 +413,7 @@ xfs_trans_apply_dquot_deltas( ...@@ -413,7 +413,7 @@ xfs_trans_apply_dquot_deltas(
* reservation that a transaction structure knows of. * reservation that a transaction structure knows of.
*/ */
if (qtrx->qt_blk_res != 0) { if (qtrx->qt_blk_res != 0) {
ulong blk_res_used = 0; uint64_t blk_res_used = 0;
if (qtrx->qt_bcount_delta > 0) if (qtrx->qt_bcount_delta > 0)
blk_res_used = qtrx->qt_bcount_delta; blk_res_used = qtrx->qt_bcount_delta;
...@@ -585,7 +585,7 @@ xfs_trans_dqresv( ...@@ -585,7 +585,7 @@ xfs_trans_dqresv(
xfs_trans_t *tp, xfs_trans_t *tp,
xfs_mount_t *mp, xfs_mount_t *mp,
xfs_dquot_t *dqp, xfs_dquot_t *dqp,
long nblks, int64_t nblks,
long ninos, long ninos,
uint flags) uint flags)
{ {
...@@ -745,7 +745,7 @@ xfs_trans_reserve_quota_bydquots( ...@@ -745,7 +745,7 @@ xfs_trans_reserve_quota_bydquots(
struct xfs_dquot *udqp, struct xfs_dquot *udqp,
struct xfs_dquot *gdqp, struct xfs_dquot *gdqp,
struct xfs_dquot *pdqp, struct xfs_dquot *pdqp,
long nblks, int64_t nblks,
long ninos, long ninos,
uint flags) uint flags)
{ {
...@@ -804,7 +804,7 @@ int ...@@ -804,7 +804,7 @@ int
xfs_trans_reserve_quota_nblks( xfs_trans_reserve_quota_nblks(
struct xfs_trans *tp, struct xfs_trans *tp,
struct xfs_inode *ip, struct xfs_inode *ip,
long nblks, int64_t nblks,
long ninos, long ninos,
uint flags) uint flags)
{ {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册