Commit ed48adf8 authored by Filipe Manana's avatar Filipe Manana Committed by David Sterba

btrfs: simplify add_extent_mapping() by removing pointless label

The add_extent_mapping() function is short and trivial, there's no need to
have a label for a quick exit in case of an error, even because there's no
error handling needed, we just need to return the error. So remove that
label and return directly.

Also while at it remove the redundant initialization of 'ret', as that may
help avoid some warnings with clang tools such as the one reported/fixed
by commit 966de47f ("btrfs: remove redundant initialization of
variables in log_new_ancestors").
Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 071533da
...@@ -370,17 +370,17 @@ static inline void setup_extent_mapping(struct extent_map_tree *tree, ...@@ -370,17 +370,17 @@ static inline void setup_extent_mapping(struct extent_map_tree *tree,
static int add_extent_mapping(struct extent_map_tree *tree, static int add_extent_mapping(struct extent_map_tree *tree,
struct extent_map *em, int modified) struct extent_map *em, int modified)
{ {
int ret = 0; int ret;
lockdep_assert_held_write(&tree->lock); lockdep_assert_held_write(&tree->lock);
ret = tree_insert(&tree->map, em); ret = tree_insert(&tree->map, em);
if (ret) if (ret)
goto out; return ret;
setup_extent_mapping(tree, em, modified); setup_extent_mapping(tree, em, modified);
out:
return ret; return 0;
} }
static struct extent_map * static struct extent_map *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment