Skip to content

Commit acde0e8

Browse files
asjkdave
authored andcommitted
btrfs: reuse ret instead of err in relocate_tree_blocks()
Coding style fixes the function relocate_tree_blocks(). After the fix, ret is the return value variable. Signed-off-by: Anand Jain <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 2daca1e commit acde0e8

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

fs/btrfs/relocation.c

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2742,12 +2742,11 @@ int relocate_tree_blocks(struct btrfs_trans_handle *trans,
27422742
struct btrfs_path *path;
27432743
struct tree_block *block;
27442744
struct tree_block *next;
2745-
int ret;
2746-
int err = 0;
2745+
int ret = 0;
27472746

27482747
path = btrfs_alloc_path();
27492748
if (!path) {
2750-
err = -ENOMEM;
2749+
ret = -ENOMEM;
27512750
goto out_free_blocks;
27522751
}
27532752

@@ -2762,8 +2761,8 @@ int relocate_tree_blocks(struct btrfs_trans_handle *trans,
27622761
/* Get first keys */
27632762
rbtree_postorder_for_each_entry_safe(block, next, blocks, rb_node) {
27642763
if (!block->key_ready) {
2765-
err = get_tree_block_key(fs_info, block);
2766-
if (err)
2764+
ret = get_tree_block_key(fs_info, block);
2765+
if (ret)
27672766
goto out_free_path;
27682767
}
27692768
}
@@ -2773,25 +2772,23 @@ int relocate_tree_blocks(struct btrfs_trans_handle *trans,
27732772
node = build_backref_tree(trans, rc, &block->key,
27742773
block->level, block->bytenr);
27752774
if (IS_ERR(node)) {
2776-
err = PTR_ERR(node);
2775+
ret = PTR_ERR(node);
27772776
goto out;
27782777
}
27792778

27802779
ret = relocate_tree_block(trans, rc, node, &block->key,
27812780
path);
2782-
if (ret < 0) {
2783-
err = ret;
2781+
if (ret < 0)
27842782
break;
2785-
}
27862783
}
27872784
out:
2788-
err = finish_pending_nodes(trans, rc, path, err);
2785+
ret = finish_pending_nodes(trans, rc, path, ret);
27892786

27902787
out_free_path:
27912788
btrfs_free_path(path);
27922789
out_free_blocks:
27932790
free_block_list(blocks);
2794-
return err;
2791+
return ret;
27952792
}
27962793

27972794
static noinline_for_stack int prealloc_file_extent_cluster(

0 commit comments

Comments
 (0)