]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
btrfs: use single return value variable in btrfs_relocate_block_group()
authorFilipe Manana <fdmanana@suse.com>
Wed, 24 Sep 2025 16:10:27 +0000 (17:10 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 24 Nov 2025 20:37:30 +0000 (21:37 +0100)
commit69e293d28a95ef2652014411038d91867e16e757
treea7ccee99e68ed37814b47c81b0c4c311be272938
parent828ec765f7968c636c4c163c050ad13da959adef
btrfs: use single return value variable in btrfs_relocate_block_group()

We are using 'ret' and 'err' variables to track return values and errors,
which is pattern that is error prone and we had quite some bugs due to
this pattern in the past.

Simplify this and use a single variable, named 'ret', to track errors and
the return value.

Also rename the variable 'rw' to 'bg_is_ro' which is more meaningful name,
and change its type from int to bool.

Reviewed-by: Boris Burkov <boris@bur.io>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Qu Wenruo <wqu@suse.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/relocation.c