[PATCH 27/43] xfs: replace XFS_FORCED_SHUTDOWN with xfs_is_shutdown
From: "Darrick J. Wong" <djwong@kernel.org>
Date: 2021-09-14 02:42:36
Subsystem:
the rest · Maintainer:
Linus Torvalds
From: Dave Chinner <redacted> 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 <redacted> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Darrick J. Wong <djwong@kernel.org> --- include/xfs_mount.h | 1 + libxfs/libxfs_priv.h | 1 - libxfs/xfs_alloc.c | 2 +- libxfs/xfs_attr.c | 4 ++-- libxfs/xfs_bmap.c | 16 ++++++++-------- libxfs/xfs_btree.c | 2 +- libxfs/xfs_ialloc.c | 6 +++--- 7 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/include/xfs_mount.h b/include/xfs_mount.h
index 0f7b9787..29d0440e 100644
--- a/include/xfs_mount.h
+++ b/include/xfs_mount.h@@ -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
diff --git a/libxfs/libxfs_priv.h b/libxfs/libxfs_priv.h
index 07fc2942..3e5ff2a8 100644
--- a/libxfs/libxfs_priv.h
+++ b/libxfs/libxfs_priv.h@@ -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)
diff --git a/libxfs/xfs_alloc.c b/libxfs/xfs_alloc.c
index 163c726f..c6159743 100644
--- a/libxfs/xfs_alloc.c
+++ b/libxfs/xfs_alloc.c@@ -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));
diff --git a/libxfs/xfs_attr.c b/libxfs/xfs_attr.c
index 3a712e36..00f3ecb5 100644
--- a/libxfs/xfs_attr.c
+++ b/libxfs/xfs_attr.c@@ -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);
diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c
index bea9340a..1735717c 100644
--- a/libxfs/xfs_bmap.c
+++ b/libxfs/xfs_bmap.c@@ -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 */
diff --git a/libxfs/xfs_btree.c b/libxfs/xfs_btree.c
index 79be19ec..da3895a6 100644
--- a/libxfs/xfs_btree.c
+++ b/libxfs/xfs_btree.c@@ -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)
diff --git a/libxfs/xfs_ialloc.c b/libxfs/xfs_ialloc.c
index 4075ff5a..7ba6b5e9 100644
--- a/libxfs/xfs_ialloc.c
+++ b/libxfs/xfs_ialloc.c@@ -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; }