From: Christoph Hellwig Date: Wed, 30 Jun 2021 22:36:05 +0000 (-0400) Subject: xfs: move the di_flags2 field to struct xfs_inode X-Git-Tag: v5.13.0-rc0~27 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=defd64467d7f86db9a4d835140fa446f2faaa5b7;p=thirdparty%2Fxfsprogs-dev.git xfs: move the di_flags2 field to struct xfs_inode Source kernel commit: 3e09ab8fdc4d4c9d0afee7a63a3b39e5ade3c863 In preparation of removing the historic icinode struct, move the flags2 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 7df3c7692..8e75ad911 100644 --- a/include/xfs_inode.h +++ b/include/xfs_inode.h @@ -89,6 +89,7 @@ typedef struct xfs_inode { }; uint8_t i_forkoff; /* attr fork offset >> 3 */ uint16_t i_diflags; /* XFS_DIFLAG_... */ + uint64_t i_diflags2; /* XFS_DIFLAG2_... */ struct xfs_icdinode i_d; /* most of ondisk inode */ xfs_extnum_t i_cnextents; /* # of extents in cow fork */ @@ -154,12 +155,12 @@ static inline void inc_nlink(struct inode *inode) static inline bool xfs_is_reflink_inode(struct xfs_inode *ip) { - return ip->i_d.di_flags2 & XFS_DIFLAG2_REFLINK; + return ip->i_diflags2 & XFS_DIFLAG2_REFLINK; } static inline bool xfs_inode_has_bigtime(struct xfs_inode *ip) { - return ip->i_d.di_flags2 & XFS_DIFLAG2_BIGTIME; + return ip->i_diflags2 & XFS_DIFLAG2_BIGTIME; } typedef struct cred { diff --git a/libxfs/util.c b/libxfs/util.c index f853a32f1..cc2e6f28a 100644 --- a/libxfs/util.c +++ b/libxfs/util.c @@ -197,8 +197,8 @@ xfs_flags2diflags2( unsigned int xflags) { uint64_t di_flags2 = - (ip->i_d.di_flags2 & (XFS_DIFLAG2_REFLINK | - XFS_DIFLAG2_BIGTIME)); + (ip->i_diflags2 & (XFS_DIFLAG2_REFLINK | + XFS_DIFLAG2_BIGTIME)); if (xflags & FS_XFLAG_DAX) di_flags2 |= XFS_DIFLAG2_DAX; @@ -286,7 +286,7 @@ libxfs_init_new_inode( ASSERT(ip->i_d.di_ino == ino); ASSERT(uuid_equal(&ip->i_d.di_uuid, &mp->m_sb.sb_meta_uuid)); VFS_I(ip)->i_version = 1; - ip->i_d.di_flags2 = pip ? ip->i_mount->m_ino_geo.new_diflags2 : + ip->i_diflags2 = 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_cowextsize = pip ? 0 : fsx->fsx_cowextsize; diff --git a/libxfs/xfs_inode_buf.c b/libxfs/xfs_inode_buf.c index dc16ca718..d41e2f326 100644 --- a/libxfs/xfs_inode_buf.c +++ b/libxfs/xfs_inode_buf.c @@ -237,7 +237,7 @@ xfs_inode_from_disk( inode_set_iversion_queried(inode, 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); + ip->i_diflags2 = be64_to_cpu(from->di_flags2); ip->i_cowextsize = be32_to_cpu(from->di_cowextsize); } @@ -316,7 +316,7 @@ xfs_inode_to_disk( to->di_version = 3; 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_flags2 = cpu_to_be64(ip->i_diflags2); 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); diff --git a/libxfs/xfs_inode_buf.h b/libxfs/xfs_inode_buf.h index cfad369e7..2f6015acf 100644 --- a/libxfs/xfs_inode_buf.h +++ b/libxfs/xfs_inode_buf.h @@ -16,8 +16,6 @@ struct xfs_dinode; * format specific structures at the appropriate time. */ struct xfs_icdinode { - uint64_t di_flags2; /* more random flags */ - struct timespec64 di_crtime; /* time created */ }; diff --git a/libxfs/xfs_trans_inode.c b/libxfs/xfs_trans_inode.c index 9dc59c3b5..c0a109840 100644 --- a/libxfs/xfs_trans_inode.c +++ b/libxfs/xfs_trans_inode.c @@ -135,7 +135,7 @@ xfs_trans_log_inode( if ((flags & (XFS_ILOG_CORE | XFS_ILOG_TIMESTAMP)) && xfs_sb_version_hasbigtime(&ip->i_mount->m_sb) && !xfs_inode_has_bigtime(ip)) { - ip->i_d.di_flags2 |= XFS_DIFLAG2_BIGTIME; + ip->i_diflags2 |= XFS_DIFLAG2_BIGTIME; flags |= XFS_ILOG_CORE; } diff --git a/repair/phase6.c b/repair/phase6.c index 02aaa4911..6d8f6d9bb 100644 --- a/repair/phase6.c +++ b/repair/phase6.c @@ -449,6 +449,7 @@ reset_inode_fields(struct xfs_inode *ip) ip->i_flushiter = 0; ip->i_forkoff = 0; ip->i_diflags = 0; + ip->i_diflags2 = 0; } static void @@ -491,7 +492,7 @@ mk_rbmino(xfs_mount_t *mp) times = XFS_ICHGTIME_CHG | XFS_ICHGTIME_MOD; if (xfs_sb_version_has_v3inode(&mp->m_sb)) { VFS_I(ip)->i_version = 1; - ip->i_d.di_flags2 = 0; + ip->i_diflags2 = 0; times |= XFS_ICHGTIME_CREATE; } libxfs_trans_ichgtime(tp, ip, times); @@ -732,7 +733,7 @@ mk_rsumino(xfs_mount_t *mp) times = XFS_ICHGTIME_CHG | XFS_ICHGTIME_MOD; if (xfs_sb_version_has_v3inode(&mp->m_sb)) { VFS_I(ip)->i_version = 1; - ip->i_d.di_flags2 = 0; + ip->i_diflags2 = 0; times |= XFS_ICHGTIME_CREATE; } libxfs_trans_ichgtime(tp, ip, times); @@ -832,7 +833,7 @@ mk_root_dir(xfs_mount_t *mp) times = XFS_ICHGTIME_CHG | XFS_ICHGTIME_MOD; if (xfs_sb_version_has_v3inode(&mp->m_sb)) { VFS_I(ip)->i_version = 1; - ip->i_d.di_flags2 = 0; + ip->i_diflags2 = 0; times |= XFS_ICHGTIME_CREATE; } libxfs_trans_ichgtime(tp, ip, times);