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

In preparation of removing the historic icinode struct, move the
cowextsize field into the containing xfs_inode structure.  Also
switch to use the xfs_extlen_t instead of a uint32_t.

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

index 0281f66c694ff3e3d58d684b6f77a4785ec76952..056ac104f5a6820660efa2bf7af4f2cb4240db1c 100644 (file)
@@ -82,6 +82,7 @@ typedef struct xfs_inode {
        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 */
+       xfs_extlen_t            i_cowextsize;   /* basic cow extent size */
        struct xfs_icdinode     i_d;            /* most of ondisk inode */
 
        xfs_extnum_t            i_cnextents;    /* # of extents in cow fork */
index b90f227cdc49a153758415ecfa4b090b80de25cc..e401a1a546861149e5a3e26b9602e88d9bafd7d9 100644 (file)
@@ -289,7 +289,7 @@ libxfs_init_new_inode(
                ip->i_d.di_flags2 = pip ? ip->i_mount->m_ino_geo.new_diflags2 :
                                xfs_flags2diflags2(ip, fsx->fsx_xflags);
                ip->i_d.di_crtime = VFS_I(ip)->i_mtime; /* struct copy */
-               ip->i_d.di_cowextsize = pip ? 0 : fsx->fsx_cowextsize;
+               ip->i_cowextsize = pip ? 0 : fsx->fsx_cowextsize;
        }
 
        flags = XFS_ILOG_CORE;
index 39dd4ef9e5a7f56ed1e0f5fba19f534cdb83ff3b..3ab25420876e731f127513cfce54cf8c47cf86f9 100644 (file)
@@ -237,7 +237,7 @@ xfs_inode_from_disk(
                                           be64_to_cpu(from->di_changecount));
                to->di_crtime = xfs_inode_from_disk_ts(from, from->di_crtime);
                to->di_flags2 = be64_to_cpu(from->di_flags2);
-               to->di_cowextsize = be32_to_cpu(from->di_cowextsize);
+               ip->i_cowextsize = be32_to_cpu(from->di_cowextsize);
        }
 
        error = xfs_iformat_data_fork(ip, from);
@@ -316,7 +316,7 @@ xfs_inode_to_disk(
                to->di_changecount = cpu_to_be64(inode_peek_iversion(inode));
                to->di_crtime = xfs_inode_to_disk_ts(ip, from->di_crtime);
                to->di_flags2 = cpu_to_be64(from->di_flags2);
-               to->di_cowextsize = cpu_to_be32(from->di_cowextsize);
+               to->di_cowextsize = cpu_to_be32(ip->i_cowextsize);
                to->di_ino = cpu_to_be64(ip->i_ino);
                to->di_lsn = cpu_to_be64(lsn);
                memset(to->di_pad2, 0, sizeof(to->di_pad2));
index 6bc78856373e31039b9320c002afcb3f80732713..77d250dbe9684813ae00bba12b477588d2f6a041 100644 (file)
@@ -21,7 +21,6 @@ struct xfs_icdinode {
        uint16_t        di_flags;       /* random flags, XFS_DIFLAG_... */
 
        uint64_t        di_flags2;      /* more random flags */
-       uint32_t        di_cowextsize;  /* basic cow extent size for file */
 
        struct timespec64 di_crtime;    /* time created */
 };
index 0c10b6fed2158f609ebbeadf143614bd09152ade..29606b0298d660126c5dd2e6dcb3d89532a6add0 100644 (file)
@@ -445,6 +445,7 @@ reset_inode_fields(struct xfs_inode *ip)
        ip->i_disk_size = 0;
        ip->i_nblocks = 0;
        ip->i_extsize = 0;
+       ip->i_cowextsize = 0;
 }
 
 static void