]> git.ipfire.org Git - thirdparty/linux.git/commit
btrfs: reduce block group critical section in do_trimming()
authorFilipe Manana <fdmanana@suse.com>
Mon, 20 Oct 2025 12:17:23 +0000 (13:17 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 24 Nov 2025 21:15:09 +0000 (22:15 +0100)
commitc0d0b13d27f8cf9d5bf5adae52df8ec781fbb983
tree524c1d921dc603ecbd29cacac60500ef23dd07af
parenta270cb420c06ae7b52f385e139577209c705e5e0
btrfs: reduce block group critical section in do_trimming()

There's no need to update the bytes_reserved and bytes_readonly fields of
the space_info while holding the block group's spinlock. We are only
making the critical section longer than necessary. So move the space_info
updates outside of the block group's critical section.

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/free-space-cache.c