From 2e973b2cd4cdb993be94cca4c33f532f1ed05316 Mon Sep 17 00:00:00 2001 From: Dave Chinner Date: Wed, 18 Aug 2021 18:46:52 -0700 Subject: xfs: convert remaining mount flags to state flags The remaining mount flags kept in m_flags are actually runtime state flags. These change dynamically, so they really should be updated atomically so we don't potentially lose an update due to racing modifications. Convert these remaining flags to be stored in m_opstate and use atomic bitops to set and clear the flags. This also adds a couple of simple wrappers for common state checks - read only and shutdown. Signed-off-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- fs/xfs/scrub/common.c | 2 +- fs/xfs/scrub/scrub.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'fs/xfs/scrub') diff --git a/fs/xfs/scrub/common.c b/fs/xfs/scrub/common.c index 26e38b59f445..562e10751296 100644 --- a/fs/xfs/scrub/common.c +++ b/fs/xfs/scrub/common.c @@ -883,7 +883,7 @@ xchk_start_reaping( * Readonly filesystems do not perform inactivation or speculative * preallocation, so there's no need to restart the workers. */ - if (!(sc->mp->m_flags & XFS_MOUNT_RDONLY)) { + if (!xfs_is_readonly(sc->mp)) { xfs_inodegc_start(sc->mp); xfs_blockgc_start(sc->mp); } diff --git a/fs/xfs/scrub/scrub.c b/fs/xfs/scrub/scrub.c index 6b3e7846a707..c0f2f21f246f 100644 --- a/fs/xfs/scrub/scrub.c +++ b/fs/xfs/scrub/scrub.c @@ -419,7 +419,7 @@ xchk_validate_inputs( goto out; error = -EROFS; - if (mp->m_flags & XFS_MOUNT_RDONLY) + if (xfs_is_readonly(mp)) goto out; } -- cgit v1.2.3