From: Christoph Hellwig Date: Wed, 30 Jun 2021 22:33:57 +0000 (-0400) Subject: xfs: move the di_flushiter field to struct xfs_inode X-Git-Tag: v5.13.0-rc0~31 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=36e4f3630b736c4a492ce2dd8e8cfb2fc917dbe6;p=thirdparty%2Fxfsprogs-dev.git xfs: move the di_flushiter field to struct xfs_inode Source kernel commit: 965e0a1ad273ba61a8040220ef8ec09c9d065875 In preparation of removing the historic icinode struct, move the flushiter 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 056ac104f..d7168d087 100644 --- a/include/xfs_inode.h +++ b/include/xfs_inode.h @@ -83,6 +83,7 @@ typedef struct xfs_inode { 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 */ + uint16_t i_flushiter; /* incremented on flush */ struct xfs_icdinode i_d; /* most of ondisk inode */ xfs_extnum_t i_cnextents; /* # of extents in cow fork */ diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c index 3ab254208..252ff3d63 100644 --- a/libxfs/xfs_inode_buf.c +++ b/libxfs/xfs_inode_buf.c @@ -190,7 +190,7 @@ xfs_inode_from_disk( * inode. If the inode is unused, mode is zero and we shouldn't mess * with the uninitialized part of it. */ - to->di_flushiter = be16_to_cpu(from->di_flushiter); + ip->i_flushiter = be16_to_cpu(from->di_flushiter); inode->i_generation = be32_to_cpu(from->di_gen); inode->i_mode = be16_to_cpu(from->di_mode); if (!inode->i_mode) @@ -324,7 +324,7 @@ xfs_inode_to_disk( to->di_flushiter = 0; } else { to->di_version = 2; - to->di_flushiter = cpu_to_be16(from->di_flushiter); + to->di_flushiter = cpu_to_be16(ip->i_flushiter); } } diff --git a/libxfs/xfs_inode_buf.h b/libxfs/xfs_inode_buf.h index 77d250dbe..e41a11bef 100644 --- a/libxfs/xfs_inode_buf.h +++ b/libxfs/xfs_inode_buf.h @@ -16,7 +16,6 @@ struct xfs_dinode; * format specific structures at the appropriate time. */ struct xfs_icdinode { - uint16_t di_flushiter; /* incremented on flush */ 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 29606b029..252cd24aa 100644 --- a/repair/phase6.c +++ b/repair/phase6.c @@ -446,6 +446,7 @@ reset_inode_fields(struct xfs_inode *ip) ip->i_nblocks = 0; ip->i_extsize = 0; ip->i_cowextsize = 0; + ip->i_flushiter = 0; } static void