Commit 1149d96a authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Nathan Scott

[XFS] endianess annotations and cleanup for the quota code

SGI-PV: 943272
SGI-Modid: xfs-linux:xfs-kern:199767a
Signed-off-by: default avatarChristoph Hellwig <hch@sgi.com>
Signed-off-by: default avatarNathan Scott <nathans@sgi.com>
parent fa7e7d71
...@@ -96,7 +96,7 @@ xfs_qm_dqinit( ...@@ -96,7 +96,7 @@ xfs_qm_dqinit(
brandnewdquot = xfs_qm_dqalloc_incore(&dqp); brandnewdquot = xfs_qm_dqalloc_incore(&dqp);
dqp->dq_flags = type; dqp->dq_flags = type;
INT_SET(dqp->q_core.d_id, ARCH_CONVERT, id); dqp->q_core.d_id = cpu_to_be32(id);
dqp->q_mount = mp; dqp->q_mount = mp;
/* /*
...@@ -178,10 +178,10 @@ xfs_qm_dqinit_core( ...@@ -178,10 +178,10 @@ xfs_qm_dqinit_core(
/* /*
* Caller has zero'd the entire dquot 'chunk' already. * Caller has zero'd the entire dquot 'chunk' already.
*/ */
INT_SET(d->dd_diskdq.d_magic, ARCH_CONVERT, XFS_DQUOT_MAGIC); d->dd_diskdq.d_magic = cpu_to_be16(XFS_DQUOT_MAGIC);
INT_SET(d->dd_diskdq.d_version, ARCH_CONVERT, XFS_DQUOT_VERSION); d->dd_diskdq.d_version = XFS_DQUOT_VERSION;
INT_SET(d->dd_diskdq.d_id, ARCH_CONVERT, id); d->dd_diskdq.d_id = cpu_to_be32(id);
INT_SET(d->dd_diskdq.d_flags, ARCH_CONVERT, type); d->dd_diskdq.d_flags = type;
} }
...@@ -211,19 +211,13 @@ __xfs_dqtrace_entry( ...@@ -211,19 +211,13 @@ __xfs_dqtrace_entry(
(void *)(__psint_t)dqp->q_nrefs, (void *)(__psint_t)dqp->q_nrefs,
(void *)(__psint_t)dqp->dq_flags, (void *)(__psint_t)dqp->dq_flags,
(void *)(__psint_t)dqp->q_res_bcount, (void *)(__psint_t)dqp->q_res_bcount,
(void *)(__psint_t)INT_GET(dqp->q_core.d_bcount, (void *)(__psint_t)be64_to_cpu(dqp->q_core.d_bcount),
ARCH_CONVERT), (void *)(__psint_t)be64_to_cpu(dqp->q_core.d_icount),
(void *)(__psint_t)INT_GET(dqp->q_core.d_icount, (void *)(__psint_t)be64_to_cpu(dqp->q_core.d_blk_hardlimit),
ARCH_CONVERT), (void *)(__psint_t)be64_to_cpu(dqp->q_core.d_blk_softlimit),
(void *)(__psint_t)INT_GET(dqp->q_core.d_blk_hardlimit, (void *)(__psint_t)be64_to_cpu(dqp->q_core.d_ino_hardlimit),
ARCH_CONVERT), (void *)(__psint_t)be64_to_cpu(dqp->q_core.d_ino_softlimit),
(void *)(__psint_t)INT_GET(dqp->q_core.d_blk_softlimit, (void *)(__psint_t)be32_to_cpu(dqp->q_core.d_id),
ARCH_CONVERT),
(void *)(__psint_t)INT_GET(dqp->q_core.d_ino_hardlimit,
ARCH_CONVERT),
(void *)(__psint_t)INT_GET(dqp->q_core.d_ino_softlimit,
ARCH_CONVERT),
(void *)(__psint_t)INT_GET(dqp->q_core.d_id, ARCH_CONVERT),
(void *)(__psint_t)current_pid(), (void *)(__psint_t)current_pid(),
(void *)(__psint_t)ino, (void *)(__psint_t)ino,
(void *)(__psint_t)retaddr, (void *)(__psint_t)retaddr,
...@@ -248,17 +242,17 @@ xfs_qm_adjust_dqlimits( ...@@ -248,17 +242,17 @@ xfs_qm_adjust_dqlimits(
ASSERT(d->d_id); ASSERT(d->d_id);
if (q->qi_bsoftlimit && !d->d_blk_softlimit) if (q->qi_bsoftlimit && !d->d_blk_softlimit)
INT_SET(d->d_blk_softlimit, ARCH_CONVERT, q->qi_bsoftlimit); d->d_blk_softlimit = cpu_to_be64(q->qi_bsoftlimit);
if (q->qi_bhardlimit && !d->d_blk_hardlimit) if (q->qi_bhardlimit && !d->d_blk_hardlimit)
INT_SET(d->d_blk_hardlimit, ARCH_CONVERT, q->qi_bhardlimit); d->d_blk_hardlimit = cpu_to_be64(q->qi_bhardlimit);
if (q->qi_isoftlimit && !d->d_ino_softlimit) if (q->qi_isoftlimit && !d->d_ino_softlimit)
INT_SET(d->d_ino_softlimit, ARCH_CONVERT, q->qi_isoftlimit); d->d_ino_softlimit = cpu_to_be64(q->qi_isoftlimit);
if (q->qi_ihardlimit && !d->d_ino_hardlimit) if (q->qi_ihardlimit && !d->d_ino_hardlimit)
INT_SET(d->d_ino_hardlimit, ARCH_CONVERT, q->qi_ihardlimit); d->d_ino_hardlimit = cpu_to_be64(q->qi_ihardlimit);
if (q->qi_rtbsoftlimit && !d->d_rtb_softlimit) if (q->qi_rtbsoftlimit && !d->d_rtb_softlimit)
INT_SET(d->d_rtb_softlimit, ARCH_CONVERT, q->qi_rtbsoftlimit); d->d_rtb_softlimit = cpu_to_be64(q->qi_rtbsoftlimit);
if (q->qi_rtbhardlimit && !d->d_rtb_hardlimit) if (q->qi_rtbhardlimit && !d->d_rtb_hardlimit)
INT_SET(d->d_rtb_hardlimit, ARCH_CONVERT, q->qi_rtbhardlimit); d->d_rtb_hardlimit = cpu_to_be64(q->qi_rtbhardlimit);
} }
/* /*
...@@ -282,81 +276,81 @@ xfs_qm_adjust_dqtimers( ...@@ -282,81 +276,81 @@ xfs_qm_adjust_dqtimers(
ASSERT(d->d_id); ASSERT(d->d_id);
#ifdef QUOTADEBUG #ifdef QUOTADEBUG
if (INT_GET(d->d_blk_hardlimit, ARCH_CONVERT)) if (d->d_blk_hardlimit)
ASSERT(INT_GET(d->d_blk_softlimit, ARCH_CONVERT) <= ASSERT(be64_to_cpu(d->d_blk_softlimit) <=
INT_GET(d->d_blk_hardlimit, ARCH_CONVERT)); be64_to_cpu(d->d_blk_hardlimit));
if (INT_GET(d->d_ino_hardlimit, ARCH_CONVERT)) if (d->d_ino_hardlimit)
ASSERT(INT_GET(d->d_ino_softlimit, ARCH_CONVERT) <= ASSERT(be64_to_cpu(d->d_ino_softlimit) <=
INT_GET(d->d_ino_hardlimit, ARCH_CONVERT)); be64_to_cpu(d->d_ino_hardlimit));
if (INT_GET(d->d_rtb_hardlimit, ARCH_CONVERT)) if (d->d_rtb_hardlimit)
ASSERT(INT_GET(d->d_rtb_softlimit, ARCH_CONVERT) <= ASSERT(be64_to_cpu(d->d_rtb_softlimit) <=
INT_GET(d->d_rtb_hardlimit, ARCH_CONVERT)); be64_to_cpu(d->d_rtb_hardlimit));
#endif #endif
if (!d->d_btimer) { if (!d->d_btimer) {
if ((INT_GET(d->d_blk_softlimit, ARCH_CONVERT) && if ((d->d_blk_softlimit &&
(INT_GET(d->d_bcount, ARCH_CONVERT) >= (be64_to_cpu(d->d_bcount) >=
INT_GET(d->d_blk_softlimit, ARCH_CONVERT))) || be64_to_cpu(d->d_blk_softlimit))) ||
(INT_GET(d->d_blk_hardlimit, ARCH_CONVERT) && (d->d_blk_hardlimit &&
(INT_GET(d->d_bcount, ARCH_CONVERT) >= (be64_to_cpu(d->d_bcount) >=
INT_GET(d->d_blk_hardlimit, ARCH_CONVERT)))) { be64_to_cpu(d->d_blk_hardlimit)))) {
INT_SET(d->d_btimer, ARCH_CONVERT, d->d_btimer = cpu_to_be32(get_seconds() +
get_seconds() + XFS_QI_BTIMELIMIT(mp)); XFS_QI_BTIMELIMIT(mp));
} else { } else {
d->d_bwarns = 0; d->d_bwarns = 0;
} }
} else { } else {
if ((!d->d_blk_softlimit || if ((!d->d_blk_softlimit ||
(INT_GET(d->d_bcount, ARCH_CONVERT) < (be64_to_cpu(d->d_bcount) <
INT_GET(d->d_blk_softlimit, ARCH_CONVERT))) && be64_to_cpu(d->d_blk_softlimit))) &&
(!d->d_blk_hardlimit || (!d->d_blk_hardlimit ||
(INT_GET(d->d_bcount, ARCH_CONVERT) < (be64_to_cpu(d->d_bcount) <
INT_GET(d->d_blk_hardlimit, ARCH_CONVERT)))) { be64_to_cpu(d->d_blk_hardlimit)))) {
d->d_btimer = 0; d->d_btimer = 0;
} }
} }
if (!d->d_itimer) { if (!d->d_itimer) {
if ((INT_GET(d->d_ino_softlimit, ARCH_CONVERT) && if ((d->d_ino_softlimit &&
(INT_GET(d->d_icount, ARCH_CONVERT) >= (be64_to_cpu(d->d_icount) >=
INT_GET(d->d_ino_softlimit, ARCH_CONVERT))) || be64_to_cpu(d->d_ino_softlimit))) ||
(INT_GET(d->d_ino_hardlimit, ARCH_CONVERT) && (d->d_ino_hardlimit &&
(INT_GET(d->d_icount, ARCH_CONVERT) >= (be64_to_cpu(d->d_icount) >=
INT_GET(d->d_ino_hardlimit, ARCH_CONVERT)))) { be64_to_cpu(d->d_ino_hardlimit)))) {
INT_SET(d->d_itimer, ARCH_CONVERT, d->d_itimer = cpu_to_be32(get_seconds() +
get_seconds() + XFS_QI_ITIMELIMIT(mp)); XFS_QI_ITIMELIMIT(mp));
} else { } else {
d->d_iwarns = 0; d->d_iwarns = 0;
} }
} else { } else {
if ((!d->d_ino_softlimit || if ((!d->d_ino_softlimit ||
(INT_GET(d->d_icount, ARCH_CONVERT) < (be64_to_cpu(d->d_icount) <
INT_GET(d->d_ino_softlimit, ARCH_CONVERT))) && be64_to_cpu(d->d_ino_softlimit))) &&
(!d->d_ino_hardlimit || (!d->d_ino_hardlimit ||
(INT_GET(d->d_icount, ARCH_CONVERT) < (be64_to_cpu(d->d_icount) <
INT_GET(d->d_ino_hardlimit, ARCH_CONVERT)))) { be64_to_cpu(d->d_ino_hardlimit)))) {
d->d_itimer = 0; d->d_itimer = 0;
} }
} }
if (!d->d_rtbtimer) { if (!d->d_rtbtimer) {
if ((INT_GET(d->d_rtb_softlimit, ARCH_CONVERT) && if ((d->d_rtb_softlimit &&
(INT_GET(d->d_rtbcount, ARCH_CONVERT) >= (be64_to_cpu(d->d_rtbcount) >=
INT_GET(d->d_rtb_softlimit, ARCH_CONVERT))) || be64_to_cpu(d->d_rtb_softlimit))) ||
(INT_GET(d->d_rtb_hardlimit, ARCH_CONVERT) && (d->d_rtb_hardlimit &&
(INT_GET(d->d_rtbcount, ARCH_CONVERT) >= (be64_to_cpu(d->d_rtbcount) >=
INT_GET(d->d_rtb_hardlimit, ARCH_CONVERT)))) { be64_to_cpu(d->d_rtb_hardlimit)))) {
INT_SET(d->d_rtbtimer, ARCH_CONVERT, d->d_rtbtimer = cpu_to_be32(get_seconds() +
get_seconds() + XFS_QI_RTBTIMELIMIT(mp)); XFS_QI_RTBTIMELIMIT(mp));
} else { } else {
d->d_rtbwarns = 0; d->d_rtbwarns = 0;
} }
} else { } else {
if ((!d->d_rtb_softlimit || if ((!d->d_rtb_softlimit ||
(INT_GET(d->d_rtbcount, ARCH_CONVERT) < (be64_to_cpu(d->d_rtbcount) <
INT_GET(d->d_rtb_softlimit, ARCH_CONVERT))) && be64_to_cpu(d->d_rtb_softlimit))) &&
(!d->d_rtb_hardlimit || (!d->d_rtb_hardlimit ||
(INT_GET(d->d_rtbcount, ARCH_CONVERT) < (be64_to_cpu(d->d_rtbcount) <
INT_GET(d->d_rtb_hardlimit, ARCH_CONVERT)))) { be64_to_cpu(d->d_rtb_hardlimit)))) {
d->d_rtbtimer = 0; d->d_rtbtimer = 0;
} }
} }
...@@ -474,7 +468,7 @@ xfs_qm_dqalloc( ...@@ -474,7 +468,7 @@ xfs_qm_dqalloc(
* Make a chunk of dquots out of this buffer and log * Make a chunk of dquots out of this buffer and log
* the entire thing. * the entire thing.
*/ */
xfs_qm_init_dquot_blk(tp, mp, INT_GET(dqp->q_core.d_id, ARCH_CONVERT), xfs_qm_init_dquot_blk(tp, mp, be32_to_cpu(dqp->q_core.d_id),
dqp->dq_flags & XFS_DQ_ALLTYPES, bp); dqp->dq_flags & XFS_DQ_ALLTYPES, bp);
/* /*
...@@ -538,7 +532,7 @@ xfs_qm_dqtobp( ...@@ -538,7 +532,7 @@ xfs_qm_dqtobp(
xfs_trans_t *tp = (tpp ? *tpp : NULL); xfs_trans_t *tp = (tpp ? *tpp : NULL);
mp = dqp->q_mount; mp = dqp->q_mount;
id = INT_GET(dqp->q_core.d_id, ARCH_CONVERT); id = be32_to_cpu(dqp->q_core.d_id);
nmaps = 1; nmaps = 1;
newdquot = B_FALSE; newdquot = B_FALSE;
...@@ -677,16 +671,16 @@ xfs_qm_dqread( ...@@ -677,16 +671,16 @@ xfs_qm_dqread(
/* copy everything from disk dquot to the incore dquot */ /* copy everything from disk dquot to the incore dquot */
memcpy(&dqp->q_core, ddqp, sizeof(xfs_disk_dquot_t)); memcpy(&dqp->q_core, ddqp, sizeof(xfs_disk_dquot_t));
ASSERT(INT_GET(dqp->q_core.d_id, ARCH_CONVERT) == id); ASSERT(be32_to_cpu(dqp->q_core.d_id) == id);
xfs_qm_dquot_logitem_init(dqp); xfs_qm_dquot_logitem_init(dqp);
/* /*
* Reservation counters are defined as reservation plus current usage * Reservation counters are defined as reservation plus current usage
* to avoid having to add everytime. * to avoid having to add everytime.
*/ */
dqp->q_res_bcount = INT_GET(ddqp->d_bcount, ARCH_CONVERT); dqp->q_res_bcount = be64_to_cpu(ddqp->d_bcount);
dqp->q_res_icount = INT_GET(ddqp->d_icount, ARCH_CONVERT); dqp->q_res_icount = be64_to_cpu(ddqp->d_icount);
dqp->q_res_rtbcount = INT_GET(ddqp->d_rtbcount, ARCH_CONVERT); dqp->q_res_rtbcount = be64_to_cpu(ddqp->d_rtbcount);
/* Mark the buf so that this will stay incore a little longer */ /* Mark the buf so that this will stay incore a little longer */
XFS_BUF_SET_VTYPE_REF(bp, B_FS_DQUOT, XFS_DQUOT_REF); XFS_BUF_SET_VTYPE_REF(bp, B_FS_DQUOT, XFS_DQUOT_REF);
...@@ -812,7 +806,7 @@ xfs_qm_dqlookup( ...@@ -812,7 +806,7 @@ xfs_qm_dqlookup(
* dqlock to look at the id field of the dquot, since the * dqlock to look at the id field of the dquot, since the
* id can't be modified without the hashlock anyway. * id can't be modified without the hashlock anyway.
*/ */
if (INT_GET(dqp->q_core.d_id, ARCH_CONVERT) == id && dqp->q_mount == mp) { if (be32_to_cpu(dqp->q_core.d_id) == id && dqp->q_mount == mp) {
xfs_dqtrace_entry(dqp, "DQFOUND BY LOOKUP"); xfs_dqtrace_entry(dqp, "DQFOUND BY LOOKUP");
/* /*
* All in core dquots must be on the dqlist of mp * All in core dquots must be on the dqlist of mp
...@@ -843,7 +837,7 @@ xfs_qm_dqlookup( ...@@ -843,7 +837,7 @@ xfs_qm_dqlookup(
* id couldn't have changed; we had the hashlock all * id couldn't have changed; we had the hashlock all
* along * along
*/ */
ASSERT(INT_GET(dqp->q_core.d_id, ARCH_CONVERT) == id); ASSERT(be32_to_cpu(dqp->q_core.d_id) == id);
if (flist_locked) { if (flist_locked) {
if (dqp->q_nrefs != 0) { if (dqp->q_nrefs != 0) {
...@@ -1265,7 +1259,7 @@ xfs_qm_dqflush( ...@@ -1265,7 +1259,7 @@ xfs_qm_dqflush(
return (error); return (error);
} }
if (xfs_qm_dqcheck(&dqp->q_core, INT_GET(ddqp->d_id, ARCH_CONVERT), if (xfs_qm_dqcheck(&dqp->q_core, be32_to_cpu(ddqp->d_id),
0, XFS_QMOPT_DOWARN, "dqflush (incore copy)")) { 0, XFS_QMOPT_DOWARN, "dqflush (incore copy)")) {
xfs_force_shutdown(dqp->q_mount, XFS_CORRUPT_INCORE); xfs_force_shutdown(dqp->q_mount, XFS_CORRUPT_INCORE);
return XFS_ERROR(EIO); return XFS_ERROR(EIO);
...@@ -1418,8 +1412,8 @@ xfs_dqlock2( ...@@ -1418,8 +1412,8 @@ xfs_dqlock2(
{ {
if (d1 && d2) { if (d1 && d2) {
ASSERT(d1 != d2); ASSERT(d1 != d2);
if (INT_GET(d1->q_core.d_id, ARCH_CONVERT) > if (be32_to_cpu(d1->q_core.d_id) >
INT_GET(d2->q_core.d_id, ARCH_CONVERT)) { be32_to_cpu(d2->q_core.d_id)) {
xfs_dqlock(d2); xfs_dqlock(d2);
xfs_dqlock(d1); xfs_dqlock(d1);
} else { } else {
...@@ -1541,33 +1535,33 @@ xfs_qm_dqprint(xfs_dquot_t *dqp) ...@@ -1541,33 +1535,33 @@ xfs_qm_dqprint(xfs_dquot_t *dqp)
{ {
cmn_err(CE_DEBUG, "-----------KERNEL DQUOT----------------"); cmn_err(CE_DEBUG, "-----------KERNEL DQUOT----------------");
cmn_err(CE_DEBUG, "---- dquotID = %d", cmn_err(CE_DEBUG, "---- dquotID = %d",
(int)INT_GET(dqp->q_core.d_id, ARCH_CONVERT)); (int)be32_to_cpu(dqp->q_core.d_id));
cmn_err(CE_DEBUG, "---- type = %s", DQFLAGTO_TYPESTR(dqp)); cmn_err(CE_DEBUG, "---- type = %s", DQFLAGTO_TYPESTR(dqp));
cmn_err(CE_DEBUG, "---- fs = 0x%p", dqp->q_mount); cmn_err(CE_DEBUG, "---- fs = 0x%p", dqp->q_mount);
cmn_err(CE_DEBUG, "---- blkno = 0x%x", (int) dqp->q_blkno); cmn_err(CE_DEBUG, "---- blkno = 0x%x", (int) dqp->q_blkno);
cmn_err(CE_DEBUG, "---- boffset = 0x%x", (int) dqp->q_bufoffset); cmn_err(CE_DEBUG, "---- boffset = 0x%x", (int) dqp->q_bufoffset);
cmn_err(CE_DEBUG, "---- blkhlimit = %Lu (0x%x)", cmn_err(CE_DEBUG, "---- blkhlimit = %Lu (0x%x)",
INT_GET(dqp->q_core.d_blk_hardlimit, ARCH_CONVERT), be64_to_cpu(dqp->q_core.d_blk_hardlimit),
(int) INT_GET(dqp->q_core.d_blk_hardlimit, ARCH_CONVERT)); (int)be64_to_cpu(dqp->q_core.d_blk_hardlimit));
cmn_err(CE_DEBUG, "---- blkslimit = %Lu (0x%x)", cmn_err(CE_DEBUG, "---- blkslimit = %Lu (0x%x)",
INT_GET(dqp->q_core.d_blk_softlimit, ARCH_CONVERT), be64_to_cpu(dqp->q_core.d_blk_softlimit),
(int)INT_GET(dqp->q_core.d_blk_softlimit, ARCH_CONVERT)); (int)be64_to_cpu(dqp->q_core.d_blk_softlimit));
cmn_err(CE_DEBUG, "---- inohlimit = %Lu (0x%x)", cmn_err(CE_DEBUG, "---- inohlimit = %Lu (0x%x)",
INT_GET(dqp->q_core.d_ino_hardlimit, ARCH_CONVERT), be64_to_cpu(dqp->q_core.d_ino_hardlimit),
(int)INT_GET(dqp->q_core.d_ino_hardlimit, ARCH_CONVERT)); (int)be64_to_cpu(dqp->q_core.d_ino_hardlimit));
cmn_err(CE_DEBUG, "---- inoslimit = %Lu (0x%x)", cmn_err(CE_DEBUG, "---- inoslimit = %Lu (0x%x)",
INT_GET(dqp->q_core.d_ino_softlimit, ARCH_CONVERT), be64_to_cpu(dqp->q_core.d_ino_softlimit),
(int)INT_GET(dqp->q_core.d_ino_softlimit, ARCH_CONVERT)); (int)be64_to_cpu(dqp->q_core.d_ino_softlimit));
cmn_err(CE_DEBUG, "---- bcount = %Lu (0x%x)", cmn_err(CE_DEBUG, "---- bcount = %Lu (0x%x)",
INT_GET(dqp->q_core.d_bcount, ARCH_CONVERT), be64_to_cpu(dqp->q_core.d_bcount),
(int)INT_GET(dqp->q_core.d_bcount, ARCH_CONVERT)); (int)be64_to_cpu(dqp->q_core.d_bcount));
cmn_err(CE_DEBUG, "---- icount = %Lu (0x%x)", cmn_err(CE_DEBUG, "---- icount = %Lu (0x%x)",
INT_GET(dqp->q_core.d_icount, ARCH_CONVERT), be64_to_cpu(dqp->q_core.d_icount),
(int)INT_GET(dqp->q_core.d_icount, ARCH_CONVERT)); (int)be64_to_cpu(dqp->q_core.d_icount));
cmn_err(CE_DEBUG, "---- btimer = %d", cmn_err(CE_DEBUG, "---- btimer = %d",
(int)INT_GET(dqp->q_core.d_btimer, ARCH_CONVERT)); (int)be32_to_cpu(dqp->q_core.d_btimer));
cmn_err(CE_DEBUG, "---- itimer = %d", cmn_err(CE_DEBUG, "---- itimer = %d",
(int)INT_GET(dqp->q_core.d_itimer, ARCH_CONVERT)); (int)be32_to_cpu(dqp->q_core.d_itimer));
cmn_err(CE_DEBUG, "---------------------------"); cmn_err(CE_DEBUG, "---------------------------");
} }
#endif #endif
......
...@@ -450,7 +450,7 @@ xfs_qm_dquot_logitem_init( ...@@ -450,7 +450,7 @@ xfs_qm_dquot_logitem_init(
lp->qli_item.li_mountp = dqp->q_mount; lp->qli_item.li_mountp = dqp->q_mount;
lp->qli_dquot = dqp; lp->qli_dquot = dqp;
lp->qli_format.qlf_type = XFS_LI_DQUOT; lp->qli_format.qlf_type = XFS_LI_DQUOT;
lp->qli_format.qlf_id = INT_GET(dqp->q_core.d_id, ARCH_CONVERT); lp->qli_format.qlf_id = be32_to_cpu(dqp->q_core.d_id);
lp->qli_format.qlf_blkno = dqp->q_blkno; lp->qli_format.qlf_blkno = dqp->q_blkno;
lp->qli_format.qlf_len = 1; lp->qli_format.qlf_len = 1;
/* /*
......
...@@ -91,10 +91,10 @@ extern mutex_t qcheck_lock; ...@@ -91,10 +91,10 @@ extern mutex_t qcheck_lock;
for (dqp = (l)->qh_next; dqp != NULL; dqp = dqp->NXT) { \ for (dqp = (l)->qh_next; dqp != NULL; dqp = dqp->NXT) { \
cmn_err(CE_DEBUG, " %d. \"%d (%s)\" " \ cmn_err(CE_DEBUG, " %d. \"%d (%s)\" " \
"bcnt = %d, icnt = %d, refs = %d", \ "bcnt = %d, icnt = %d, refs = %d", \
++i, (int) INT_GET(dqp->q_core.d_id, ARCH_CONVERT), \ ++i, (int) be32_to_cpu(dqp->q_core.d_id), \
DQFLAGTO_TYPESTR(dqp), \ DQFLAGTO_TYPESTR(dqp), \
(int) INT_GET(dqp->q_core.d_bcount, ARCH_CONVERT), \ (int) be64_to_cpu(dqp->q_core.d_bcount), \
(int) INT_GET(dqp->q_core.d_icount, ARCH_CONVERT), \ (int) be64_to_cpu(dqp->q_core.d_icount), \
(int) dqp->q_nrefs); } \ (int) dqp->q_nrefs); } \
} }
#else #else
...@@ -727,7 +727,7 @@ xfs_qm_dqattach_one( ...@@ -727,7 +727,7 @@ xfs_qm_dqattach_one(
*/ */
if (udqhint && if (udqhint &&
(dqp = udqhint->q_gdquot) && (dqp = udqhint->q_gdquot) &&
(INT_GET(dqp->q_core.d_id, ARCH_CONVERT) == id)) { (be32_to_cpu(dqp->q_core.d_id) == id)) {
ASSERT(XFS_DQ_IS_LOCKED(udqhint)); ASSERT(XFS_DQ_IS_LOCKED(udqhint));
xfs_dqlock(dqp); xfs_dqlock(dqp);
XFS_DQHOLD(dqp); XFS_DQHOLD(dqp);
...@@ -1197,42 +1197,24 @@ xfs_qm_init_quotainfo( ...@@ -1197,42 +1197,24 @@ xfs_qm_init_quotainfo(
* a user or group before he or she can not perform any * a user or group before he or she can not perform any
* more writing. If it is zero, a default is used. * more writing. If it is zero, a default is used.
*/ */
qinf->qi_btimelimit = qinf->qi_btimelimit = ddqp->d_btimer ?
INT_GET(ddqp->d_btimer, ARCH_CONVERT) ? be32_to_cpu(ddqp->d_btimer) : XFS_QM_BTIMELIMIT;
INT_GET(ddqp->d_btimer, ARCH_CONVERT) : qinf->qi_itimelimit = ddqp->d_itimer ?
XFS_QM_BTIMELIMIT; be32_to_cpu(ddqp->d_itimer) : XFS_QM_ITIMELIMIT;
qinf->qi_itimelimit = qinf->qi_rtbtimelimit = ddqp->d_rtbtimer ?
INT_GET(ddqp->d_itimer, ARCH_CONVERT) ? be32_to_cpu(ddqp->d_rtbtimer) : XFS_QM_RTBTIMELIMIT;
INT_GET(ddqp->d_itimer, ARCH_CONVERT) : qinf->qi_bwarnlimit = ddqp->d_bwarns ?
XFS_QM_ITIMELIMIT; be16_to_cpu(ddqp->d_bwarns) : XFS_QM_BWARNLIMIT;
qinf->qi_rtbtimelimit = qinf->qi_iwarnlimit = ddqp->d_iwarns ?
INT_GET(ddqp->d_rtbtimer, ARCH_CONVERT) ? be16_to_cpu(ddqp->d_iwarns) : XFS_QM_IWARNLIMIT;
INT_GET(ddqp->d_rtbtimer, ARCH_CONVERT) : qinf->qi_rtbwarnlimit = ddqp->d_rtbwarns ?
XFS_QM_RTBTIMELIMIT; be16_to_cpu(ddqp->d_rtbwarns) : XFS_QM_RTBWARNLIMIT;
qinf->qi_bwarnlimit = qinf->qi_bhardlimit = be64_to_cpu(ddqp->d_blk_hardlimit);
INT_GET(ddqp->d_bwarns, ARCH_CONVERT) ? qinf->qi_bsoftlimit = be64_to_cpu(ddqp->d_blk_softlimit);
INT_GET(ddqp->d_bwarns, ARCH_CONVERT) : qinf->qi_ihardlimit = be64_to_cpu(ddqp->d_ino_hardlimit);
XFS_QM_BWARNLIMIT; qinf->qi_isoftlimit = be64_to_cpu(ddqp->d_ino_softlimit);
qinf->qi_iwarnlimit = qinf->qi_rtbhardlimit = be64_to_cpu(ddqp->d_rtb_hardlimit);
INT_GET(ddqp->d_iwarns, ARCH_CONVERT) ? qinf->qi_rtbsoftlimit = be64_to_cpu(ddqp->d_rtb_softlimit);
INT_GET(ddqp->d_iwarns, ARCH_CONVERT) :
XFS_QM_IWARNLIMIT;
qinf->qi_rtbwarnlimit =
INT_GET(ddqp->d_rtbwarns, ARCH_CONVERT) ?
INT_GET(ddqp->d_rtbwarns, ARCH_CONVERT) :
XFS_QM_RTBWARNLIMIT;
qinf->qi_bhardlimit =
INT_GET(ddqp->d_blk_hardlimit, ARCH_CONVERT);
qinf->qi_bsoftlimit =
INT_GET(ddqp->d_blk_softlimit, ARCH_CONVERT);
qinf->qi_ihardlimit =
INT_GET(ddqp->d_ino_hardlimit, ARCH_CONVERT);
qinf->qi_isoftlimit =
INT_GET(ddqp->d_ino_softlimit, ARCH_CONVERT);
qinf->qi_rtbhardlimit =
INT_GET(ddqp->d_rtb_hardlimit, ARCH_CONVERT);
qinf->qi_rtbsoftlimit =
INT_GET(ddqp->d_rtb_softlimit, ARCH_CONVERT);
/* /*
* We sent the XFS_QMOPT_DQSUSER flag to dqget because * We sent the XFS_QMOPT_DQSUSER flag to dqget because
...@@ -1511,15 +1493,15 @@ xfs_qm_reset_dqcounts( ...@@ -1511,15 +1493,15 @@ xfs_qm_reset_dqcounts(
*/ */
(void) xfs_qm_dqcheck(ddq, id+j, type, XFS_QMOPT_DQREPAIR, (void) xfs_qm_dqcheck(ddq, id+j, type, XFS_QMOPT_DQREPAIR,
"xfs_quotacheck"); "xfs_quotacheck");
INT_SET(ddq->d_bcount, ARCH_CONVERT, 0ULL); ddq->d_bcount = 0;
INT_SET(ddq->d_icount, ARCH_CONVERT, 0ULL); ddq->d_icount = 0;
INT_SET(ddq->d_rtbcount, ARCH_CONVERT, 0ULL); ddq->d_rtbcount = 0;
INT_SET(ddq->d_btimer, ARCH_CONVERT, (time_t)0); ddq->d_btimer = 0;
INT_SET(ddq->d_itimer, ARCH_CONVERT, (time_t)0); ddq->d_itimer = 0;
INT_SET(ddq->d_rtbtimer, ARCH_CONVERT, (time_t)0); ddq->d_rtbtimer = 0;
INT_SET(ddq->d_bwarns, ARCH_CONVERT, 0UL); ddq->d_bwarns = 0;
INT_SET(ddq->d_iwarns, ARCH_CONVERT, 0UL); ddq->d_iwarns = 0;
INT_SET(ddq->d_rtbwarns, ARCH_CONVERT, 0UL); ddq->d_rtbwarns = 0;
ddq = (xfs_disk_dquot_t *) ((xfs_dqblk_t *)ddq + 1); ddq = (xfs_disk_dquot_t *) ((xfs_dqblk_t *)ddq + 1);
} }
...@@ -1692,14 +1674,14 @@ xfs_qm_quotacheck_dqadjust( ...@@ -1692,14 +1674,14 @@ xfs_qm_quotacheck_dqadjust(
* Adjust the inode count and the block count to reflect this inode's * Adjust the inode count and the block count to reflect this inode's
* resource usage. * resource usage.
*/ */
INT_MOD(dqp->q_core.d_icount, ARCH_CONVERT, +1); be64_add(&dqp->q_core.d_icount, 1);
dqp->q_res_icount++; dqp->q_res_icount++;
if (nblks) { if (nblks) {
INT_MOD(dqp->q_core.d_bcount, ARCH_CONVERT, nblks); be64_add(&dqp->q_core.d_bcount, nblks);
dqp->q_res_bcount += nblks; dqp->q_res_bcount += nblks;
} }
if (rtblks) { if (rtblks) {
INT_MOD(dqp->q_core.d_rtbcount, ARCH_CONVERT, rtblks); be64_add(&dqp->q_core.d_rtbcount, rtblks);
dqp->q_res_rtbcount += rtblks; dqp->q_res_rtbcount += rtblks;
} }
...@@ -2186,7 +2168,7 @@ xfs_qm_shake_freelist( ...@@ -2186,7 +2168,7 @@ xfs_qm_shake_freelist(
xfs_dqtrace_entry(dqp, "DQSHAKE: UNLINKING"); xfs_dqtrace_entry(dqp, "DQSHAKE: UNLINKING");
#ifdef QUOTADEBUG #ifdef QUOTADEBUG
cmn_err(CE_DEBUG, "Shake 0x%p, ID 0x%x\n", cmn_err(CE_DEBUG, "Shake 0x%p, ID 0x%x\n",
dqp, INT_GET(dqp->q_core.d_id, ARCH_CONVERT)); dqp, be32_to_cpu(dqp->q_core.d_id));
#endif #endif
ASSERT(dqp->q_nrefs == 0); ASSERT(dqp->q_nrefs == 0);
nextdqp = dqp->dq_flnext; nextdqp = dqp->dq_flnext;
...@@ -2654,7 +2636,7 @@ xfs_qm_vop_chown_reserve( ...@@ -2654,7 +2636,7 @@ xfs_qm_vop_chown_reserve(
XFS_QMOPT_RES_RTBLKS : XFS_QMOPT_RES_REGBLKS; XFS_QMOPT_RES_RTBLKS : XFS_QMOPT_RES_REGBLKS;
if (XFS_IS_UQUOTA_ON(mp) && udqp && if (XFS_IS_UQUOTA_ON(mp) && udqp &&
ip->i_d.di_uid != (uid_t)INT_GET(udqp->q_core.d_id, ARCH_CONVERT)) { ip->i_d.di_uid != (uid_t)be32_to_cpu(udqp->q_core.d_id)) {
delblksudq = udqp; delblksudq = udqp;
/* /*
* If there are delayed allocation blocks, then we have to * If there are delayed allocation blocks, then we have to
...@@ -2667,10 +2649,10 @@ xfs_qm_vop_chown_reserve( ...@@ -2667,10 +2649,10 @@ xfs_qm_vop_chown_reserve(
} }
} }
if (XFS_IS_OQUOTA_ON(ip->i_mount) && gdqp) { if (XFS_IS_OQUOTA_ON(ip->i_mount) && gdqp) {
if ((XFS_IS_GQUOTA_ON(ip->i_mount) && ip->i_d.di_gid != if ((XFS_IS_GQUOTA_ON(ip->i_mount) &&
INT_GET(gdqp->q_core.d_id, ARCH_CONVERT)) || ip->i_d.di_gid != be32_to_cpu(gdqp->q_core.d_id)) ||
(XFS_IS_PQUOTA_ON(ip->i_mount) && ip->i_d.di_projid != (XFS_IS_PQUOTA_ON(ip->i_mount) &&
INT_GET(gdqp->q_core.d_id, ARCH_CONVERT))) { ip->i_d.di_projid != be32_to_cpu(gdqp->q_core.d_id))) {
delblksgdq = gdqp; delblksgdq = gdqp;
if (delblks) { if (delblks) {
ASSERT(ip->i_gdquot); ASSERT(ip->i_gdquot);
...@@ -2760,7 +2742,7 @@ xfs_qm_vop_dqattach_and_dqmod_newinode( ...@@ -2760,7 +2742,7 @@ xfs_qm_vop_dqattach_and_dqmod_newinode(
xfs_dqunlock(udqp); xfs_dqunlock(udqp);
ASSERT(ip->i_udquot == NULL); ASSERT(ip->i_udquot == NULL);
ip->i_udquot = udqp; ip->i_udquot = udqp;
ASSERT(ip->i_d.di_uid == INT_GET(udqp->q_core.d_id, ARCH_CONVERT)); ASSERT(ip->i_d.di_uid == be32_to_cpu(udqp->q_core.d_id));
xfs_trans_mod_dquot(tp, udqp, XFS_TRANS_DQ_ICOUNT, 1); xfs_trans_mod_dquot(tp, udqp, XFS_TRANS_DQ_ICOUNT, 1);
} }
if (gdqp) { if (gdqp) {
...@@ -2769,7 +2751,7 @@ xfs_qm_vop_dqattach_and_dqmod_newinode( ...@@ -2769,7 +2751,7 @@ xfs_qm_vop_dqattach_and_dqmod_newinode(
xfs_dqunlock(gdqp); xfs_dqunlock(gdqp);
ASSERT(ip->i_gdquot == NULL); ASSERT(ip->i_gdquot == NULL);
ip->i_gdquot = gdqp; ip->i_gdquot = gdqp;
ASSERT(ip->i_d.di_gid == INT_GET(gdqp->q_core.d_id, ARCH_CONVERT)); ASSERT(ip->i_d.di_gid == be32_to_cpu(gdqp->q_core.d_id));
xfs_trans_mod_dquot(tp, gdqp, XFS_TRANS_DQ_ICOUNT, 1); xfs_trans_mod_dquot(tp, gdqp, XFS_TRANS_DQ_ICOUNT, 1);
} }
} }
......
...@@ -638,13 +638,13 @@ xfs_qm_scall_setqlim( ...@@ -638,13 +638,13 @@ xfs_qm_scall_setqlim(
*/ */
hard = (newlim->d_fieldmask & FS_DQ_BHARD) ? hard = (newlim->d_fieldmask & FS_DQ_BHARD) ?
(xfs_qcnt_t) XFS_BB_TO_FSB(mp, newlim->d_blk_hardlimit) : (xfs_qcnt_t) XFS_BB_TO_FSB(mp, newlim->d_blk_hardlimit) :
INT_GET(ddq->d_blk_hardlimit, ARCH_CONVERT); be64_to_cpu(ddq->d_blk_hardlimit);
soft = (newlim->d_fieldmask & FS_DQ_BSOFT) ? soft = (newlim->d_fieldmask & FS_DQ_BSOFT) ?
(xfs_qcnt_t) XFS_BB_TO_FSB(mp, newlim->d_blk_softlimit) : (xfs_qcnt_t) XFS_BB_TO_FSB(mp, newlim->d_blk_softlimit) :
INT_GET(ddq->d_blk_softlimit, ARCH_CONVERT); be64_to_cpu(ddq->d_blk_softlimit);
if (hard == 0 || hard >= soft) { if (hard == 0 || hard >= soft) {
INT_SET(ddq->d_blk_hardlimit, ARCH_CONVERT, hard); ddq->d_blk_hardlimit = cpu_to_be64(hard);
INT_SET(ddq->d_blk_softlimit, ARCH_CONVERT, soft); ddq->d_blk_softlimit = cpu_to_be64(soft);
if (id == 0) { if (id == 0) {
mp->m_quotainfo->qi_bhardlimit = hard; mp->m_quotainfo->qi_bhardlimit = hard;
mp->m_quotainfo->qi_bsoftlimit = soft; mp->m_quotainfo->qi_bsoftlimit = soft;
...@@ -654,13 +654,13 @@ xfs_qm_scall_setqlim( ...@@ -654,13 +654,13 @@ xfs_qm_scall_setqlim(
} }
hard = (newlim->d_fieldmask & FS_DQ_RTBHARD) ? hard = (newlim->d_fieldmask & FS_DQ_RTBHARD) ?
(xfs_qcnt_t) XFS_BB_TO_FSB(mp, newlim->d_rtb_hardlimit) : (xfs_qcnt_t) XFS_BB_TO_FSB(mp, newlim->d_rtb_hardlimit) :
INT_GET(ddq->d_rtb_hardlimit, ARCH_CONVERT); be64_to_cpu(ddq->d_rtb_hardlimit);
soft = (newlim->d_fieldmask & FS_DQ_RTBSOFT) ? soft = (newlim->d_fieldmask & FS_DQ_RTBSOFT) ?
(xfs_qcnt_t) XFS_BB_TO_FSB(mp, newlim->d_rtb_softlimit) : (xfs_qcnt_t) XFS_BB_TO_FSB(mp, newlim->d_rtb_softlimit) :
INT_GET(ddq->d_rtb_softlimit, ARCH_CONVERT); be64_to_cpu(ddq->d_rtb_softlimit);
if (hard == 0 || hard >= soft) { if (hard == 0 || hard >= soft) {
INT_SET(ddq->d_rtb_hardlimit, ARCH_CONVERT, hard); ddq->d_rtb_hardlimit = cpu_to_be64(hard);
INT_SET(ddq->d_rtb_softlimit, ARCH_CONVERT, soft); ddq->d_rtb_softlimit = cpu_to_be64(soft);
if (id == 0) { if (id == 0) {
mp->m_quotainfo->qi_rtbhardlimit = hard; mp->m_quotainfo->qi_rtbhardlimit = hard;
mp->m_quotainfo->qi_rtbsoftlimit = soft; mp->m_quotainfo->qi_rtbsoftlimit = soft;
...@@ -671,13 +671,13 @@ xfs_qm_scall_setqlim( ...@@ -671,13 +671,13 @@ xfs_qm_scall_setqlim(
hard = (newlim->d_fieldmask & FS_DQ_IHARD) ? hard = (newlim->d_fieldmask & FS_DQ_IHARD) ?
(xfs_qcnt_t) newlim->d_ino_hardlimit : (xfs_qcnt_t) newlim->d_ino_hardlimit :
INT_GET(ddq->d_ino_hardlimit, ARCH_CONVERT); be64_to_cpu(ddq->d_ino_hardlimit);
soft = (newlim->d_fieldmask & FS_DQ_ISOFT) ? soft = (newlim->d_fieldmask & FS_DQ_ISOFT) ?
(xfs_qcnt_t) newlim->d_ino_softlimit : (xfs_qcnt_t) newlim->d_ino_softlimit :
INT_GET(ddq->d_ino_softlimit, ARCH_CONVERT); be64_to_cpu(ddq->d_ino_softlimit);
if (hard == 0 || hard >= soft) { if (hard == 0 || hard >= soft) {
INT_SET(ddq->d_ino_hardlimit, ARCH_CONVERT, hard); ddq->d_ino_hardlimit = cpu_to_be64(hard);
INT_SET(ddq->d_ino_softlimit, ARCH_CONVERT, soft); ddq->d_ino_softlimit = cpu_to_be64(soft);
if (id == 0) { if (id == 0) {
mp->m_quotainfo->qi_ihardlimit = hard; mp->m_quotainfo->qi_ihardlimit = hard;
mp->m_quotainfo->qi_isoftlimit = soft; mp->m_quotainfo->qi_isoftlimit = soft;
...@@ -690,11 +690,11 @@ xfs_qm_scall_setqlim( ...@@ -690,11 +690,11 @@ xfs_qm_scall_setqlim(
* Update warnings counter(s) if requested * Update warnings counter(s) if requested
*/ */
if (newlim->d_fieldmask & FS_DQ_BWARNS) if (newlim->d_fieldmask & FS_DQ_BWARNS)
INT_SET(ddq->d_bwarns, ARCH_CONVERT, newlim->d_bwarns); ddq->d_bwarns = cpu_to_be16(newlim->d_bwarns);
if (newlim->d_fieldmask & FS_DQ_IWARNS) if (newlim->d_fieldmask & FS_DQ_IWARNS)
INT_SET(ddq->d_iwarns, ARCH_CONVERT, newlim->d_iwarns); ddq->d_iwarns = cpu_to_be16(newlim->d_iwarns);
if (newlim->d_fieldmask & FS_DQ_RTBWARNS) if (newlim->d_fieldmask & FS_DQ_RTBWARNS)
INT_SET(ddq->d_rtbwarns, ARCH_CONVERT, newlim->d_rtbwarns); ddq->d_rtbwarns = cpu_to_be16(newlim->d_rtbwarns);
if (id == 0) { if (id == 0) {
/* /*
...@@ -706,15 +706,15 @@ xfs_qm_scall_setqlim( ...@@ -706,15 +706,15 @@ xfs_qm_scall_setqlim(
*/ */
if (newlim->d_fieldmask & FS_DQ_BTIMER) { if (newlim->d_fieldmask & FS_DQ_BTIMER) {
mp->m_quotainfo->qi_btimelimit = newlim->d_btimer; mp->m_quotainfo->qi_btimelimit = newlim->d_btimer;
INT_SET(ddq->d_btimer, ARCH_CONVERT, newlim->d_btimer); ddq->d_btimer = cpu_to_be32(newlim->d_btimer);
} }
if (newlim->d_fieldmask & FS_DQ_ITIMER) { if (newlim->d_fieldmask & FS_DQ_ITIMER) {
mp->m_quotainfo->qi_itimelimit = newlim->d_itimer; mp->m_quotainfo->qi_itimelimit = newlim->d_itimer;
INT_SET(ddq->d_itimer, ARCH_CONVERT, newlim->d_itimer); ddq->d_itimer = cpu_to_be32(newlim->d_itimer);
} }
if (newlim->d_fieldmask & FS_DQ_RTBTIMER) { if (newlim->d_fieldmask & FS_DQ_RTBTIMER) {
mp->m_quotainfo->qi_rtbtimelimit = newlim->d_rtbtimer; mp->m_quotainfo->qi_rtbtimelimit = newlim->d_rtbtimer;
INT_SET(ddq->d_rtbtimer, ARCH_CONVERT, newlim->d_rtbtimer); ddq->d_rtbtimer = cpu_to_be32(newlim->d_rtbtimer);
} }
if (newlim->d_fieldmask & FS_DQ_BWARNS) if (newlim->d_fieldmask & FS_DQ_BWARNS)
mp->m_quotainfo->qi_bwarnlimit = newlim->d_bwarns; mp->m_quotainfo->qi_bwarnlimit = newlim->d_bwarns;
...@@ -885,33 +885,27 @@ xfs_qm_export_dquot( ...@@ -885,33 +885,27 @@ xfs_qm_export_dquot(
{ {
memset(dst, 0, sizeof(*dst)); memset(dst, 0, sizeof(*dst));
dst->d_version = FS_DQUOT_VERSION; /* different from src->d_version */ dst->d_version = FS_DQUOT_VERSION; /* different from src->d_version */
dst->d_flags = dst->d_flags = xfs_qm_export_qtype_flags(src->d_flags);
xfs_qm_export_qtype_flags(INT_GET(src->d_flags, ARCH_CONVERT)); dst->d_id = be32_to_cpu(src->d_id);
dst->d_id = INT_GET(src->d_id, ARCH_CONVERT); dst->d_blk_hardlimit =
dst->d_blk_hardlimit = (__uint64_t) XFS_FSB_TO_BB(mp, be64_to_cpu(src->d_blk_hardlimit));
XFS_FSB_TO_BB(mp, INT_GET(src->d_blk_hardlimit, ARCH_CONVERT)); dst->d_blk_softlimit =
dst->d_blk_softlimit = (__uint64_t) XFS_FSB_TO_BB(mp, be64_to_cpu(src->d_blk_softlimit));
XFS_FSB_TO_BB(mp, INT_GET(src->d_blk_softlimit, ARCH_CONVERT)); dst->d_ino_hardlimit = be64_to_cpu(src->d_ino_hardlimit);
dst->d_ino_hardlimit = (__uint64_t) dst->d_ino_softlimit = be64_to_cpu(src->d_ino_softlimit);
INT_GET(src->d_ino_hardlimit, ARCH_CONVERT); dst->d_bcount = XFS_FSB_TO_BB(mp, be64_to_cpu(src->d_bcount));
dst->d_ino_softlimit = (__uint64_t) dst->d_icount = be64_to_cpu(src->d_icount);
INT_GET(src->d_ino_softlimit, ARCH_CONVERT); dst->d_btimer = be32_to_cpu(src->d_btimer);
dst->d_bcount = (__uint64_t) dst->d_itimer = be32_to_cpu(src->d_itimer);
XFS_FSB_TO_BB(mp, INT_GET(src->d_bcount, ARCH_CONVERT)); dst->d_iwarns = be16_to_cpu(src->d_iwarns);
dst->d_icount = (__uint64_t) INT_GET(src->d_icount, ARCH_CONVERT); dst->d_bwarns = be16_to_cpu(src->d_bwarns);
dst->d_btimer = (__uint32_t) INT_GET(src->d_btimer, ARCH_CONVERT); dst->d_rtb_hardlimit =
dst->d_itimer = (__uint32_t) INT_GET(src->d_itimer, ARCH_CONVERT); XFS_FSB_TO_BB(mp, be64_to_cpu(src->d_rtb_hardlimit));
dst->d_iwarns = INT_GET(src->d_iwarns, ARCH_CONVERT); dst->d_rtb_softlimit =
dst->d_bwarns = INT_GET(src->d_bwarns, ARCH_CONVERT); XFS_FSB_TO_BB(mp, be64_to_cpu(src->d_rtb_softlimit));
dst->d_rtbcount = XFS_FSB_TO_BB(mp, be64_to_cpu(src->d_rtbcount));
dst->d_rtb_hardlimit = (__uint64_t) dst->d_rtbtimer = be32_to_cpu(src->d_rtbtimer);
XFS_FSB_TO_BB(mp, INT_GET(src->d_rtb_hardlimit, ARCH_CONVERT)); dst->d_rtbwarns = be16_to_cpu(src->d_rtbwarns);
dst->d_rtb_softlimit = (__uint64_t)
XFS_FSB_TO_BB(mp, INT_GET(src->d_rtb_softlimit, ARCH_CONVERT));
dst->d_rtbcount = (__uint64_t)
XFS_FSB_TO_BB(mp, INT_GET(src->d_rtbcount, ARCH_CONVERT));
dst->d_rtbtimer = (__uint32_t) INT_GET(src->d_rtbtimer, ARCH_CONVERT);
dst->d_rtbwarns = INT_GET(src->d_rtbwarns, ARCH_CONVERT);
/* /*
* Internally, we don't reset all the timers when quota enforcement * Internally, we don't reset all the timers when quota enforcement
...@@ -1205,10 +1199,10 @@ xfs_qm_dqtest_failed( ...@@ -1205,10 +1199,10 @@ xfs_qm_dqtest_failed(
qmtest_nfails++; qmtest_nfails++;
if (error) if (error)
cmn_err(CE_DEBUG, "quotacheck failed id=%d, err=%d\nreason: %s", cmn_err(CE_DEBUG, "quotacheck failed id=%d, err=%d\nreason: %s",
INT_GET(d->d_id, ARCH_CONVERT), error, reason); d->d_id, error, reason);
else else
cmn_err(CE_DEBUG, "quotacheck failed id=%d (%s) [%d != %d]", cmn_err(CE_DEBUG, "quotacheck failed id=%d (%s) [%d != %d]",
INT_GET(d->d_id, ARCH_CONVERT), reason, (int)a, (int)b); d->d_id, reason, (int)a, (int)b);
xfs_qm_dqtest_print(d); xfs_qm_dqtest_print(d);
if (dqp) if (dqp)
xfs_qm_dqprint(dqp); xfs_qm_dqprint(dqp);
...@@ -1220,21 +1214,21 @@ xfs_dqtest_cmp2( ...@@ -1220,21 +1214,21 @@ xfs_dqtest_cmp2(
xfs_dquot_t *dqp) xfs_dquot_t *dqp)
{ {
int err = 0; int err = 0;
if (INT_GET(dqp->q_core.d_icount, ARCH_CONVERT) != d->d_icount) { if (be64_to_cpu(dqp->q_core.d_icount) != d->d_icount) {
xfs_qm_dqtest_failed(d, dqp, "icount mismatch", xfs_qm_dqtest_failed(d, dqp, "icount mismatch",
INT_GET(dqp->q_core.d_icount, ARCH_CONVERT), be64_to_cpu(dqp->q_core.d_icount),
d->d_icount, 0); d->d_icount, 0);
err++; err++;
} }
if (INT_GET(dqp->q_core.d_bcount, ARCH_CONVERT) != d->d_bcount) { if (be64_to_cpu(dqp->q_core.d_bcount) != d->d_bcount) {
xfs_qm_dqtest_failed(d, dqp, "bcount mismatch", xfs_qm_dqtest_failed(d, dqp, "bcount mismatch",
INT_GET(dqp->q_core.d_bcount, ARCH_CONVERT), be64_to_cpu(dqp->q_core.d_bcount),
d->d_bcount, 0); d->d_bcount, 0);
err++; err++;
} }
if (INT_GET(dqp->q_core.d_blk_softlimit, ARCH_CONVERT) && if (dqp->q_core.d_blk_softlimit &&
INT_GET(dqp->q_core.d_bcount, ARCH_CONVERT) >= be64_to_cpu(dqp->q_core.d_bcount) >=
INT_GET(dqp->q_core.d_blk_softlimit, ARCH_CONVERT)) { be64_to_cpu(dqp->q_core.d_blk_softlimit)) {
if (!dqp->q_core.d_btimer && dqp->q_core.d_id) { if (!dqp->q_core.d_btimer && dqp->q_core.d_id) {
cmn_err(CE_DEBUG, cmn_err(CE_DEBUG,
"%d [%s] [0x%p] BLK TIMER NOT STARTED", "%d [%s] [0x%p] BLK TIMER NOT STARTED",
...@@ -1242,9 +1236,9 @@ xfs_dqtest_cmp2( ...@@ -1242,9 +1236,9 @@ xfs_dqtest_cmp2(
err++; err++;
} }
} }
if (INT_GET(dqp->q_core.d_ino_softlimit, ARCH_CONVERT) && if (dqp->q_core.d_ino_softlimit &&
INT_GET(dqp->q_core.d_icount, ARCH_CONVERT) >= be64_to_cpu(dqp->q_core.d_icount) >=
INT_GET(dqp->q_core.d_ino_softlimit, ARCH_CONVERT)) { be64_to_cpu(dqp->q_core.d_ino_softlimit)) {
if (!dqp->q_core.d_itimer && dqp->q_core.d_id) { if (!dqp->q_core.d_itimer && dqp->q_core.d_id) {
cmn_err(CE_DEBUG, cmn_err(CE_DEBUG,
"%d [%s] [0x%p] INO TIMER NOT STARTED", "%d [%s] [0x%p] INO TIMER NOT STARTED",
......
...@@ -413,25 +413,25 @@ xfs_trans_apply_dquot_deltas( ...@@ -413,25 +413,25 @@ xfs_trans_apply_dquot_deltas(
qtrx->qt_delrtb_delta; qtrx->qt_delrtb_delta;
#ifdef QUOTADEBUG #ifdef QUOTADEBUG
if (totalbdelta < 0) if (totalbdelta < 0)
ASSERT(INT_GET(d->d_bcount, ARCH_CONVERT) >= ASSERT(be64_to_cpu(d->d_bcount) >=
(xfs_qcnt_t) -totalbdelta); (xfs_qcnt_t) -totalbdelta);
if (totalrtbdelta < 0) if (totalrtbdelta < 0)
ASSERT(INT_GET(d->d_rtbcount, ARCH_CONVERT) >= ASSERT(be64_to_cpu(d->d_rtbcount) >=
(xfs_qcnt_t) -totalrtbdelta); (xfs_qcnt_t) -totalrtbdelta);
if (qtrx->qt_icount_delta < 0) if (qtrx->qt_icount_delta < 0)
ASSERT(INT_GET(d->d_icount, ARCH_CONVERT) >= ASSERT(be64_to_cpu(d->d_icount) >=
(xfs_qcnt_t) -qtrx->qt_icount_delta); (xfs_qcnt_t) -qtrx->qt_icount_delta);
#endif #endif
if (totalbdelta) if (totalbdelta)
INT_MOD(d->d_bcount, ARCH_CONVERT, (xfs_qcnt_t)totalbdelta); be64_add(&d->d_bcount, (xfs_qcnt_t)totalbdelta);
if (qtrx->qt_icount_delta) if (qtrx->qt_icount_delta)
INT_MOD(d->d_icount, ARCH_CONVERT, (xfs_qcnt_t)qtrx->qt_icount_delta); be64_add(&d->d_icount, (xfs_qcnt_t)qtrx->qt_icount_delta);
if (totalrtbdelta) if (totalrtbdelta)
INT_MOD(d->d_rtbcount, ARCH_CONVERT, (xfs_qcnt_t)totalrtbdelta); be64_add(&d->d_rtbcount, (xfs_qcnt_t)totalrtbdelta);
/* /*
* Get any default limits in use. * Get any default limits in use.
...@@ -515,11 +515,11 @@ xfs_trans_apply_dquot_deltas( ...@@ -515,11 +515,11 @@ xfs_trans_apply_dquot_deltas(
} }
ASSERT(dqp->q_res_bcount >= ASSERT(dqp->q_res_bcount >=
INT_GET(dqp->q_core.d_bcount, ARCH_CONVERT)); be64_to_cpu(dqp->q_core.d_bcount));
ASSERT(dqp->q_res_icount >= ASSERT(dqp->q_res_icount >=
INT_GET(dqp->q_core.d_icount, ARCH_CONVERT)); be64_to_cpu(dqp->q_core.d_icount));
ASSERT(dqp->q_res_rtbcount >= ASSERT(dqp->q_res_rtbcount >=
INT_GET(dqp->q_core.d_rtbcount, ARCH_CONVERT)); be64_to_cpu(dqp->q_core.d_rtbcount));
} }
/* /*
* Do the group quotas next * Do the group quotas next
...@@ -626,26 +626,26 @@ xfs_trans_dqresv( ...@@ -626,26 +626,26 @@ xfs_trans_dqresv(
} }
ASSERT(XFS_DQ_IS_LOCKED(dqp)); ASSERT(XFS_DQ_IS_LOCKED(dqp));
if (flags & XFS_TRANS_DQ_RES_BLKS) { if (flags & XFS_TRANS_DQ_RES_BLKS) {
hardlimit = INT_GET(dqp->q_core.d_blk_hardlimit, ARCH_CONVERT); hardlimit = be64_to_cpu(dqp->q_core.d_blk_hardlimit);
if (!hardlimit) if (!hardlimit)
hardlimit = q->qi_bhardlimit; hardlimit = q->qi_bhardlimit;
softlimit = INT_GET(dqp->q_core.d_blk_softlimit, ARCH_CONVERT); softlimit = be64_to_cpu(dqp->q_core.d_blk_softlimit);
if (!softlimit) if (!softlimit)
softlimit = q->qi_bsoftlimit; softlimit = q->qi_bsoftlimit;
timer = INT_GET(dqp->q_core.d_btimer, ARCH_CONVERT); timer = be32_to_cpu(dqp->q_core.d_btimer);
warns = INT_GET(dqp->q_core.d_bwarns, ARCH_CONVERT); warns = be16_to_cpu(dqp->q_core.d_bwarns);
warnlimit = XFS_QI_BWARNLIMIT(dqp->q_mount); warnlimit = XFS_QI_BWARNLIMIT(dqp->q_mount);
resbcountp = &dqp->q_res_bcount; resbcountp = &dqp->q_res_bcount;
} else { } else {
ASSERT(flags & XFS_TRANS_DQ_RES_RTBLKS); ASSERT(flags & XFS_TRANS_DQ_RES_RTBLKS);
hardlimit = INT_GET(dqp->q_core.d_rtb_hardlimit, ARCH_CONVERT); hardlimit = be64_to_cpu(dqp->q_core.d_rtb_hardlimit);
if (!hardlimit) if (!hardlimit)
hardlimit = q->qi_rtbhardlimit; hardlimit = q->qi_rtbhardlimit;
softlimit = INT_GET(dqp->q_core.d_rtb_softlimit, ARCH_CONVERT); softlimit = be64_to_cpu(dqp->q_core.d_rtb_softlimit);
if (!softlimit) if (!softlimit)
softlimit = q->qi_rtbsoftlimit; softlimit = q->qi_rtbsoftlimit;
timer = INT_GET(dqp->q_core.d_rtbtimer, ARCH_CONVERT); timer = be32_to_cpu(dqp->q_core.d_rtbtimer);
warns = INT_GET(dqp->q_core.d_rtbwarns, ARCH_CONVERT); warns = be16_to_cpu(dqp->q_core.d_rtbwarns);
warnlimit = XFS_QI_RTBWARNLIMIT(dqp->q_mount); warnlimit = XFS_QI_RTBWARNLIMIT(dqp->q_mount);
resbcountp = &dqp->q_res_rtbcount; resbcountp = &dqp->q_res_rtbcount;
} }
...@@ -684,16 +684,14 @@ xfs_trans_dqresv( ...@@ -684,16 +684,14 @@ xfs_trans_dqresv(
} }
} }
if (ninos > 0) { if (ninos > 0) {
count = INT_GET(dqp->q_core.d_icount, ARCH_CONVERT); count = be64_to_cpu(dqp->q_core.d_icount);
timer = INT_GET(dqp->q_core.d_itimer, ARCH_CONVERT); timer = be32_to_cpu(dqp->q_core.d_itimer);
warns = INT_GET(dqp->q_core.d_iwarns, ARCH_CONVERT); warns = be16_to_cpu(dqp->q_core.d_iwarns);
warnlimit = XFS_QI_IWARNLIMIT(dqp->q_mount); warnlimit = XFS_QI_IWARNLIMIT(dqp->q_mount);
hardlimit = INT_GET(dqp->q_core.d_ino_hardlimit, hardlimit = be64_to_cpu(dqp->q_core.d_ino_hardlimit);
ARCH_CONVERT);
if (!hardlimit) if (!hardlimit)
hardlimit = q->qi_ihardlimit; hardlimit = q->qi_ihardlimit;
softlimit = INT_GET(dqp->q_core.d_ino_softlimit, softlimit = be64_to_cpu(dqp->q_core.d_ino_softlimit);
ARCH_CONVERT);
if (!softlimit) if (!softlimit)
softlimit = q->qi_isoftlimit; softlimit = q->qi_isoftlimit;
if (hardlimit > 0ULL && count >= hardlimit) { if (hardlimit > 0ULL && count >= hardlimit) {
...@@ -740,9 +738,9 @@ xfs_trans_dqresv( ...@@ -740,9 +738,9 @@ xfs_trans_dqresv(
XFS_TRANS_DQ_RES_INOS, XFS_TRANS_DQ_RES_INOS,
ninos); ninos);
} }
ASSERT(dqp->q_res_bcount >= INT_GET(dqp->q_core.d_bcount, ARCH_CONVERT)); ASSERT(dqp->q_res_bcount >= be64_to_cpu(dqp->q_core.d_bcount));
ASSERT(dqp->q_res_rtbcount >= INT_GET(dqp->q_core.d_rtbcount, ARCH_CONVERT)); ASSERT(dqp->q_res_rtbcount >= be64_to_cpu(dqp->q_core.d_rtbcount));
ASSERT(dqp->q_res_icount >= INT_GET(dqp->q_core.d_icount, ARCH_CONVERT)); ASSERT(dqp->q_res_icount >= be64_to_cpu(dqp->q_core.d_icount));
error_return: error_return:
if (! (flags & XFS_QMOPT_DQLOCK)) { if (! (flags & XFS_QMOPT_DQLOCK)) {
......
...@@ -154,6 +154,21 @@ ...@@ -154,6 +154,21 @@
} \ } \
} }
static inline void be16_add(__be16 *a, __s16 b)
{
*a = cpu_to_be16(be16_to_cpu(*a) + b);
}
static inline void be32_add(__be32 *a, __s32 b)
{
*a = cpu_to_be32(be32_to_cpu(*a) + b);
}
static inline void be64_add(__be64 *a, __s64 b)
{
*a = cpu_to_be64(be64_to_cpu(*a) + b);
}
/* /*
* In directories inode numbers are stored as unaligned arrays of unsigned * In directories inode numbers are stored as unaligned arrays of unsigned
* 8bit integers on disk. * 8bit integers on disk.
......
...@@ -1998,79 +1998,74 @@ xfs_qm_dqcheck( ...@@ -1998,79 +1998,74 @@ xfs_qm_dqcheck(
* This is all fine; things are still consistent, and we haven't lost * This is all fine; things are still consistent, and we haven't lost
* any quota information. Just don't complain about bad dquot blks. * any quota information. Just don't complain about bad dquot blks.
*/ */
if (INT_GET(ddq->d_magic, ARCH_CONVERT) != XFS_DQUOT_MAGIC) { if (be16_to_cpu(ddq->d_magic) != XFS_DQUOT_MAGIC) {
if (flags & XFS_QMOPT_DOWARN) if (flags & XFS_QMOPT_DOWARN)
cmn_err(CE_ALERT, cmn_err(CE_ALERT,
"%s : XFS dquot ID 0x%x, magic 0x%x != 0x%x", "%s : XFS dquot ID 0x%x, magic 0x%x != 0x%x",
str, id, str, id, be16_to_cpu(ddq->d_magic), XFS_DQUOT_MAGIC);
INT_GET(ddq->d_magic, ARCH_CONVERT), XFS_DQUOT_MAGIC);
errs++; errs++;
} }
if (INT_GET(ddq->d_version, ARCH_CONVERT) != XFS_DQUOT_VERSION) { if (ddq->d_version != XFS_DQUOT_VERSION) {
if (flags & XFS_QMOPT_DOWARN) if (flags & XFS_QMOPT_DOWARN)
cmn_err(CE_ALERT, cmn_err(CE_ALERT,
"%s : XFS dquot ID 0x%x, version 0x%x != 0x%x", "%s : XFS dquot ID 0x%x, version 0x%x != 0x%x",
str, id, str, id, ddq->d_version, XFS_DQUOT_VERSION);
INT_GET(ddq->d_magic, ARCH_CONVERT), XFS_DQUOT_VERSION);
errs++; errs++;
} }
if (INT_GET(ddq->d_flags, ARCH_CONVERT) != XFS_DQ_USER && if (ddq->d_flags != XFS_DQ_USER &&
INT_GET(ddq->d_flags, ARCH_CONVERT) != XFS_DQ_PROJ && ddq->d_flags != XFS_DQ_PROJ &&
INT_GET(ddq->d_flags, ARCH_CONVERT) != XFS_DQ_GROUP) { ddq->d_flags != XFS_DQ_GROUP) {
if (flags & XFS_QMOPT_DOWARN) if (flags & XFS_QMOPT_DOWARN)
cmn_err(CE_ALERT, cmn_err(CE_ALERT,
"%s : XFS dquot ID 0x%x, unknown flags 0x%x", "%s : XFS dquot ID 0x%x, unknown flags 0x%x",
str, id, INT_GET(ddq->d_flags, ARCH_CONVERT)); str, id, ddq->d_flags);
errs++; errs++;
} }
if (id != -1 && id != INT_GET(ddq->d_id, ARCH_CONVERT)) { if (id != -1 && id != be32_to_cpu(ddq->d_id)) {
if (flags & XFS_QMOPT_DOWARN) if (flags & XFS_QMOPT_DOWARN)
cmn_err(CE_ALERT, cmn_err(CE_ALERT,
"%s : ondisk-dquot 0x%p, ID mismatch: " "%s : ondisk-dquot 0x%p, ID mismatch: "
"0x%x expected, found id 0x%x", "0x%x expected, found id 0x%x",
str, ddq, id, INT_GET(ddq->d_id, ARCH_CONVERT)); str, ddq, id, be32_to_cpu(ddq->d_id));
errs++; errs++;
} }
if (!errs && ddq->d_id) { if (!errs && ddq->d_id) {
if (INT_GET(ddq->d_blk_softlimit, ARCH_CONVERT) && if (ddq->d_blk_softlimit &&
INT_GET(ddq->d_bcount, ARCH_CONVERT) >= be64_to_cpu(ddq->d_bcount) >=
INT_GET(ddq->d_blk_softlimit, ARCH_CONVERT)) { be64_to_cpu(ddq->d_blk_softlimit)) {
if (!ddq->d_btimer) { if (!ddq->d_btimer) {
if (flags & XFS_QMOPT_DOWARN) if (flags & XFS_QMOPT_DOWARN)
cmn_err(CE_ALERT, cmn_err(CE_ALERT,
"%s : Dquot ID 0x%x (0x%p) " "%s : Dquot ID 0x%x (0x%p) "
"BLK TIMER NOT STARTED", "BLK TIMER NOT STARTED",
str, (int) str, (int)be32_to_cpu(ddq->d_id), ddq);
INT_GET(ddq->d_id, ARCH_CONVERT), ddq);
errs++; errs++;
} }
} }
if (INT_GET(ddq->d_ino_softlimit, ARCH_CONVERT) && if (ddq->d_ino_softlimit &&
INT_GET(ddq->d_icount, ARCH_CONVERT) >= be64_to_cpu(ddq->d_icount) >=
INT_GET(ddq->d_ino_softlimit, ARCH_CONVERT)) { be64_to_cpu(ddq->d_ino_softlimit)) {
if (!ddq->d_itimer) { if (!ddq->d_itimer) {
if (flags & XFS_QMOPT_DOWARN) if (flags & XFS_QMOPT_DOWARN)
cmn_err(CE_ALERT, cmn_err(CE_ALERT,
"%s : Dquot ID 0x%x (0x%p) " "%s : Dquot ID 0x%x (0x%p) "
"INODE TIMER NOT STARTED", "INODE TIMER NOT STARTED",
str, (int) str, (int)be32_to_cpu(ddq->d_id), ddq);
INT_GET(ddq->d_id, ARCH_CONVERT), ddq);
errs++; errs++;
} }
} }
if (INT_GET(ddq->d_rtb_softlimit, ARCH_CONVERT) && if (ddq->d_rtb_softlimit &&
INT_GET(ddq->d_rtbcount, ARCH_CONVERT) >= be64_to_cpu(ddq->d_rtbcount) >=
INT_GET(ddq->d_rtb_softlimit, ARCH_CONVERT)) { be64_to_cpu(ddq->d_rtb_softlimit)) {
if (!ddq->d_rtbtimer) { if (!ddq->d_rtbtimer) {
if (flags & XFS_QMOPT_DOWARN) if (flags & XFS_QMOPT_DOWARN)
cmn_err(CE_ALERT, cmn_err(CE_ALERT,
"%s : Dquot ID 0x%x (0x%p) " "%s : Dquot ID 0x%x (0x%p) "
"RTBLK TIMER NOT STARTED", "RTBLK TIMER NOT STARTED",
str, (int) str, (int)be32_to_cpu(ddq->d_id), ddq);
INT_GET(ddq->d_id, ARCH_CONVERT), ddq);
errs++; errs++;
} }
} }
...@@ -2088,10 +2083,11 @@ xfs_qm_dqcheck( ...@@ -2088,10 +2083,11 @@ xfs_qm_dqcheck(
ASSERT(id != -1); ASSERT(id != -1);
ASSERT(flags & XFS_QMOPT_DQREPAIR); ASSERT(flags & XFS_QMOPT_DQREPAIR);
memset(d, 0, sizeof(xfs_dqblk_t)); memset(d, 0, sizeof(xfs_dqblk_t));
INT_SET(d->dd_diskdq.d_magic, ARCH_CONVERT, XFS_DQUOT_MAGIC);
INT_SET(d->dd_diskdq.d_version, ARCH_CONVERT, XFS_DQUOT_VERSION); d->dd_diskdq.d_magic = cpu_to_be16(XFS_DQUOT_MAGIC);
INT_SET(d->dd_diskdq.d_id, ARCH_CONVERT, id); d->dd_diskdq.d_version = XFS_DQUOT_VERSION;
INT_SET(d->dd_diskdq.d_flags, ARCH_CONVERT, type); d->dd_diskdq.d_flags = type;
d->dd_diskdq.d_id = cpu_to_be32(id);
return errs; return errs;
} }
......
...@@ -45,28 +45,28 @@ typedef __uint16_t xfs_qwarncnt_t; ...@@ -45,28 +45,28 @@ typedef __uint16_t xfs_qwarncnt_t;
* to construct the on disk structure. * to construct the on disk structure.
*/ */
typedef struct xfs_disk_dquot { typedef struct xfs_disk_dquot {
/*16*/ u_int16_t d_magic; /* dquot magic = XFS_DQUOT_MAGIC */ __be16 d_magic; /* dquot magic = XFS_DQUOT_MAGIC */
/*8 */ u_int8_t d_version; /* dquot version */ __u8 d_version; /* dquot version */
/*8 */ u_int8_t d_flags; /* XFS_DQ_USER/PROJ/GROUP */ __u8 d_flags; /* XFS_DQ_USER/PROJ/GROUP */
/*32*/ xfs_dqid_t d_id; /* user,project,group id */ __be32 d_id; /* user,project,group id */
/*64*/ xfs_qcnt_t d_blk_hardlimit;/* absolute limit on disk blks */ __be64 d_blk_hardlimit;/* absolute limit on disk blks */
/*64*/ xfs_qcnt_t d_blk_softlimit;/* preferred limit on disk blks */ __be64 d_blk_softlimit;/* preferred limit on disk blks */
/*64*/ xfs_qcnt_t d_ino_hardlimit;/* maximum # allocated inodes */ __be64 d_ino_hardlimit;/* maximum # allocated inodes */
/*64*/ xfs_qcnt_t d_ino_softlimit;/* preferred inode limit */ __be64 d_ino_softlimit;/* preferred inode limit */
/*64*/ xfs_qcnt_t d_bcount; /* disk blocks owned by the user */ __be64 d_bcount; /* disk blocks owned by the user */
/*64*/ xfs_qcnt_t d_icount; /* inodes owned by the user */ __be64 d_icount; /* inodes owned by the user */
/*32*/ __int32_t d_itimer; /* zero if within inode limits if not, __be32 d_itimer; /* zero if within inode limits if not,
this is when we refuse service */ this is when we refuse service */
/*32*/ __int32_t d_btimer; /* similar to above; for disk blocks */ __be32 d_btimer; /* similar to above; for disk blocks */
/*16*/ xfs_qwarncnt_t d_iwarns; /* warnings issued wrt num inodes */ __be16 d_iwarns; /* warnings issued wrt num inodes */
/*16*/ xfs_qwarncnt_t d_bwarns; /* warnings issued wrt disk blocks */ __be16 d_bwarns; /* warnings issued wrt disk blocks */
/*32*/ __int32_t d_pad0; /* 64 bit align */ __be32 d_pad0; /* 64 bit align */
/*64*/ xfs_qcnt_t d_rtb_hardlimit;/* absolute limit on realtime blks */ __be64 d_rtb_hardlimit;/* absolute limit on realtime blks */
/*64*/ xfs_qcnt_t d_rtb_softlimit;/* preferred limit on RT disk blks */ __be64 d_rtb_softlimit;/* preferred limit on RT disk blks */
/*64*/ xfs_qcnt_t d_rtbcount; /* realtime blocks owned */ __be64 d_rtbcount; /* realtime blocks owned */
/*32*/ __int32_t d_rtbtimer; /* similar to above; for RT disk blocks */ __be32 d_rtbtimer; /* similar to above; for RT disk blocks */
/*16*/ xfs_qwarncnt_t d_rtbwarns; /* warnings issued wrt RT disk blocks */ __be16 d_rtbwarns; /* warnings issued wrt RT disk blocks */
/*16*/ __uint16_t d_pad; __be16 d_pad;
} xfs_disk_dquot_t; } xfs_disk_dquot_t;
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment