]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: replace XFS_FORCED_SHUTDOWN with xfs_is_shutdown
authorDave Chinner <dchinner@redhat.com>
Mon, 31 Jan 2022 22:27:19 +0000 (17:27 -0500)
committerEric Sandeen <sandeen@redhat.com>
Mon, 31 Jan 2022 22:27:19 +0000 (17:27 -0500)
Source kernel commit: 75c8c50fa16a23f8ac89ea74834ae8ddd1558d75

Remove the shouty macro and instead use the inline function that
matches other state/feature check wrapper naming. This conversion
was done with sed.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
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_mount.h
libxfs/libxfs_priv.h
libxfs/xfs_alloc.c
libxfs/xfs_attr.c
libxfs/xfs_bmap.c
libxfs/xfs_btree.c
libxfs/xfs_ialloc.c

index 67d03e77750ed55ff32ed1db74edfa6bd3e10318..5403c7eeedbb4abbe05e03da66ee5e06744f453f 100644 (file)
@@ -242,6 +242,7 @@ static inline bool xfs_is_ ## name (struct xfs_mount *mp) \
        return false; \
 }
 __XFS_UNSUPP_OPSTATE(readonly)
+__XFS_UNSUPP_OPSTATE(shutdown)
 
 #define LIBXFS_MOUNT_DEBUGGER          0x0001
 #define LIBXFS_MOUNT_32BITINODES       0x0002
index 0214919c61f2606d9a5693eb4145767130601473..fd15ed7824f5ee17e25a0428bb47d010a13dd809 100644 (file)
@@ -161,7 +161,6 @@ enum ce { CE_DEBUG, CE_CONT, CE_NOTE, CE_WARN, CE_ALERT, CE_PANIC };
        (unlikely(expr) ? XFS_WARN_CORRUPT((mp), (expr)) : false)
 
 #define XFS_ERRLEVEL_LOW               1
-#define XFS_FORCED_SHUTDOWN(mp)                0
 #define XFS_ILOCK_EXCL                 0
 #define XFS_STATS_INC(mp, count)       do { (mp) = (mp); } while (0)
 #define XFS_STATS_DEC(mp, count, x)    do { (mp) = (mp); } while (0)
index 163c726f2d93fac59e54e99951ab72ab95b404b5..c615974303650ddfdec6d736a9d74af3a64f0000 100644 (file)
@@ -3075,7 +3075,7 @@ xfs_alloc_read_agf(
                        atomic64_add(allocbt_blks, &mp->m_allocbt_blks);
        }
 #ifdef DEBUG
