From: Christoph Hellwig Date: Wed, 30 Jun 2021 22:33:29 +0000 (-0400) Subject: xfs: move the di_extsize field to struct xfs_inode X-Git-Tag: v5.13.0-rc0~33 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fd2f92c8a3dae5ccc0a697c74d0fd9e0fc93dc12;p=thirdparty%2Fxfsprogs-dev.git xfs: move the di_extsize field to struct xfs_inode 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 Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Signed-off-by: Eric Sandeen --- diff --git a/include/xfs_inode.h b/include/xfs_inode.h index f2b315d7a..0281f66c6 100644 --- a/include/xfs_inode.h +++ b/include/xfs_inode.h @@ -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 */ diff --git a/libxfs/util.c b/libxfs/util.c index 1af18913f..b90f227cd 100644 --- a/libxfs/util.c +++ b/libxfs/util.c @@ -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)) { diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c index 197c89361..8cdf208d3 100644 --- a/libxfs/xfs_bmap.c +++ b/libxfs/xfs_bmap.c @@ -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( diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c index cf0f3e5e1..39dd4ef9e 100644 --- a/libxfs/xfs_inode_buf.c +++ b/libxfs/xfs_inode_buf.c @@ -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; diff --git a/libxfs/xfs_inode_buf.h b/libxfs/xfs_inode_buf.h index f4e1a9010..6bc788563 100644 --- a/libxfs/xfs_inode_buf.h +++ b/libxfs/xfs_inode_buf.h @@ -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_... */ diff --git a/repair/phase6.c b/repair/phase6.c index 2d0ff7dfe..0c10b6fed 100644 --- a/repair/phase6.c +++ b/repair/phase6.c @@ -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