[RFC v1 3/4] xfs: Add a new state for shrinking

Nirjhar Roy (IBM)
2026-02-19T06:05:58Z

From: "Nirjhar Roy (IBM)" <nirjhar.roy.lists@gmail.com>

Introduce a new state for shrinking. This will be used in the upcoming
patch that implements online shrinking of realtime XFS.

Suggested-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
---
fs/xfs/xfs_mount.h | 3 +++
1 file changed, 3 insertions(+)

diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index b871dfde372b..206a4738eab3 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -577,6 +577,8 @@ __XFS_HAS_FEAT(nouuid, NOUUID)
#define XFS_OPSTATE_WARNED_ZONED 19
/* (Zoned) GC is in progress */
#define XFS_OPSTATE_ZONEGC_RUNNING 20
+/* filesystem is shrinking */
+#define XFS_OPSTATE_SHRINKING 21

#define __XFS_IS_OPSTATE(name, NAME) \
static inline bool xfs_is_ ## name (struct xfs_mount *mp) \
@@ -599,6 +601,7 @@ __XFS_IS_OPSTATE(inode32, INODE32)
__XFS_IS_OPSTATE(readonly, READONLY)
__XFS_IS_OPSTATE(inodegc_enabled, INODEGC_ENABLED)
__XFS_IS_OPSTATE(blockgc_enabled, BLOCKGC_ENABLED)
+__XFS_IS_OPSTATE(shrinking, SHRINKING)
#ifdef CONFIG_XFS_QUOTA
__XFS_IS_OPSTATE(quotacheck_running, QUOTACHECK_RUNNING)
__XFS_IS_OPSTATE(resuming_quotaon, RESUMING_QUOTAON)
--
2.43.5