]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: simplify error handling at btrfs_del_root_ref()
authorFilipe Manana <fdmanana@suse.com>
Mon, 22 Aug 2022 14:47:10 +0000 (15:47 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 26 Sep 2022 10:27:58 +0000 (12:27 +0200)
commita56c48ee6a2bf57878268f4469cb35e2061b6957
tree0518de6c437d336a49b2f07f19f83b270fe8451b
parent82f09a74fc25484ece860a6a984141b568d87814
btrfs: simplify error handling at btrfs_del_root_ref()

At btrfs_del_root_ref() we are using two return variables, named 'ret'
and 'err'. This makes it harder to follow and easier to return the wrong
value in case an error happens - the previous patch in the series, which
has the subject "btrfs: fix silent failure when deleting root
reference", fixed a bug due to confusion created by these two variables.

So change the function to use a single variable for tracking the return
value of the function, using only 'ret', which is consistent with most
of the codebase.

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/root-tree.c