xfs: convert log flags to an operational state field
authorDave Chinner <dchinner@redhat.com>
Wed, 11 Aug 2021 00:59:02 +0000 (17:59 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Mon, 16 Aug 2021 19:09:28 +0000 (12:09 -0700)
commite1d06e5f668a403f48538f0d6b163edfd4342adf
tree6cc1a1d760374d1fefbf0c9d37b320558acae63b
parentfd67d8a07208ab06560287b7b9334c2d50b7d6d7
xfs: convert log flags to an operational state field

log->l_flags doesn't actually contain "flags" as such, it contains
operational state information that can change at runtime. For the
shutdown state, this at least should be an atomic bit because
it is read without holding locks in many places and so using atomic
bitops for the state field modifications makes sense.

This allows us to use things like test_and_set_bit() on state
changes (e.g. setting XLOG_TAIL_WARN) to avoid races in setting the
state when we aren't holding locks.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
fs/xfs/xfs_log.c
fs/xfs/xfs_log.h
fs/xfs/xfs_log_priv.h
fs/xfs/xfs_log_recover.c
fs/xfs/xfs_super.c