]> www.infradead.org Git - users/jedix/linux-maple.git/commit
btrfs: tweak extent/chunk allocation for space_info sub-space
authorNaohiro Aota <naohiro.aota@wdc.com>
Wed, 23 Apr 2025 02:43:50 +0000 (11:43 +0900)
committerDavid Sterba <dsterba@suse.com>
Thu, 15 May 2025 12:30:53 +0000 (14:30 +0200)
commitcc0517fe779f2186545ac9c6a3439809b98b24f1
tree2f4a7a5829c19b3c011209c897a172274f7d8fb5
parent9a3023b8289b49abaddf668079c74e7d0cf42ca1
btrfs: tweak extent/chunk allocation for space_info sub-space

Make the extent allocator and the chunk allocator aware of the sub-space.
It now uses BTRFS_SUB_GROUP_DATA_RELOC sub-space for data relocation block
group, and uses BTRFS_SUB_GROUP_TREELOG for metadata tree-log block group.

And, it needs to check the space_info is the right one when a block group
candidate is given. Also, new block group should now belong to the
specified one.

Now that, block_group->space_info is always set before
btrfs_add_bg_to_space_info(), we no longer need to "find" the space_info.
So, rename the variable name to address that as well.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/block-group.c
fs/btrfs/extent-tree.c
fs/btrfs/space-info.c