mirror of
https://github.com/torvalds/linux.git
synced 2024-12-26 12:52:30 +00:00
xfs: rename the ondisk dquot d_flags to d_type
The ondisk dquot stores the quota record type in the flags field. Rename this field to d_type to make the _type relationship between the ondisk and incore dquot more obvious. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
a990f7a84e
commit
d8c1af0d6a
@ -61,9 +61,9 @@ xfs_dquot_verify(
|
|||||||
if (ddq->d_version != XFS_DQUOT_VERSION)
|
if (ddq->d_version != XFS_DQUOT_VERSION)
|
||||||
return __this_address;
|
return __this_address;
|
||||||
|
|
||||||
if (ddq->d_flags & ~XFS_DQTYPE_ANY)
|
if (ddq->d_type & ~XFS_DQTYPE_ANY)
|
||||||
return __this_address;
|
return __this_address;
|
||||||
ddq_type = ddq->d_flags & XFS_DQTYPE_REC_MASK;
|
ddq_type = ddq->d_type & XFS_DQTYPE_REC_MASK;
|
||||||
if (ddq_type != XFS_DQTYPE_USER &&
|
if (ddq_type != XFS_DQTYPE_USER &&
|
||||||
ddq_type != XFS_DQTYPE_PROJ &&
|
ddq_type != XFS_DQTYPE_PROJ &&
|
||||||
ddq_type != XFS_DQTYPE_GROUP)
|
ddq_type != XFS_DQTYPE_GROUP)
|
||||||
@ -124,7 +124,7 @@ xfs_dqblk_repair(
|
|||||||
|
|
||||||
dqb->dd_diskdq.d_magic = cpu_to_be16(XFS_DQUOT_MAGIC);
|
dqb->dd_diskdq.d_magic = cpu_to_be16(XFS_DQUOT_MAGIC);
|
||||||
dqb->dd_diskdq.d_version = XFS_DQUOT_VERSION;
|
dqb->dd_diskdq.d_version = XFS_DQUOT_VERSION;
|
||||||
dqb->dd_diskdq.d_flags = type;
|
dqb->dd_diskdq.d_type = type;
|
||||||
dqb->dd_diskdq.d_id = cpu_to_be32(id);
|
dqb->dd_diskdq.d_id = cpu_to_be32(id);
|
||||||
|
|
||||||
if (xfs_sb_version_hascrc(&mp->m_sb)) {
|
if (xfs_sb_version_hascrc(&mp->m_sb)) {
|
||||||
|
@ -1168,7 +1168,7 @@ static inline void xfs_dinode_put_rdev(struct xfs_dinode *dip, xfs_dev_t rdev)
|
|||||||
struct xfs_disk_dquot {
|
struct xfs_disk_dquot {
|
||||||
__be16 d_magic; /* dquot magic = XFS_DQUOT_MAGIC */
|
__be16 d_magic; /* dquot magic = XFS_DQUOT_MAGIC */
|
||||||
__u8 d_version; /* dquot version */
|
__u8 d_version; /* dquot version */
|
||||||
__u8 d_flags; /* XFS_DQTYPE_USER/PROJ/GROUP */
|
__u8 d_type; /* XFS_DQTYPE_USER/PROJ/GROUP */
|
||||||
__be32 d_id; /* user,project,group id */
|
__be32 d_id; /* user,project,group id */
|
||||||
__be64 d_blk_hardlimit;/* absolute limit on disk blks */
|
__be64 d_blk_hardlimit;/* absolute limit on disk blks */
|
||||||
__be64 d_blk_softlimit;/* preferred limit on disk blks */
|
__be64 d_blk_softlimit;/* preferred limit on disk blks */
|
||||||
|
@ -200,7 +200,7 @@ xfs_qm_init_dquot_blk(
|
|||||||
d->dd_diskdq.d_magic = cpu_to_be16(XFS_DQUOT_MAGIC);
|
d->dd_diskdq.d_magic = cpu_to_be16(XFS_DQUOT_MAGIC);
|
||||||
d->dd_diskdq.d_version = XFS_DQUOT_VERSION;
|
d->dd_diskdq.d_version = XFS_DQUOT_VERSION;
|
||||||
d->dd_diskdq.d_id = cpu_to_be32(curid);
|
d->dd_diskdq.d_id = cpu_to_be32(curid);
|
||||||
d->dd_diskdq.d_flags = type;
|
d->dd_diskdq.d_type = type;
|
||||||
if (xfs_sb_version_hascrc(&mp->m_sb)) {
|
if (xfs_sb_version_hascrc(&mp->m_sb)) {
|
||||||
uuid_copy(&d->dd_uuid, &mp->m_sb.sb_meta_uuid);
|
uuid_copy(&d->dd_uuid, &mp->m_sb.sb_meta_uuid);
|
||||||
xfs_update_cksum((char *)d, sizeof(struct xfs_dqblk),
|
xfs_update_cksum((char *)d, sizeof(struct xfs_dqblk),
|
||||||
@ -488,7 +488,7 @@ xfs_dquot_from_disk(
|
|||||||
* Ensure that we got the type and ID we were looking for.
|
* Ensure that we got the type and ID we were looking for.
|
||||||
* Everything else was checked by the dquot buffer verifier.
|
* Everything else was checked by the dquot buffer verifier.
|
||||||
*/
|
*/
|
||||||
if ((ddqp->d_flags & XFS_DQTYPE_REC_MASK) != xfs_dquot_type(dqp) ||
|
if ((ddqp->d_type & XFS_DQTYPE_REC_MASK) != xfs_dquot_type(dqp) ||
|
||||||
be32_to_cpu(ddqp->d_id) != dqp->q_id) {
|
be32_to_cpu(ddqp->d_id) != dqp->q_id) {
|
||||||
xfs_alert_tag(bp->b_mount, XFS_PTAG_VERIFIER_ERROR,
|
xfs_alert_tag(bp->b_mount, XFS_PTAG_VERIFIER_ERROR,
|
||||||
"Metadata corruption detected at %pS, quota %u",
|
"Metadata corruption detected at %pS, quota %u",
|
||||||
@ -498,7 +498,7 @@ xfs_dquot_from_disk(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* copy everything from disk dquot to the incore dquot */
|
/* copy everything from disk dquot to the incore dquot */
|
||||||
dqp->q_type = ddqp->d_flags;
|
dqp->q_type = ddqp->d_type;
|
||||||
dqp->q_blk.hardlimit = be64_to_cpu(ddqp->d_blk_hardlimit);
|
dqp->q_blk.hardlimit = be64_to_cpu(ddqp->d_blk_hardlimit);
|
||||||
dqp->q_blk.softlimit = be64_to_cpu(ddqp->d_blk_softlimit);
|
dqp->q_blk.softlimit = be64_to_cpu(ddqp->d_blk_softlimit);
|
||||||
dqp->q_ino.hardlimit = be64_to_cpu(ddqp->d_ino_hardlimit);
|
dqp->q_ino.hardlimit = be64_to_cpu(ddqp->d_ino_hardlimit);
|
||||||
@ -539,7 +539,7 @@ xfs_dquot_to_disk(
|
|||||||
{
|
{
|
||||||
ddqp->d_magic = cpu_to_be16(XFS_DQUOT_MAGIC);
|
ddqp->d_magic = cpu_to_be16(XFS_DQUOT_MAGIC);
|
||||||
ddqp->d_version = XFS_DQUOT_VERSION;
|
ddqp->d_version = XFS_DQUOT_VERSION;
|
||||||
ddqp->d_flags = dqp->q_type;
|
ddqp->d_type = dqp->q_type;
|
||||||
ddqp->d_id = cpu_to_be32(dqp->q_id);
|
ddqp->d_id = cpu_to_be32(dqp->q_id);
|
||||||
ddqp->d_pad0 = 0;
|
ddqp->d_pad0 = 0;
|
||||||
ddqp->d_pad = 0;
|
ddqp->d_pad = 0;
|
||||||
|
@ -39,7 +39,7 @@ xlog_recover_dquot_ra_pass2(
|
|||||||
if (item->ri_buf[1].i_len < sizeof(struct xfs_disk_dquot))
|
if (item->ri_buf[1].i_len < sizeof(struct xfs_disk_dquot))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
type = recddq->d_flags & XFS_DQTYPE_REC_MASK;
|
type = recddq->d_type & XFS_DQTYPE_REC_MASK;
|
||||||
ASSERT(type);
|
ASSERT(type);
|
||||||
if (log->l_quotaoffs_flag & type)
|
if (log->l_quotaoffs_flag & type)
|
||||||
return;
|
return;
|
||||||
@ -91,7 +91,7 @@ xlog_recover_dquot_commit_pass2(
|
|||||||
/*
|
/*
|
||||||
* This type of quotas was turned off, so ignore this record.
|
* This type of quotas was turned off, so ignore this record.
|
||||||
*/
|
*/
|
||||||
type = recddq->d_flags & XFS_DQTYPE_REC_MASK;
|
type = recddq->d_type & XFS_DQTYPE_REC_MASK;
|
||||||
ASSERT(type);
|
ASSERT(type);
|
||||||
if (log->l_quotaoffs_flag & type)
|
if (log->l_quotaoffs_flag & type)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -855,14 +855,14 @@ xfs_qm_reset_dqcounts(
|
|||||||
* xfs_dquot_verify.
|
* xfs_dquot_verify.
|
||||||
*/
|
*/
|
||||||
if (xfs_dqblk_verify(mp, &dqb[j], id + j) ||
|
if (xfs_dqblk_verify(mp, &dqb[j], id + j) ||
|
||||||
(dqb[j].dd_diskdq.d_flags & XFS_DQTYPE_REC_MASK) != type)
|
(dqb[j].dd_diskdq.d_type & XFS_DQTYPE_REC_MASK) != type)
|
||||||
xfs_dqblk_repair(mp, &dqb[j], id + j, type);
|
xfs_dqblk_repair(mp, &dqb[j], id + j, type);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Reset type in case we are reusing group quota file for
|
* Reset type in case we are reusing group quota file for
|
||||||
* project quotas or vice versa
|
* project quotas or vice versa
|
||||||
*/
|
*/
|
||||||
ddq->d_flags = type;
|
ddq->d_type = type;
|
||||||
ddq->d_bcount = 0;
|
ddq->d_bcount = 0;
|
||||||
ddq->d_icount = 0;
|
ddq->d_icount = 0;
|
||||||
ddq->d_rtbcount = 0;
|
ddq->d_rtbcount = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user