Skip to content

Commit 2b21c78

Browse files
asjkdave
authored andcommitted
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: Anand Jain <anand.jain@oracle.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 6b40167 commit 2b21c78

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

fs/btrfs/relocation.c

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4221,7 +4221,7 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
42214221
struct reloc_control *rc = NULL;
42224222
struct btrfs_trans_handle *trans;
42234223
int ret2;
4224-
int err = 0;
4224+
int ret = 0;
42254225

42264226
path = btrfs_alloc_path();
42274227
if (!path)
@@ -4233,16 +4233,16 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
42334233
key.offset = (u64)-1;
42344234

42354235
while (1) {
4236-
err = btrfs_search_slot(NULL, fs_info->tree_root, &key,
4236+
ret = btrfs_search_slot(NULL, fs_info->tree_root, &key,
42374237
path, 0, 0);
4238-
if (err < 0)
4238+
if (ret < 0)
42394239
goto out;
4240-
if (err > 0) {
4240+
if (ret > 0) {
42414241
if (path->slots[0] == 0)
42424242
break;
42434243
path->slots[0]--;
42444244
}
4245-
err = 0;
4245+
ret = 0;
42464246
leaf = path->nodes[0];
42474247
btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);
42484248
btrfs_release_path(path);
@@ -4253,7 +4253,7 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
42534253

42544254
reloc_root = btrfs_read_tree_root(fs_info->tree_root, &key);
42554255
if (IS_ERR(reloc_root)) {
4256-
err = PTR_ERR(reloc_root);
4256+
ret = PTR_ERR(reloc_root);
42574257
goto out;
42584258
}
42594259

@@ -4264,13 +4264,13 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
42644264
fs_root = btrfs_get_fs_root(fs_info,
42654265
reloc_root->root_key.offset, false);
42664266
if (IS_ERR(fs_root)) {
4267-
err = PTR_ERR(fs_root);
4268-
if (err != -ENOENT)
4267+
ret = PTR_ERR(fs_root);
4268+
if (ret != -ENOENT)
42694269
goto out;
4270-
err = mark_garbage_root(reloc_root);
4271-
if (err < 0)
4270+
ret = mark_garbage_root(reloc_root);
4271+
if (ret < 0)
42724272
goto out;
4273-
err = 0;
4273+
ret = 0;
42744274
} else {
42754275
btrfs_put_root(fs_root);
42764276
}
@@ -4288,12 +4288,12 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
42884288

42894289
rc = alloc_reloc_control(fs_info);
42904290
if (!rc) {
4291-
err = -ENOMEM;
4291+
ret = -ENOMEM;
42924292
goto out;
42934293
}
42944294

4295-
err = reloc_chunk_start(fs_info);
4296-
if (err < 0)
4295+
ret = reloc_chunk_start(fs_info);
4296+
if (ret < 0)
42974297
goto out_end;
42984298

42994299
rc->extent_root = btrfs_extent_root(fs_info, 0);
@@ -4302,7 +4302,7 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
43024302

43034303
trans = btrfs_join_transaction(rc->extent_root);
43044304
if (IS_ERR(trans)) {
4305-
err = PTR_ERR(trans);
4305+
ret = PTR_ERR(trans);
43064306
goto out_unset;
43074307
}
43084308

@@ -4322,15 +4322,15 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
43224322
fs_root = btrfs_get_fs_root(fs_info, reloc_root->root_key.offset,
43234323
false);
43244324
if (IS_ERR(fs_root)) {
4325-
err = PTR_ERR(fs_root);
4325+
ret = PTR_ERR(fs_root);
43264326
list_add_tail(&reloc_root->root_list, &reloc_roots);
43274327
btrfs_end_transaction(trans);
43284328
goto out_unset;
43294329
}
43304330

4331-
err = __add_reloc_root(reloc_root);
4332-
ASSERT(err != -EEXIST);
4333-
if (err) {
4331+
ret = __add_reloc_root(reloc_root);
4332+
ASSERT(ret != -EEXIST);
4333+
if (ret) {
43344334
list_add_tail(&reloc_root->root_list, &reloc_roots);
43354335
btrfs_put_root(fs_root);
43364336
btrfs_end_transaction(trans);
@@ -4340,8 +4340,8 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
43404340
btrfs_put_root(fs_root);
43414341
}
43424342

4343-
err = btrfs_commit_transaction(trans);
4344-
if (err)
4343+
ret = btrfs_commit_transaction(trans);
4344+
if (ret)
43454345
goto out_unset;
43464346

43474347
merge_reloc_roots(rc);
@@ -4350,14 +4350,14 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
43504350

43514351
trans = btrfs_join_transaction(rc->extent_root);
43524352
if (IS_ERR(trans)) {
4353-
err = PTR_ERR(trans);
4353+
ret = PTR_ERR(trans);
43544354
goto out_clean;
43554355
}
4356-
err = btrfs_commit_transaction(trans);
4356+
ret = btrfs_commit_transaction(trans);
43574357
out_clean:
43584358
ret2 = clean_dirty_subvols(rc);
4359-
if (ret2 < 0 && !err)
4360-
err = ret2;
4359+
if (ret2 < 0 && !ret)
4360+
ret = ret2;
43614361
out_unset:
43624362
unset_reloc_control(rc);
43634363
out_end:
@@ -4368,14 +4368,14 @@ int btrfs_recover_relocation(struct btrfs_fs_info *fs_info)
43684368

43694369
btrfs_free_path(path);
43704370

4371-
if (err == 0) {
4371+
if (ret == 0) {
43724372
/* cleanup orphan inode in data relocation tree */
43734373
fs_root = btrfs_grab_root(fs_info->data_reloc_root);
43744374
ASSERT(fs_root);
4375-
err = btrfs_orphan_cleanup(fs_root);
4375+
ret = btrfs_orphan_cleanup(fs_root);
43764376
btrfs_put_root(fs_root);
43774377
}
4378-
return err;
4378+
return ret;
43794379
}
43804380

43814381
/*

0 commit comments

Comments
 (0)