Skip to content

Commit daefe4d

Browse files
fdmananakdave
authored andcommitted
btrfs: rename enospc label to out at balance_level()
At balance_level() we have this 'enospc' label where we jump to in case we get an error at several places. However that error is certainly not -ENOSPC in call cases, it can be -EIO or -ENOMEM when reading a child extent buffer for example, or -ENOMEM when trying to record tree mod log operations. So to make this less confusing, rename the label to 'out'. Reviewed-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 39020d8 commit daefe4d

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

fs/btrfs/ctree.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
10411041
if (IS_ERR(child)) {
10421042
ret = PTR_ERR(child);
10431043
btrfs_handle_fs_error(fs_info, ret, NULL);
1044-
goto enospc;
1044+
goto out;
10451045
}
10461046

10471047
btrfs_tree_lock(child);
@@ -1050,15 +1050,15 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
10501050
if (ret) {
10511051
btrfs_tree_unlock(child);
10521052
free_extent_buffer(child);
1053-
goto enospc;
1053+
goto out;
10541054
}
10551055

10561056
ret = btrfs_tree_mod_log_insert_root(root->node, child, true);
10571057
if (ret < 0) {
10581058
btrfs_tree_unlock(child);
10591059
free_extent_buffer(child);
10601060
btrfs_abort_transaction(trans, ret);
1061-
goto enospc;
1061+
goto out;
10621062
}
10631063
rcu_assign_pointer(root->node, child);
10641064

@@ -1087,7 +1087,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
10871087
if (IS_ERR(left)) {
10881088
ret = PTR_ERR(left);
10891089
left = NULL;
1090-
goto enospc;
1090+
goto out;
10911091
}
10921092

10931093
__btrfs_tree_lock(left, BTRFS_NESTING_LEFT);
@@ -1096,7 +1096,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
10961096
BTRFS_NESTING_LEFT_COW);
10971097
if (wret) {
10981098
ret = wret;
1099-
goto enospc;
1099+
goto out;
11001100
}
11011101
}
11021102

@@ -1105,7 +1105,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
11051105
if (IS_ERR(right)) {
11061106
ret = PTR_ERR(right);
11071107
right = NULL;
1108-
goto enospc;
1108+
goto out;
11091109
}
11101110

11111111
__btrfs_tree_lock(right, BTRFS_NESTING_RIGHT);
@@ -1114,7 +1114,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
11141114
BTRFS_NESTING_RIGHT_COW);
11151115
if (wret) {
11161116
ret = wret;
1117-
goto enospc;
1117+
goto out;
11181118
}
11191119
}
11201120

@@ -1149,7 +1149,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
11491149
BTRFS_MOD_LOG_KEY_REPLACE);
11501150
if (ret < 0) {
11511151
btrfs_abort_transaction(trans, ret);
1152-
goto enospc;
1152+
goto out;
11531153
}
11541154
btrfs_set_node_key(parent, &right_key, pslot + 1);
11551155
btrfs_mark_buffer_dirty(parent);
@@ -1168,12 +1168,12 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
11681168
if (!left) {
11691169
ret = -EROFS;
11701170
btrfs_handle_fs_error(fs_info, ret, NULL);
1171-
goto enospc;
1171+
goto out;
11721172
}
11731173
wret = balance_node_right(trans, mid, left);
11741174
if (wret < 0) {
11751175
ret = wret;
1176-
goto enospc;
1176+
goto out;
11771177
}
11781178
if (wret == 1) {
11791179
wret = push_node_left(trans, left, mid, 1);
@@ -1198,7 +1198,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
11981198
BTRFS_MOD_LOG_KEY_REPLACE);
11991199
if (ret < 0) {
12001200
btrfs_abort_transaction(trans, ret);
1201-
goto enospc;
1201+
goto out;
12021202
}
12031203
btrfs_set_node_key(parent, &mid_key, pslot);
12041204
btrfs_mark_buffer_dirty(parent);
@@ -1225,7 +1225,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
12251225
if (orig_ptr !=
12261226
btrfs_node_blockptr(path->nodes[level], path->slots[level]))
12271227
BUG();
1228-
enospc:
1228+
out:
12291229
if (right) {
12301230
btrfs_tree_unlock(right);
12311231
free_extent_buffer(right);

0 commit comments

Comments
 (0)