]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
btrfs: reduce block group critical section in btrfs_free_reserved_bytes()
authorFilipe Manana <fdmanana@suse.com>
Mon, 20 Oct 2025 11:47:26 +0000 (12:47 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 24 Nov 2025 21:14:06 +0000 (22:14 +0100)
commit8b6fa164ab59f9e3f24e627fe09a0234783e7a8b
tree04d1cf84be8b3946d34617da29a1222df4402192
parentf7a32dd2a616c333cff2d6fb7e3d854ec8d3ae41
btrfs: reduce block group critical section in btrfs_free_reserved_bytes()

There's no need to update the space_info fields (bytes_reserved,
max_extent_size, bytes_readonly, bytes_zone_unusable) while holding the
block group's spinlock. So move those updates to happen after we unlock
the block group (and while holding the space_info locked of course), so
that all we do under the block group's critical section is to update the
block group itself.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/block-group.c