summary refs log tree commit diff
path: root/fs/btrfs/block-group.h
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2022-10-31 20:33:46 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-08-23 17:52:28 +0200
commit29cebf80877ba55ec63c666e6a06f241f62fcfa5 (patch)
tree836adb346c3be56df1a4186f13523a2eba3c51bc /fs/btrfs/block-group.h
parent94cde94169f0770c40cbe7c3f8685c9a61bc4c83 (diff)
downloadlinux-29cebf80877ba55ec63c666e6a06f241f62fcfa5.tar.gz
btrfs: convert btrfs_block_group::seq_zone to runtime flag
[ Upstream commit 961f5b8bf48a463ac5fe5b13143426d79eb41817 ]

In zoned mode the sequential status of zone can be also tracked in the
runtime flags of block group.

Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Stable-dep-of: 0657b20c5a76 ("btrfs: fix use-after-free of new block group that became unused")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/btrfs/block-group.h')
-rw-r--r--fs/btrfs/block-group.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/btrfs/block-group.h b/fs/btrfs/block-group.h
index dcad5e959b92..fb4f4901350b 100644
--- a/fs/btrfs/block-group.h
+++ b/fs/btrfs/block-group.h
@@ -57,6 +57,8 @@ enum btrfs_block_group_flags {
 	BLOCK_GROUP_FLAG_ZONED_DATA_RELOC,
 	/* Does the block group need to be added to the free space tree? */
 	BLOCK_GROUP_FLAG_NEEDS_FREE_SPACE,
+	/* Indicate that the block group is placed on a sequential zone */
+	BLOCK_GROUP_FLAG_SEQUENTIAL_ZONE,
 };
 
 enum btrfs_caching_type {
@@ -206,9 +208,6 @@ struct btrfs_block_group {
 	/* Lock for free space tree operations. */
 	struct mutex free_space_lock;
 
-	/* Flag indicating this block group is placed on a sequential zone */
-	bool seq_zone;
-
 	/*
 	 * Number of extents in this block group used for swap files.
 	 * All accesses protected by the spinlock 'lock'.