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

In preparation of removing the historic icinode struct, move the flags
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_bmap_btree.c
libxfs/xfs_inode_buf.c
libxfs/xfs_inode_buf.h
libxfs/xfs_rtbitmap.c
mkfs/proto.c
repair/phase6.c

index ef9700677f1a3c5ab043b37f6af32295bcef30ea..7df3c76927ca77389dc87c2d7fbd6cb9c32866e7 100644 (file)
@@ -88,6 +88,7 @@ typedef struct xfs_inode {
                uint16_t        i_flushiter;    /* incremented on flush */
        };
        uint8_t                 i_forkoff;      /* attr fork offset >> 3 */
+       uint16_t                i_diflags;      /* XFS_DIFLAG_... */
        struct xfs_icdinode     i_d;            /* most of ondisk inode */
 
        xfs_extnum_t            i_cnextents;    /* # of extents in cow fork */
@@ -139,7 +140,7 @@ static inline xfs_fsize_t XFS_ISIZE(struct xfs_inode *ip)
                return ip->i_size;
        return ip->i_disk_size;
 }
-#define XFS_IS_REALTIME_INODE(ip) ((ip)->i_d.di_flags & XFS_DIFLAG_REALTIME)
+#define XFS_IS_REALTIME_INODE(ip) ((ip)->i_diflags & XFS_DIFLAG_REALTIME)
 
 /* inode link counts */
 static inline void set_nlink(struct inode *inode, uint32_t nlink)
