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

btrfs: rename err to ret in btrfs_recover_relocation()

Fix coding style: rename the return variable to 'ret' in the function
btrfs_recover_relocation instead of 'err'.
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 bd0d9a61
...@@ -4221,7 +4221,7 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info) ...@@ -4221,7 +4221,7 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
struct reloc_control *rc = NULL; struct reloc_control *rc = NULL;
struct btrfs_trans_handle *trans; struct btrfs_trans_handle *trans;
int ret2; int ret2;
int err = 0; int ret = 0;
path = btrfs_alloc_path(); path = btrfs_alloc_path();
if (!path) if (!path)
...@@ -4233,16 +4233,16 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info) ...@@ -4233,16 +4233,16 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
key.offset = (u64)-1; key.offset = (u64)-1;
while (1) { while (1) {
err = btrfs_search_slot(NULL, fs_info->tree_root, &key, ret = btrfs_search_slot(NULL, fs_info->tree_root, &key,
path, 0, 0); path, 0, 0);
if (err < 0) if (ret < 0)
goto out; goto out;
if (err > 0) { if (ret > 0) {
if (path->slots[0] == 0) if (path->slots[0] == 0)
break; break;
path->slots[0]--; path->slots[0]--;
} }
err = 0; ret = 0;
leaf = path->nodes[0]; leaf = path->nodes[0];
btrfs_item_key_to_cpu(leaf, &key, path->slots[0]); btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);
btrfs_release_path(path); btrfs_release_path(path);
...@@ -4253,7 +4253,7 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info) ...@@ -4253,7 +4253,7 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
reloc_root = btrfs_read_tree_root(fs_info->tree_root, &key); reloc_root = btrfs_read_tree_root(fs_info->tree_root, &key);
if (IS_ERR(reloc_root)) { if (IS_ERR(reloc_root)) {
err = PTR_ERR(reloc_root); ret = PTR_ERR(reloc_root);
goto out; goto out;
} }
...@@ -4264,13 +4264,13 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info) ...@@ -4264,13 +4264,13 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
fs_root = btrfs_get_fs_root(fs_info, fs_root = btrfs_get_fs_root(fs_info,
reloc_root->root_key.offset, false); reloc_root->root_key.offset, false);
if (IS_ERR(fs_root)) { if (IS_ERR(fs_root)) {
err = PTR_ERR(fs_root); ret = PTR_ERR(fs_root);
if (err != -ENOENT) if (ret != -ENOENT)
goto out; goto out;
err = mark_garbage_root(reloc_root); ret = mark_garbage_root(reloc_root);
if (err < 0) if (ret < 0)
goto out; goto out;
err = 0; ret = 0;
} else { } else {
btrfs_put_root(fs_root); btrfs_put_root(fs_root);
} }
...@@ -4288,12 +4288,12 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info) ...@@ -4288,12 +4288,12 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
rc = alloc_reloc_control(fs_info); rc = alloc_reloc_control(fs_info);
if (!rc) { if (!rc) {
err = -ENOMEM; ret = -ENOMEM;
goto out; goto out;
} }
err = reloc_chunk_start(fs_info); ret = reloc_chunk_start(fs_info);
if (err < 0) if (ret < 0)
goto out_end; goto out_end;
rc->extent_root = btrfs_extent_root(fs_info, 0); rc->extent_root = btrfs_extent_root(fs_info, 0);
...@@ -4302,7 +4302,7 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info) ...@@ -4302,7 +4302,7 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
trans = btrfs_join_transaction(rc->extent_root); trans = btrfs_join_transaction(rc->extent_root);
if (IS_ERR(trans)) { if (IS_ERR(trans)) {
err = PTR_ERR(trans); ret = PTR_ERR(trans);
goto out_unset; goto out_unset;
} }
...@@ -4322,15 +4322,15 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info) ...@@ -4322,15 +4322,15 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
fs_root = btrfs_get_fs_root(fs_info, reloc_root->root_key.offset, fs_root = btrfs_get_fs_root(fs_info, reloc_root->root_key.offset,
false); false);
if (IS_ERR(fs_root)) { if (IS_ERR(fs_root)) {
err = PTR_ERR(fs_root); ret = PTR_ERR(fs_root);
list_add_tail(&reloc_root->root_list, &reloc_roots); list_add_tail(&reloc_root->root_list, &reloc_roots);
btrfs_end_transaction(trans); btrfs_end_transaction(trans);
goto out_unset; goto out_unset;
} }
err = __add_reloc_root(reloc_root); ret = __add_reloc_root(reloc_root);
ASSERT(err != -EEXIST); ASSERT(ret != -EEXIST);
if (err) { if (ret) {
list_add_tail(&reloc_root->root_list, &reloc_roots); list_add_tail(&reloc_root->root_list, &reloc_roots);
btrfs_put_root(fs_root); btrfs_put_root(fs_root);
btrfs_end_transaction(trans); btrfs_end_transaction(trans);
...@@ -4340,8 +4340,8 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info) ...@@ -4340,8 +4340,8 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
btrfs_put_root(fs_root); btrfs_put_root(fs_root);
} }
err = btrfs_commit_transaction(trans); ret = btrfs_commit_transaction(trans);
if (err) if (ret)
goto out_unset; goto out_unset;
merge_reloc_roots(rc); merge_reloc_roots(rc);
...@@ -4350,14 +4350,14 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info) ...@@ -4350,14 +4350,14 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
trans = btrfs_join_transaction(rc->extent_root); trans = btrfs_join_transaction(rc->extent_root);
if (IS_ERR(trans)) { if (IS_ERR(trans)) {
err = PTR_ERR(trans); ret = PTR_ERR(trans);
goto out_clean; goto out_clean;
} }
err = btrfs_commit_transaction(trans); ret = btrfs_commit_transaction(trans);
out_clean: out_clean:
ret2 = clean_dirty_subvols(rc); ret2 = clean_dirty_subvols(rc);
if (ret2 < 0 && !err) if (ret2 < 0 && !ret)
err = ret2; ret = ret2;
out_unset: out_unset:
unset_reloc_control(rc); unset_reloc_control(rc);
out_end: out_end:
...@@ -4368,14 +4368,14 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info) ...@@ -4368,14 +4368,14 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
btrfs_free_path(path); btrfs_free_path(path);
if (err == 0) { if (ret == 0) {
/* cleanup orphan inode in data relocation tree */ /* cleanup orphan inode in data relocation tree */
fs_root = btrfs_grab_root(fs_info->data_reloc_root); fs_root = btrfs_grab_root(fs_info->data_reloc_root);
ASSERT(fs_root); ASSERT(fs_root);
err = btrfs_orphan_cleanup(fs_root); ret = btrfs_orphan_cleanup(fs_root);
btrfs_put_root(fs_root); btrfs_put_root(fs_root);
} }
return err; return ret;
} }
/* /*
......
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