Commit acde0e86 authored by Anand Jain's avatar Anand Jain Committed by David Sterba

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: default avatarAnand Jain <anand.jain@oracle.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 2daca1e4
...@@ -2742,12 +2742,11 @@ int relocate_tree_blocks(struct btrfs_trans_handle *trans, ...@@ -2742,12 +2742,11 @@ int relocate_tree_blocks(struct btrfs_trans_handle *trans,
struct btrfs_path *path; struct btrfs_path *path;
struct tree_block *block; struct tree_block *block;
struct tree_block *next; struct tree_block *next;
int ret; int ret = 0;
int err = 0;
path = btrfs_alloc_path(); path = btrfs_alloc_path();
if (!path) { if (!path) {
err = -ENOMEM; ret = -ENOMEM;
goto out_free_blocks; goto out_free_blocks;
} }
...@@ -2762,8 +2761,8 @@ int relocate_tree_blocks(struct btrfs_trans_handle *trans, ...@@ -2762,8 +2761,8 @@ int relocate_tree_blocks(struct btrfs_trans_handle *trans,
/* Get first keys */ /* Get first keys */
rbtree_postorder_for_each_entry_safe(block, next, blocks, rb_node) { rbtree_postorder_for_each_entry_safe(block, next, blocks, rb_node) {
if (!block->key_ready) { if (!block->key_ready) {
err = get_tree_block_key(fs_info, block); ret = get_tree_block_key(fs_info, block);
if (err) if (ret)
goto out_free_path; goto out_free_path;
} }
} }
...@@ -2773,25 +2772,23 @@ int relocate_tree_blocks(struct btrfs_trans_handle *trans, ...@@ -2773,25 +2772,23 @@ int relocate_tree_blocks(struct btrfs_trans_handle *trans,
node = build_backref_tree(trans, rc, &block->key, node = build_backref_tree(trans, rc, &block->key,
block->level, block->bytenr); block->level, block->bytenr);
if (IS_ERR(node)) { if (IS_ERR(node)) {
err = PTR_ERR(node); ret = PTR_ERR(node);
goto out; goto out;
} }
ret = relocate_tree_block(trans, rc, node, &block->key, ret = relocate_tree_block(trans, rc, node, &block->key,
path); path);
if (ret < 0) { if (ret < 0)
err = ret;
break; break;
}
} }
out: out:
err = finish_pending_nodes(trans, rc, path, err); ret = finish_pending_nodes(trans, rc, path, ret);
out_free_path: out_free_path:
btrfs_free_path(path); btrfs_free_path(path);
out_free_blocks: out_free_blocks:
free_block_list(blocks); free_block_list(blocks);
return err; return ret;
} }
static noinline_for_stack int prealloc_file_extent_cluster( static noinline_for_stack int prealloc_file_extent_cluster(
......
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