-       else if (!XFS_FORCED_SHUTDOWN(mp)) {
+       else if (!xfs_is_shutdown(mp)) {
                ASSERT(pag->pagf_freeblks == be32_to_cpu(agf->agf_freeblks));
                ASSERT(pag->pagf_btreeblks == be32_to_cpu(agf->agf_btreeblks));
                ASSERT(pag->pagf_flcount == be32_to_cpu(agf->agf_flcount));
index 3a712e36399474713dfc95b7ce7f511f2b6bc80a..00f3ecb58742de29dcc8a31e4f13a7bae5998a5d 100644 (file)
@@ -146,7 +146,7 @@ xfs_attr_get(
 
        XFS_STATS_INC(args->dp->i_mount, xs_attr_get);
 
-       if (XFS_FORCED_SHUTDOWN(args->dp->i_mount))
+       if (xfs_is_shutdown(args->dp->i_mount))
                return -EIO;
 
        args->geo = args->dp->i_mount->m_attr_geo;
@@ -710,7 +710,7 @@ xfs_attr_set(
        int                     rmt_blks = 0;
        unsigned int            total;
 
-       if (XFS_FORCED_SHUTDOWN(dp->i_mount))
+       if (xfs_is_shutdown(dp->i_mount))
                return -EIO;
 
        error = xfs_qm_dqattach(dp);
index bea9340ae82e98a15c6cfd465a5bbf805d63662d..1735717c6a00ab76a43be89208f6f8df59182317 100644 (file)
@@ -3931,7 +3931,7 @@ xfs_bmapi_read(
            XFS_TEST_ERROR(false, mp, XFS_ERRTAG_BMAPIFORMAT))
                return -EFSCORRUPTED;
 
-       if (XFS_FORCED_SHUTDOWN(mp))
+       if (xfs_is_shutdown(mp))
                return -EIO;
 
        XFS_STATS_INC(mp, xs_blk_mapr);
@@ -4413,7 +4413,7 @@ xfs_bmapi_write(
                return -EFSCORRUPTED;
        }
 
-       if (XFS_FORCED_SHUTDOWN(mp))
+       if (xfs_is_shutdown(mp))
                return -EIO;
 
        XFS_STATS_INC(mp, xs_blk_mapw);
@@ -4696,7 +4696,7 @@ xfs_bmapi_remap(
                return -EFSCORRUPTED;
        }
 
-       if (XFS_FORCED_SHUTDOWN(mp))
+       if (xfs_is_shutdown(mp))
                return -EIO;
 
        error = xfs_iread_extents(tp, ip, whichfork);
@@ -5354,7 +5354,7 @@ __xfs_bunmapi(
        ifp = XFS_IFORK_PTR(ip, whichfork);
        if (XFS_IS_CORRUPT(mp, !xfs_ifork_has_extents(ifp)))
                return -EFSCORRUPTED;
-       if (XFS_FORCED_SHUTDOWN(mp))
+       if (xfs_is_shutdown(mp))
                return -EIO;
 
        ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
@@ -5845,7 +5845,7 @@ xfs_bmap_collapse_extents(
                return -EFSCORRUPTED;
        }
 
-       if (XFS_FORCED_SHUTDOWN(mp))
+       if (xfs_is_shutdown(mp))
                return -EIO;
 
        ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL));
@@ -5923,7 +5923,7 @@ xfs_bmap_can_insert_extents(
 
        ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL));
 
-       if (XFS_FORCED_SHUTDOWN(ip->i_mount))
+       if (xfs_is_shutdown(ip->i_mount))
                return -EIO;
 
        xfs_ilock(ip, XFS_ILOCK_EXCL);
@@ -5960,7 +5960,7 @@ xfs_bmap_insert_extents(
                return -EFSCORRUPTED;
        }
 
-       if (XFS_FORCED_SHUTDOWN(mp))
+       if (xfs_is_shutdown(mp))
                return -EIO;
 
        ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL | XFS_ILOCK_EXCL));
@@ -6063,7 +6063,7 @@ xfs_bmap_split_extent(
                return -EFSCORRUPTED;
        }
 
-       if (XFS_FORCED_SHUTDOWN(mp))
+       if (xfs_is_shutdown(mp))
                return -EIO;
 
        /* Read in all the extents */
index 817d6123501d0e033bc9f71ba80ec5ef346b9b14..cfa36d5d837399c2ee373a7594253ff794bc6a1f 100644 (file)
@@ -371,7 +371,7 @@ xfs_btree_del_cursor(
        }
 
        ASSERT(cur->bc_btnum != XFS_BTNUM_BMAP || cur->bc_ino.allocated == 0 ||
-              XFS_FORCED_SHUTDOWN(cur->bc_mp));
+              xfs_is_shutdown(cur->bc_mp));
        if (unlikely(cur->bc_flags & XFS_BTREE_STAGING))
                kmem_free(cur->bc_ops);
        if (!(cur->bc_flags & XFS_BTREE_LONG_PTRS) && cur->bc_ag.pag)
index 4075ff5ad242151030a62a2b5340b0ef09affc0e..7ba6b5e9f07291c726e6052aecfffd1f5a45a8a0 100644 (file)
@@ -236,7 +236,7 @@ xfs_check_agi_freecount(
                        }
                } while (i == 1);
 
-               if (!XFS_FORCED_SHUTDOWN(cur->bc_mp))
+               if (!xfs_is_shutdown(cur->bc_mp))
                        ASSERT(freecount == cur->bc_ag.pag->pagi_freecount);
        }
        return 0;
@@ -1779,7 +1779,7 @@ xfs_dialloc(
                                break;
                }
 
-               if (XFS_FORCED_SHUTDOWN(mp)) {
+               if (xfs_is_shutdown(mp)) {
                        error = -EFSCORRUPTED;
                        break;
                }
@@ -2619,7 +2619,7 @@ xfs_ialloc_read_agi(
         * we are in the middle of a forced shutdown.
         */
        ASSERT(pag->pagi_freecount == be32_to_cpu(agi->agi_freecount) ||
-               XFS_FORCED_SHUTDOWN(mp));
+               xfs_is_shutdown(mp));
        return 0;
 }