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

In preparation of removing the historic icinode struct, move the extsize
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_bmap.c
libxfs/xfs_inode_buf.c
libxfs/xfs_inode_buf.h
repair/phase6.c

index f2b315d7a860d8fc626fdd704a4fd2945867ace6..0281f66c694ff3e3d58d684b6f77a4785ec76952 100644 (file)
@@ -81,6 +81,7 @@ typedef struct xfs_inode {
        xfs_fsize_t             i_disk_size;    /* number of bytes in file */
        xfs_rfsblock_t          i_nblocks;      /* # of direct & btree blocks */
        prid_t                  i_projid;       /* owner's project id */
+       xfs_extlen_t            i_extsize;      /* basic/minimum extent size */
        struct xfs_icdinode     i_d;            /* most of ondisk inode */
 
        xfs_extnum_t            i_cnextents;    /* # of extents in cow fork */
index 1af18913f90b165fe19e79c5c1ed5bcb6343359a..b90f227cdc49a153758415ecfa4b090b80de25cc 100644 (file)
@@ -222,7 +222,7 @@ xfs_inode_propagate_flags(
                        di_flags |= XFS_DIFLAG_RTINHERIT;
                if (pip->i_d.di_flags & XFS_DIFLAG_EXTSZINHERIT) {
                        di_flags |= XFS_DIFLAG_EXTSZINHERIT;
-                       ip->i_d.di_extsize = pip->i_d.di_extsize;
+                       ip->i_extsize = pip->i_extsize;
                }
        } else {
                if ((pip->i_d.di_flags & XFS_DIFLAG_RTINHERIT) &&
@@ -230,7 +230,7 @@ xfs_inode_propagate_flags(
                        di_flags |= XFS_DIFLAG_REALTIME;
                if (pip->i_d.di_flags & XFS_DIFLAG_EXTSZINHERIT) {
                        di_flags |= XFS_DIFLAG_EXTSIZE;
-                       ip->i_d.di_extsize = pip->i_d.di_extsize;
+                       ip->i_extsize = pip->i_extsize;
                }
        }
        if (pip->i_d.di_flags & XFS_DIFLAG_PROJINHERIT)
@@ -279,7 +279,7 @@ libxfs_init_new_inode(
        ip->i_disk_size = 0;
        ip->i_df.if_nextents = 0;
        ASSERT(ip->i_nblocks == 0);
-       ip->i_d.di_extsize = pip ? 0 : fsx->fsx_extsize;
+       ip->i_extsize = pip ? 0 : fsx->fsx_extsize;
        ip->i_d.di_flags = pip ? 0 : xfs_flags2diflags(ip, fsx->fsx_xflags);
 
        if (xfs_sb_version_has_v3inode(&ip->i_mount->m_sb)) {
index 197c893612e46bf90175837533c92a699e060ad1..8cdf208d30aa04a5a1ab06e7541846b0ac38f743 100644 (file)
@@ -2930,7 +2930,7 @@ done:
  */
 
 /*
- * Adjust the size of the new extent based on di_extsize and rt extsize.
+ * Adjust the size of the new extent based on i_extsize and rt extsize.
  */
 int
 xfs_bmap_extsize_align(
index cf0f3e5e121bfb9342b9be84899241396139cac8..39dd4ef9e5a7f56ed1e0f5fba19f534cdb83ff3b 100644 (file)
@@ -225,7 +225,7 @@ xfs_inode_from_disk(
 
        ip->i_disk_size = be64_to_cpu(from->di_size);
        ip->i_nblocks = be64_to_cpu(from->di_nblocks);
-       to->di_extsize = be32_to_cpu(from->di_extsize);
+       ip->i_extsize = be32_to_cpu(from->di_extsize);
        to->di_forkoff = from->di_forkoff;
        to->di_flags    = be16_to_cpu(from->di_flags);
 
@@ -304,7 +304,7 @@ xfs_inode_to_disk(
 
        to->di_size = cpu_to_be64(ip->i_disk_size);
        to->di_nblocks = cpu_to_be64(ip->i_nblocks);
-       to->di_extsize = cpu_to_be32(from->di_extsize);
+       to->di_extsize = cpu_to_be32(ip->i_extsize);
        to->di_nextents = cpu_to_be32(xfs_ifork_nextents(&ip->i_df));
        to->di_anextents = cpu_to_be16(xfs_ifork_nextents(ip->i_afp));
        to->di_forkoff = from->di_forkoff;
index f4e1a9010b0a47803739b4bf04b7c0f7d207ebd0..6bc78856373e31039b9320c002afcb3f80732713 100644 (file)
@@ -17,7 +17,6 @@ struct xfs_dinode;
  */
 struct xfs_icdinode {
        uint16_t        di_flushiter;   /* incremented on flush */
-       xfs_extlen_t    di_extsize;     /* basic/minimum extent size for file */
        uint8_t         di_forkoff;     /* attr fork offs, <<3 for 64b align */
        uint16_t        di_flags;       /* random flags, XFS_DIFLAG_... */
 
index 2d0ff7dfeff6dd0afe702e6feb4e086f9b8da597..0c10b6fed2158f609ebbeadf143614bd09152ade 100644 (file)
@@ -444,6 +444,7 @@ reset_inode_fields(struct xfs_inode *ip)
        ip->i_projid = 0;
        ip->i_disk_size = 0;
        ip->i_nblocks = 0;
+       ip->i_extsize = 0;
 }
 
 static void