aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ordered-data.c
diff options
context:
space:
mode:
authorFilipe Manana <[email protected]>2025-06-07 18:55:41 +0000
committerDavid Sterba <[email protected]>2025-07-21 21:58:01 +0000
commitbdd01fb0364725081d6e938b8b3e647ee48e97eb (patch)
treed7aa74cf78e4d4738e3d735a05646371612eed77 /fs/btrfs/ordered-data.c
parentbtrfs: always abort transaction on failure to add block group to free space tree (diff)
downloadkernel-bdd01fb0364725081d6e938b8b3e647ee48e97eb.tar.gz
kernel-bdd01fb0364725081d6e938b8b3e647ee48e97eb.zip
btrfs: check BLOCK_GROUP_FLAG_NEEDS_FREE_SPACE at __add_block_group_free_space()
Every caller of __add_block_group_free_space() is checking if the flag BLOCK_GROUP_FLAG_NEEDS_FREE_SPACE is set before calling it. This is duplicate code and it's prone to some mistake in case we add more callers in the future. So move the check for that flag into the start of __add_block_group_free_space(), and, as a consequence, the path allocation from add_block_group_free_space() is moved into __add_block_group_free_space(), to preserve the behaviour of allocating a path only if the flag BLOCK_GROUP_FLAG_NEEDS_FREE_SPACE is set. Reviewed-by: Boris Burkov <[email protected]> Signed-off-by: Filipe Manana <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'fs/btrfs/ordered-data.c')
0 files changed, 0 insertions, 0 deletions