diff options
author | Dave Chinner <dchinner@redhat.com> | 2021-08-18 18:46:52 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2021-08-19 10:07:13 -0700 |
commit | 2e973b2cd4cdb993be94cca4c33f532f1ed05316 (patch) | |
tree | b44d08a1f5af0ef6be12f8b178975de8ac5bef92 /fs/xfs/xfs_fsops.c | |
parent | 0560f31a09e523090d1ab2bfe21c69d028c2bdf2 (diff) |
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 <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/xfs_fsops.c')
-rw-r--r-- | fs/xfs/xfs_fsops.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/fs/xfs/xfs_fsops.c b/fs/xfs/xfs_fsops.c index e6df2ce5937d..33e26690a8c4 100644 --- a/fs/xfs/xfs_fsops.c +++ b/fs/xfs/xfs_fsops.c @@ -528,15 +528,10 @@ xfs_do_force_shutdown( int tag; const char *why; - spin_lock(&mp->m_sb_lock); - if (XFS_FORCED_SHUTDOWN(mp)) { - spin_unlock(&mp->m_sb_lock); + if (test_and_set_bit(XFS_OPSTATE_SHUTDOWN, &mp->m_opstate)) return; - } - mp->m_flags |= XFS_MOUNT_FS_SHUTDOWN; if (mp->m_sb_bp) mp->m_sb_bp->b_flags |= XBF_DONE; - spin_unlock(&mp->m_sb_lock); if (flags & SHUTDOWN_FORCE_UMOUNT) xfs_alert(mp, "User initiated shutdown received."); |