summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_mount.h
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2021-08-06 20:05:42 +0200
committerDarrick J. Wong <djwong@kernel.org>2021-08-09 19:52:19 +0200
commit6f6490914d9b712004ddad648e47b1bf22647978 (patch)
tree08c5cfeaa4701b2e4d9efdce14faccb4ffdd5687 /fs/xfs/xfs_mount.h
parentxfs: flush inode inactivation work when compiling usage statistics (diff)
downloadlinux-6f6490914d9b712004ddad648e47b1bf22647978.tar.xz
linux-6f6490914d9b712004ddad648e47b1bf22647978.zip
xfs: don't run speculative preallocation gc when fs is frozen
Now that we have the infrastructure to switch background workers on and off at will, fix the block gc worker code so that we don't actually run the worker when the filesystem is frozen, same as we do for deferred inactivation. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Dave Chinner <dchinner@redhat.com>
Diffstat (limited to 'fs/xfs/xfs_mount.h')
-rw-r--r--fs/xfs/xfs_mount.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h
index fbb18c2f00bd..4b3ce6109e7a 100644
--- a/fs/xfs/xfs_mount.h
+++ b/fs/xfs/xfs_mount.h
@@ -281,6 +281,12 @@ typedef struct xfs_mount {
* processed.
*/
#define XFS_OPSTATE_INODEGC_ENABLED 0
+/*
+ * If set, background speculative prealloc gc worker threads will be scheduled
+ * to process queued blockgc work. If not, inodes retain their preallocations
+ * until explicitly deleted.
+ */
+#define XFS_OPSTATE_BLOCKGC_ENABLED 1
#define __XFS_IS_OPSTATE(name, NAME) \
static inline bool xfs_is_ ## name (struct xfs_mount *mp) \
@@ -297,9 +303,11 @@ static inline bool xfs_set_ ## name (struct xfs_mount *mp) \
}
__XFS_IS_OPSTATE(inodegc_enabled, INODEGC_ENABLED)
+__XFS_IS_OPSTATE(blockgc_enabled, BLOCKGC_ENABLED)
#define XFS_OPSTATE_STRINGS \
- { (1UL << XFS_OPSTATE_INODEGC_ENABLED), "inodegc" }
+ { (1UL << XFS_OPSTATE_INODEGC_ENABLED), "inodegc" }, \
+ { (1UL << XFS_OPSTATE_BLOCKGC_ENABLED), "blockgc" }
/*
* Max and min values for mount-option defined I/O