]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: move the di_flags2 field to struct xfs_inode
authorChristoph Hellwig <hch@lst.de>
Wed, 30 Jun 2021 22:36:05 +0000 (18:36 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Wed, 30 Jun 2021 22:36:05 +0000 (18:36 -0400)
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 <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
libxfs/xfs_trans_inode.c
repair/phase6.c

index 7df3c76927ca77389dc87c2d7fbd6cb9c32866e7..8e75ad9116c88e647d713bc2c416b7dd225b4806 100644 (file)
@@ -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 {
index f853a32f1cb0cc0de0d02e5446474957586d5a4c..cc2e6f28a840400c8f17e2b979f1786846cf67cf 100644 (file)
@@ -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;
index dc16ca7189878feb5ff8024f155d5cf0f98449fc..d41e2f3260c540b33ad13ad25fd908d17b54798d 100644 (file)
@@ -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);
index cfad369e735040ebf4c9b83df73245d30a589fb6..2f6015acfda81b5233c8ecd01af4e88cc586c79f 100644 (file)
@@ -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 */
 };
 
index 9dc59c3b5afba972a80d6d5107788add16a886f1..c0a1098403b32bdd96cc369cd441f3687ff16a95 100644 (file)
@@ -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;
        }
 
index 02aaa49111217bd48c26308d1f52e73535266dfc..6d8f6d9bbabde343bf041771a6cc5631d110842e 100644 (file)
@@ -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);