index 1546541cf290cc8a2698cc90f392acfab7638c91..f853a32f1cb0cc0de0d02e5446474957586d5a4c 100644 (file)
@@ -156,7 +156,7 @@ xfs_flags2diflags(
 {
        /* can't set PREALLOC this way, just preserve it */
        uint16_t                di_flags =
-               (ip->i_d.di_flags & XFS_DIFLAG_PREALLOC);
+               (ip->i_diflags & XFS_DIFLAG_PREALLOC);
 
        if (xflags & FS_XFLAG_IMMUTABLE)
                di_flags |= XFS_DIFLAG_IMMUTABLE;
@@ -218,24 +218,24 @@ xfs_inode_propagate_flags(
        umode_t                 mode = VFS_I(ip)->i_mode;
 
        if ((mode & S_IFMT) == S_IFDIR) {
-               if (pip->i_d.di_flags & XFS_DIFLAG_RTINHERIT)
+               if (pip->i_diflags & XFS_DIFLAG_RTINHERIT)
                        di_flags |= XFS_DIFLAG_RTINHERIT;
-               if (pip->i_d.di_flags & XFS_DIFLAG_EXTSZINHERIT) {
+               if (pip->i_diflags & XFS_DIFLAG_EXTSZINHERIT) {
                        di_flags |= XFS_DIFLAG_EXTSZINHERIT;
                        ip->i_extsize = pip->i_extsize;
                }
        } else {
-               if ((pip->i_d.di_flags & XFS_DIFLAG_RTINHERIT) &&
+               if ((pip->i_diflags & XFS_DIFLAG_RTINHERIT) &&
                    xfs_sb_version_hasrealtime(&ip->i_mount->m_sb))
                        di_flags |= XFS_DIFLAG_REALTIME;
-               if (pip->i_d.di_flags & XFS_DIFLAG_EXTSZINHERIT) {
+               if (pip->i_diflags & XFS_DIFLAG_EXTSZINHERIT) {
                        di_flags |= XFS_DIFLAG_EXTSIZE;
                        ip->i_extsize = pip->i_extsize;
                }
        }
-       if (pip->i_d.di_flags & XFS_DIFLAG_PROJINHERIT)
+       if (pip->i_diflags & XFS_DIFLAG_PROJINHERIT)
                di_flags |= XFS_DIFLAG_PROJINHERIT;
-       ip->i_d.di_flags |= di_flags;
+       ip->i_diflags |= di_flags;
 }
 
 /*
@@ -280,7 +280,7 @@ libxfs_init_new_inode(
        ip->i_df.if_nextents = 0;
        ASSERT(ip->i_nblocks == 0);
        ip->i_extsize = pip ? 0 : fsx->fsx_extsize;
-       ip->i_d.di_flags = pip ? 0 : xfs_flags2diflags(ip, fsx->fsx_xflags);
+       ip->i_diflags = pip ? 0 : xfs_flags2diflags(ip, fsx->fsx_xflags);
 
        if (xfs_sb_version_has_v3inode(&ip->i_mount->m_sb)) {
                ASSERT(ip->i_d.di_ino == ino);
@@ -307,7 +307,7 @@ libxfs_init_new_inode(
                break;
        case S_IFREG:
        case S_IFDIR:
-               if (pip && (pip->i_d.di_flags & XFS_DIFLAG_ANY))
+               if (pip && (pip->i_diflags & XFS_DIFLAG_ANY))
                        xfs_inode_propagate_flags(ip, pip);
                /* FALLTHROUGH */
        case S_IFLNK:
index 232e58762261a445183afc273af932871e930e1c..4c456df94b2786d86ecc2e4eefaff7bfee7f248b 100644 (file)
@@ -181,7 +181,7 @@ xfs_bmbt_update_cursor(
        struct xfs_btree_cur    *dst)
 {
        ASSERT((dst->bc_tp->t_firstblock != NULLFSBLOCK) ||
-              (dst->bc_ino.ip->i_d.di_flags & XFS_DIFLAG_REALTIME));
+              (dst->bc_ino.ip->i_diflags & XFS_DIFLAG_REALTIME));
 
        dst->bc_ino.allocated += src->bc_ino.allocated;
        dst->bc_tp->t_firstblock = src->bc_tp->t_firstblock;
index 51f3ccf0c41847a2cf8615d8b20092cbfe27181c..dc16ca7189878feb5ff8024f155d5cf0f98449fc 100644 (file)
@@ -228,7 +228,7 @@ xfs_inode_from_disk(
        ip->i_nblocks = be64_to_cpu(from->di_nblocks);
        ip->i_extsize = be32_to_cpu(from->di_extsize);
        ip->i_forkoff = from->di_forkoff;
-       to->di_flags    = be16_to_cpu(from->di_flags);
+       ip->i_diflags   = be16_to_cpu(from->di_flags);
 
        if (from->di_dmevmask || from->di_dmstate)
                xfs_iflags_set(ip, XFS_IPRESERVE_DM_FIELDS);
@@ -310,7 +310,7 @@ xfs_inode_to_disk(
        to->di_anextents = cpu_to_be16(xfs_ifork_nextents(ip->i_afp));
        to->di_forkoff = ip->i_forkoff;
        to->di_aformat = xfs_ifork_format(ip->i_afp);
-       to->di_flags = cpu_to_be16(from->di_flags);
+       to->di_flags = cpu_to_be16(ip->i_diflags);
 
        if (xfs_sb_version_has_v3inode(&ip->i_mount->m_sb)) {
                to->di_version = 3;
index 39f4ad4419fe418b7b0fda5fdf0bbdb5fd86a315..cfad369e735040ebf4c9b83df73245d30a589fb6 100644 (file)
@@ -16,8 +16,6 @@ struct xfs_dinode;
  * format specific structures at the appropriate time.
  */
 struct xfs_icdinode {
-       uint16_t        di_flags;       /* random flags, XFS_DIFLAG_... */
-
        uint64_t        di_flags2;      /* more random flags */
 
        struct timespec64 di_crtime;    /* time created */
index db3e2449fd379957e0a1cf61152e3be2d5dbb4a1..f08efb7c38899d0b50dc272e27d484019777bcd6 100644 (file)
@@ -995,8 +995,8 @@ xfs_rtfree_extent(
         */
        if (tp->t_frextents_delta + mp->m_sb.sb_frextents ==
            mp->m_sb.sb_rextents) {
-               if (!(mp->m_rbmip->i_d.di_flags & XFS_DIFLAG_NEWRTBM))
-                       mp->m_rbmip->i_d.di_flags |= XFS_DIFLAG_NEWRTBM;
+               if (!(mp->m_rbmip->i_diflags & XFS_DIFLAG_NEWRTBM))
+                       mp->m_rbmip->i_diflags |= XFS_DIFLAG_NEWRTBM;
                *(uint64_t *)&VFS_I(mp->m_rbmip)->i_atime = 0;
                xfs_trans_log_inode(tp, mp->m_rbmip, XFS_ILOG_CORE);
        }
index d9f84cb9342a8d193db2df235ea095224dbfc392..6b22cc6a9d09925aa512a1dc74bde01398986b29 100644 (file)
@@ -208,7 +208,7 @@ rsvfile(
 
        libxfs_trans_ichgtime(tp, ip, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
 
-       ip->i_d.di_flags |= XFS_DIFLAG_PREALLOC;
+       ip->i_diflags |= XFS_DIFLAG_PREALLOC;
 
        libxfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
        error = -libxfs_trans_commit(tp);
@@ -652,7 +652,7 @@ rtinit(
         */
        mp->m_sb.sb_rbmino = rbmip->i_ino;
        rbmip->i_disk_size = mp->m_sb.sb_rbmblocks * mp->m_sb.sb_blocksize;
-       rbmip->i_d.di_flags = XFS_DIFLAG_NEWRTBM;
+       rbmip->i_diflags = XFS_DIFLAG_NEWRTBM;
        *(uint64_t *)&VFS_I(rbmip)->i_atime = 0;
        libxfs_trans_log_inode(tp, rbmip, XFS_ILOG_CORE);
        libxfs_log_sb(tp);
index be77fa020c08804943ecdbc5d1feb1502836f7e6..02aaa49111217bd48c26308d1f52e73535266dfc 100644 (file)
@@ -448,6 +448,7 @@ reset_inode_fields(struct xfs_inode *ip)
        ip->i_cowextsize = 0;
        ip->i_flushiter = 0;
        ip->i_forkoff = 0;
+       ip->i_diflags = 0;
 }
 
 static void