diff options
author | Filipe Manana <fdmanana@suse.com> | 2020-04-17 17:36:50 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2020-05-25 11:25:24 +0200 |
commit | 534cf531ccf6331b6e63a054f2ceb8e1ccff1ec9 (patch) | |
tree | dadd308b1cbd00c7d4c3cfea27845330a3f4e04b /.clang-format | |
parent | btrfs: remove the redundant parameter level in btrfs_bin_search() (diff) | |
download | linux-534cf531ccf6331b6e63a054f2ceb8e1ccff1ec9.tar.xz linux-534cf531ccf6331b6e63a054f2ceb8e1ccff1ec9.zip |
btrfs: simplify error handling of clean_pinned_extents()
At clean_pinned_extents(), whether we end up returning success or failure,
we pretty much have to do the same things:
1) unlock unused_bg_unpin_mutex
2) decrement reference count on the previous transaction
We also call btrfs_dec_block_group_ro() in case of failure, but that is
better done in its caller, btrfs_delete_unused_bgs(), since its the
caller that calls inc_block_group_ro(), so it should be responsible for
the decrement operation, as it is in case any of the other functions it
calls fail.
So move the call to btrfs_dec_block_group_ro() from clean_pinned_extents()
into btrfs_delete_unused_bgs() and unify the error and success return
paths for clean_pinned_extents(), reducing duplicated code and making it
simpler.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to '.clang-format')
0 files changed, 0 insertions, 0 deletions