]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: remove XFS_IFINLINE
authorChristoph Hellwig <hch@lst.de>
Wed, 30 Jun 2021 22:38:58 +0000 (18:38 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Wed, 30 Jun 2021 22:38:58 +0000 (18:38 -0400)
Source kernel commit: 0779f4a68d4df539a7ea624f7e1560f48aa46ad9

Just check for an inline format fork instead of the using the equivalent
in-memory XFS_IFINLINE flag.

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>
libxfs/xfs_attr.c
libxfs/xfs_attr_leaf.c
libxfs/xfs_bmap.c
libxfs/xfs_dir2_block.c
libxfs/xfs_dir2_sf.c
libxfs/xfs_inode_fork.c
libxfs/xfs_inode_fork.h

index 40384e99593354e8ca210d3fcd58e909cdca0b12..dce7ded5cb1ed769f83716b12a3285c7250c0fe9 100644 (file)
@@ -362,10 +362,8 @@ xfs_has_attr(
        if (!xfs_inode_hasattr(dp))
                return -ENOATTR;
 
-       if (dp->i_afp->if_format == XFS_DINODE_FMT_LOCAL) {
-               ASSERT(dp->i_afp->if_flags & XFS_IFINLINE);
+       if (dp->i_afp->if_format == XFS_DINODE_FMT_LOCAL)
                return xfs_attr_sf_findname(args, NULL, NULL);
-       }
 
        if (xfs_attr_is_leaf(dp)) {
                error = xfs_attr_leaf_hasname(args, &bp);
@@ -389,10 +387,8 @@ xfs_attr_remove_args(
        if (!xfs_inode_hasattr(args->dp))
                return -ENOATTR;
 
-       if (args->dp->i_afp->if_format == XFS_DINODE_FMT_LOCAL) {
-               ASSERT(args->dp->i_afp->if_flags & XFS_IFINLINE);
+       if (args->dp->i_afp->if_format == XFS_DINODE_FMT_LOCAL)
                return xfs_attr_shortform_remove(args);
-       }
        if (xfs_attr_is_leaf(args->dp))
                return xfs_attr_leaf_removename(args);
        return xfs_attr_node_removename(args);
index e3fa63d6786be6bb011a754ca966790aa668d86d..bb8833c5298cdfe5422cd924b7e8a1faa6101d93 100644 (file)
@@ -651,9 +651,6 @@ xfs_attr_shortform_create(
        if (ifp->if_format == XFS_DINODE_FMT_EXTENTS) {
                ifp->if_flags &= ~XFS_IFEXTENTS;        /* just in case */
                ifp->if_format = XFS_DINODE_FMT_LOCAL;
-               ifp->if_flags |= XFS_IFINLINE;
-       } else {
-               ASSERT(ifp->if_flags & XFS_IFINLINE);
        }
        xfs_idata_realloc(dp, sizeof(*hdr), XFS_ATTR_FORK);
        hdr = (struct xfs_attr_sf_hdr *)ifp->if_u1.if_data;
@@ -730,7 +727,7 @@ xfs_attr_shortform_add(
        dp->i_forkoff = forkoff;
 
        ifp = dp->i_afp;
-       ASSERT(ifp->if_flags & XFS_IFINLINE);
+       ASSERT(ifp->if_format == XFS_DINODE_FMT_LOCAL);
        sf = (struct xfs_attr_shortform *)ifp->if_u1.if_data;
        if (xfs_attr_sf_findname(args, &sfe, NULL) == -EEXIST)
                ASSERT(0);
@@ -848,7 +845,7 @@ xfs_attr_shortform_lookup(xfs_da_args_t *args)
        trace_xfs_attr_sf_lookup(args);
 
        ifp = args->dp->i_afp;
-       ASSERT(ifp->if_flags & XFS_IFINLINE);
+       ASSERT(ifp->if_format == XFS_DINODE_FMT_LOCAL);
        sf = (struct xfs_attr_shortform *)ifp->if_u1.if_data;
        sfe = &sf->list[0];
        for (i = 0; i < sf->hdr.count;
@@ -875,7 +872,7 @@ xfs_attr_shortform_getvalue(
        struct xfs_attr_sf_entry *sfe;
        int                     i;
 
-       ASSERT(args->dp->i_afp->if_flags == XFS_IFINLINE);
+       ASSERT(args->dp->i_afp->if_format == XFS_DINODE_FMT_LOCAL);
        sf = (struct xfs_attr_shortform *)args->dp->i_afp->if_u1.if_data;
        sfe = &sf->list[0];
        for (i = 0; i < sf->hdr.count;
index 15137cf0dca49284484f1702724450f0dab29490..9dbfdca8f3a59f138684605a12fd1758c56266a6 100644 (file)
@@ -798,7 +798,6 @@ xfs_bmap_local_to_extents_empty(
        ASSERT(ifp->if_nextents == 0);
 
        xfs_bmap_forkoff_reset(ip, whichfork);
-       ifp->if_flags &= ~XFS_IFINLINE;
        ifp->if_flags |= XFS_IFEXTENTS;
        ifp->if_u1.if_root = NULL;
        ifp->if_height = 0;
@@ -843,7 +842,7 @@ xfs_bmap_local_to_extents(
 
        flags = 0;
        error = 0;
-       ASSERT((ifp->if_flags & (XFS_IFINLINE|XFS_IFEXTENTS)) == XFS_IFINLINE);
+       ASSERT(!(ifp->if_flags & XFS_IFEXTENTS));
        memset(&args, 0, sizeof(args));
        args.tp = tp;
        args.mp = ip->i_mount;
index c5f8dbc1c6c7707a4b69b7e558f60b04d70a4fa2..522f0ffcfb84bed029741ae235f6dc3716014123 100644 (file)
@@ -1093,7 +1093,7 @@ xfs_dir2_sf_to_block(
 
        trace_xfs_dir2_sf_to_block(args);
 
-       ASSERT(ifp->if_flags & XFS_IFINLINE);
+       ASSERT(ifp->if_format == XFS_DINODE_FMT_LOCAL);
        ASSERT(dp->i_disk_size >= offsetof(struct xfs_dir2_sf_hdr, parent));
 
        oldsfp = (xfs_dir2_sf_hdr_t *)ifp->if_u1.if_data;
index 5d905ad478c707abc5b8ea1e8171af6db8f1dde7..4c0093b25c2545de6fff6ac1af89d6b6fd4592f6 100644 (file)
@@ -378,7 +378,7 @@ xfs_dir2_sf_addname(
 
        ASSERT(xfs_dir2_sf_lookup(args) == -ENOENT);
        dp = args->dp;
-       ASSERT(dp->i_df.if_flags & XFS_IFINLINE);
+       ASSERT(dp->i_df.if_format == XFS_DINODE_FMT_LOCAL);
        ASSERT(dp->i_disk_size >= offsetof(struct xfs_dir2_sf_hdr, parent));
        ASSERT(dp->i_df.if_bytes == dp->i_disk_size);
        ASSERT(dp->i_df.if_u1.if_data != NULL);
@@ -830,9 +830,8 @@ xfs_dir2_sf_create(
                dp->i_df.if_flags &= ~XFS_IFEXTENTS;    /* just in case */
                dp->i_df.if_format = XFS_DINODE_FMT_LOCAL;
                xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE);
-               dp->i_df.if_flags |= XFS_IFINLINE;
        }
-       ASSERT(dp->i_df.if_flags & XFS_IFINLINE);
+       ASSERT(dp->i_df.if_format == XFS_DINODE_FMT_LOCAL);
        ASSERT(dp->i_df.if_bytes == 0);
        i8count = pino > XFS_DIR2_MAX_SHORT_INUM;
        size = xfs_dir2_sf_hdr_size(i8count);
@@ -877,7 +876,7 @@ xfs_dir2_sf_lookup(
 
        xfs_dir2_sf_check(args);
 
-       ASSERT(dp->i_df.if_flags & XFS_IFINLINE);
+       ASSERT(dp->i_df.if_format == XFS_DINODE_FMT_LOCAL);
        ASSERT(dp->i_disk_size >= offsetof(struct xfs_dir2_sf_hdr, parent));
        ASSERT(dp->i_df.if_bytes == dp->i_disk_size);
        ASSERT(dp->i_df.if_u1.if_data != NULL);
@@ -954,7 +953,7 @@ xfs_dir2_sf_removename(
 
        trace_xfs_dir2_sf_removename(args);
 
-       ASSERT(dp->i_df.if_flags & XFS_IFINLINE);
+       ASSERT(dp->i_df.if_format == XFS_DINODE_FMT_LOCAL);
        oldsize = (int)dp->i_disk_size;
        ASSERT(oldsize >= offsetof(struct xfs_dir2_sf_hdr, parent));
        ASSERT(dp->i_df.if_bytes == oldsize);
@@ -1053,7 +1052,7 @@ xfs_dir2_sf_replace(
 
        trace_xfs_dir2_sf_replace(args);
 
-       ASSERT(dp->i_df.if_flags & XFS_IFINLINE);
+       ASSERT(dp->i_df.if_format == XFS_DINODE_FMT_LOCAL);
        ASSERT(dp->i_disk_size >= offsetof(struct xfs_dir2_sf_hdr, parent));
        ASSERT(dp->i_df.if_bytes == dp->i_disk_size);
        ASSERT(dp->i_df.if_u1.if_data != NULL);
index dd863f25cc192d605adda0baf60604f1e5fc21fe..f39ac7db80cd67ed8f9be8285f636c1568edf945 100644 (file)
@@ -59,7 +59,6 @@ xfs_init_local_fork(
 
        ifp->if_bytes = size;
        ifp->if_flags &= ~XFS_IFEXTENTS;
-       ifp->if_flags |= XFS_IFINLINE;
 }
 
 /*
index 8ffaa7cc1f7c3f246daf29871515bdcd229e102a..ac8b2182ce8c57b8d3f458e0c7201610c2d1efbd 100644 (file)
@@ -30,7 +30,6 @@ struct xfs_ifork {
 /*
  * Per-fork incore inode flags.
  */
-#define        XFS_IFINLINE    0x01    /* Inline data is read in */
 #define        XFS_IFEXTENTS   0x02    /* All extent pointers are read in */
 
 /*