]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: move the di_projid field to struct xfs_inode
authorChristoph Hellwig <hch@lst.de>
Wed, 30 Jun 2021 22:32:24 +0000 (18:32 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Wed, 30 Jun 2021 22:32:24 +0000 (18:32 -0400)
Source kernel commit: ceaf603c7024d3c021803a3e90e893feda8d76e2

In preparation of removing the historic icinode struct, move the projid
field into the containing xfs_inode structure.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
include/xfs_inode.h
libxfs/util.c
libxfs/xfs_inode_buf.c
libxfs/xfs_inode_buf.h
repair/phase6.c
repair/quotacheck.c

index 01a62daa0778fdd8af29fbaf1268fccbbc8a2c4f..5b86932c9b3f2cb6d4ffcfa8fab739707a3a65ad 100644 (file)
@@ -78,6 +78,7 @@ typedef struct xfs_inode {
        struct xfs_ifork        i_df;           /* data fork */
        struct xfs_inode_log_item *i_itemp;     /* logging information */
        unsigned int            i_delayed_blks; /* count of delay alloc blks */
+       prid_t                  i_projid;       /* owner's project id */
        struct xfs_icdinode     i_d;            /* most of ondisk inode */
 
        xfs_extnum_t            i_cnextents;    /* # of extents in cow fork */
index c666ee88c2456d7878c1639ebde61961cdfaa708..c3fddbb2696eb21eeb07022dd2f998bd14f998bb 100644 (file)
@@ -267,7 +267,7 @@ libxfs_init_new_inode(
        set_nlink(VFS_I(ip), nlink);
        i_uid_write(VFS_I(ip), cr->cr_uid);
        i_gid_write(VFS_I(ip), cr->cr_gid);
-       ip->i_d.di_projid = pip ? 0 : fsx->fsx_projid;
+       ip->i_projid = pip ? 0 : fsx->fsx_projid;
        xfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_CHG | XFS_ICHGTIME_MOD);
 
        if (pip && (VFS_I(pip)->i_mode & S_ISGID)) {
index c7be54a294c29dd7b33e57b31490430609d6da80..0ae2b61bd62602f2f209505b68ba99658ef80288 100644 (file)
@@ -203,10 +203,10 @@ xfs_inode_from_disk(
         */
        if (unlikely(from->di_version == 1)) {
                set_nlink(inode, be16_to_cpu(from->di_onlink));
-               to->di_projid = 0;
+               ip->i_projid = 0;
        } else {
                set_nlink(inode, be32_to_cpu(from->di_nlink));
-               to->di_projid = (prid_t)be16_to_cpu(from->di_projid_hi) << 16 |
+               ip->i_projid = (prid_t)be16_to_cpu(from->di_projid_hi) << 16 |
                                        be16_to_cpu(from->di_projid_lo);
        }
 
@@ -291,8 +291,8 @@ xfs_inode_to_disk(
        to->di_format = xfs_ifork_format(&ip->i_df);
        to->di_uid = cpu_to_be32(i_uid_read(inode));
        to->di_gid = cpu_to_be32(i_gid_read(inode));
-       to->di_projid_lo = cpu_to_be16(from->di_projid & 0xffff);
-       to->di_projid_hi = cpu_to_be16(from->di_projid >> 16);
+       to->di_projid_lo = cpu_to_be16(ip->i_projid & 0xffff);
+       to->di_projid_hi = cpu_to_be16(ip->i_projid >> 16);
 
        memset(to->di_pad, 0, sizeof(to->di_pad));
        to->di_atime = xfs_inode_to_disk_ts(ip, inode->i_atime);
index d7a019df05d647bb5d1e923926acff87c3220acb..406f667992883f7978df8c93af82141d2407015b 100644 (file)
@@ -17,7 +17,6 @@ struct xfs_dinode;
  */
 struct xfs_icdinode {
        uint16_t        di_flushiter;   /* incremented on flush */
-       prid_t          di_projid;      /* owner's project id */
        xfs_fsize_t     di_size;        /* number of bytes in file */
        xfs_rfsblock_t  di_nblocks;     /* # of direct & btree blocks used */
        xfs_extlen_t    di_extsize;     /* basic/minimum extent size for file */
index e8acba343c7b1deef45869ab507b092440a1f821..6526a0be88cbad495da1f59cc339aa042d9f05c1 100644 (file)
@@ -441,6 +441,7 @@ static inline void
 reset_inode_fields(struct xfs_inode *ip)
 {
        memset(&ip->i_d, 0, sizeof(ip->i_d));
+       ip->i_projid = 0;
 }
 
 static void
index 0a505c9cbf3b6d65a17c6aaa9da79ccc530521b6..0c4d48406276435da636ef33db92d6603d698ae0 100644 (file)
@@ -229,7 +229,7 @@ quotacheck_adjust(
        if (group_dquots)
                qc_adjust(group_dquots, i_gid_read(VFS_I(ip)), blocks, rtblks);
        if (proj_dquots)
-               qc_adjust(proj_dquots, ip->i_d.di_projid, blocks, rtblks);
+               qc_adjust(proj_dquots, ip->i_projid, blocks, rtblks);
 
        libxfs_irele(ip);
 }