diff options
author | Andi Kleen <andi@firstfloor.org> | 2010-10-29 15:14:37 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2010-10-29 15:14:37 -0400 |
commit | 559af8211433b8c0b20e6c43c61409cb9c9c2996 (patch) | |
tree | 702ebd4c4f5b610daa36f65d814a518356a9a46b /fs/btrfs/ctree.c | |
parent | 411fc6bcef54f828a5458f4730c68abdf13c6bf0 (diff) |
Btrfs: cleanup warnings from gcc 4.6 (nonbugs)
These are all the cases where a variable is set, but not read which are
not bugs as far as I can see, but simply leftovers.
Still needs more review.
Found by gcc 4.6's new warnings
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.c')
-rw-r--r-- | fs/btrfs/ctree.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 6921231e0efb..9ac171599258 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c | |||
@@ -200,7 +200,6 @@ int btrfs_copy_root(struct btrfs_trans_handle *trans, | |||
200 | struct extent_buffer **cow_ret, u64 new_root_objectid) | 200 | struct extent_buffer **cow_ret, u64 new_root_objectid) |
201 | { | 201 | { |
202 | struct extent_buffer *cow; | 202 | struct extent_buffer *cow; |
203 | u32 nritems; | ||
204 | int ret = 0; | 203 | int ret = 0; |
205 | int level; | 204 | int level; |
206 | struct btrfs_disk_key disk_key; | 205 | struct btrfs_disk_key disk_key; |
@@ -210,7 +209,6 @@ int btrfs_copy_root(struct btrfs_trans_handle *trans, | |||
210 | WARN_ON(root->ref_cows && trans->transid != root->last_trans); | 209 | WARN_ON(root->ref_cows && trans->transid != root->last_trans); |
211 | 210 | ||
212 | level = btrfs_header_level(buf); | 211 | level = btrfs_header_level(buf); |
213 | nritems = btrfs_header_nritems(buf); | ||
214 | if (level == 0) | 212 | if (level == 0) |
215 | btrfs_item_key(buf, &disk_key, 0); | 213 | btrfs_item_key(buf, &disk_key, 0); |
216 | else | 214 | else |
@@ -1008,7 +1006,6 @@ static noinline int balance_level(struct btrfs_trans_handle *trans, | |||
1008 | int wret; | 1006 | int wret; |
1009 | int pslot; | 1007 | int pslot; |
1010 | int orig_slot = path->slots[level]; | 1008 | int orig_slot = path->slots[level]; |
1011 | int err_on_enospc = 0; | ||
1012 | u64 orig_ptr; | 1009 | u64 orig_ptr; |
1013 | 1010 | ||
1014 | if (level == 0) | 1011 | if (level == 0) |
@@ -1071,8 +1068,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans, | |||
1071 | BTRFS_NODEPTRS_PER_BLOCK(root) / 4) | 1068 | BTRFS_NODEPTRS_PER_BLOCK(root) / 4) |
1072 | return 0; | 1069 | return 0; |
1073 | 1070 | ||
1074 | if (btrfs_header_nritems(mid) < 2) | 1071 | btrfs_header_nritems(mid); |
1075 | err_on_enospc = 1; | ||
1076 | 1072 | ||
1077 | left = read_node_slot(root, parent, pslot - 1); | 1073 | left = read_node_slot(root, parent, pslot - 1); |
1078 | if (left) { | 1074 | if (left) { |
@@ -1103,8 +1099,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans, | |||
1103 | wret = push_node_left(trans, root, left, mid, 1); | 1099 | wret = push_node_left(trans, root, left, mid, 1); |
1104 | if (wret < 0) | 1100 | if (wret < 0) |
1105 | ret = wret; | 1101 | ret = wret; |
1106 | if (btrfs_header_nritems(mid) < 2) | 1102 | btrfs_header_nritems(mid); |
1107 | err_on_enospc = 1; | ||
1108 | } | 1103 | } |
1109 | 1104 | ||
1110 | /* | 1105 | /* |
@@ -1224,14 +1219,12 @@ static noinline int push_nodes_for_insert(struct btrfs_trans_handle *trans, | |||
1224 | int wret; | 1219 | int wret; |
1225 | int pslot; | 1220 | int pslot; |
1226 | int orig_slot = path->slots[level]; | 1221 | int orig_slot = path->slots[level]; |
1227 | u64 orig_ptr; | ||
1228 | 1222 | ||
1229 | if (level == 0) | 1223 | if (level == 0) |
1230 | return 1; | 1224 | return 1; |
1231 | 1225 | ||
1232 | mid = path->nodes[level]; | 1226 | mid = path->nodes[level]; |
1233 | WARN_ON(btrfs_header_generation(mid) != trans->transid); | 1227 | WARN_ON(btrfs_header_generation(mid) != trans->transid); |
1234 | orig_ptr = btrfs_node_blockptr(mid, orig_slot); | ||
1235 | 1228 | ||
1236 | if (level < BTRFS_MAX_LEVEL - 1) | 1229 | if (level < BTRFS_MAX_LEVEL - 1) |
1237 | parent = path->nodes[level + 1]; | 1230 | parent = path->nodes[level + 1]; |
@@ -2567,7 +2560,6 @@ static noinline int __push_leaf_left(struct btrfs_trans_handle *trans, | |||
2567 | { | 2560 | { |
2568 | struct btrfs_disk_key disk_key; | 2561 | struct btrfs_disk_key disk_key; |
2569 | struct extent_buffer *right = path->nodes[0]; | 2562 | struct extent_buffer *right = path->nodes[0]; |
2570 | int slot; | ||
2571 | int i; | 2563 | int i; |
2572 | int push_space = 0; | 2564 | int push_space = 0; |
2573 | int push_items = 0; | 2565 | int push_items = 0; |
@@ -2579,8 +2571,6 @@ static noinline int __push_leaf_left(struct btrfs_trans_handle *trans, | |||
2579 | u32 this_item_size; | 2571 | u32 this_item_size; |
2580 | u32 old_left_item_size; | 2572 | u32 old_left_item_size; |
2581 | 2573 | ||
2582 | slot = path->slots[1]; | ||
2583 | |||
2584 | if (empty) | 2574 | if (empty) |
2585 | nr = min(right_nritems, max_slot); | 2575 | nr = min(right_nritems, max_slot); |
2586 | else | 2576 | else |
@@ -3349,7 +3339,6 @@ int btrfs_truncate_item(struct btrfs_trans_handle *trans, | |||
3349 | { | 3339 | { |
3350 | int ret = 0; | 3340 | int ret = 0; |
3351 | int slot; | 3341 | int slot; |
3352 | int slot_orig; | ||
3353 | struct extent_buffer *leaf; | 3342 | struct extent_buffer *leaf; |
3354 | struct btrfs_item *item; | 3343 | struct btrfs_item *item; |
3355 | u32 nritems; | 3344 | u32 nritems; |
@@ -3359,7 +3348,6 @@ int btrfs_truncate_item(struct btrfs_trans_handle *trans, | |||
3359 | unsigned int size_diff; | 3348 | unsigned int size_diff; |
3360 | int i; | 3349 | int i; |
3361 | 3350 | ||
3362 | slot_orig = path->slots[0]; | ||
3363 | leaf = path->nodes[0]; | 3351 | leaf = path->nodes[0]; |
3364 | slot = path->slots[0]; | 3352 | slot = path->slots[0]; |
3365 | 3353 | ||
@@ -3464,7 +3452,6 @@ int btrfs_extend_item(struct btrfs_trans_handle *trans, | |||
3464 | { | 3452 | { |
3465 | int ret = 0; | 3453 | int ret = 0; |
3466 | int slot; | 3454 | int slot; |
3467 | int slot_orig; | ||
3468 | struct extent_buffer *leaf; | 3455 | struct extent_buffer *leaf; |
3469 | struct btrfs_item *item; | 3456 | struct btrfs_item *item; |
3470 | u32 nritems; | 3457 | u32 nritems; |
@@ -3473,7 +3460,6 @@ int btrfs_extend_item(struct btrfs_trans_handle *trans, | |||
3473 | unsigned int old_size; | 3460 | unsigned int old_size; |
3474 | int i; | 3461 | int i; |
3475 | 3462 | ||
3476 | slot_orig = path->slots[0]; | ||
3477 | leaf = path->nodes[0]; | 3463 | leaf = path->nodes[0]; |
3478 | 3464 | ||
3479 | nritems = btrfs_header_nritems(leaf); | 3465 | nritems = btrfs_header_nritems(leaf); |
@@ -3806,7 +3792,6 @@ int btrfs_insert_empty_items(struct btrfs_trans_handle *trans, | |||
3806 | struct btrfs_key *cpu_key, u32 *data_size, | 3792 | struct btrfs_key *cpu_key, u32 *data_size, |
3807 | int nr) | 3793 | int nr) |
3808 | { | 3794 | { |
3809 | struct extent_buffer *leaf; | ||
3810 | int ret = 0; | 3795 | int ret = 0; |
3811 | int slot; | 3796 | int slot; |
3812 | int i; | 3797 | int i; |
@@ -3823,7 +3808,6 @@ int btrfs_insert_empty_items(struct btrfs_trans_handle *trans, | |||
3823 | if (ret < 0) | 3808 | if (ret < 0) |
3824 | goto out; | 3809 | goto out; |
3825 | 3810 | ||
3826 | leaf = path->nodes[0]; | ||
3827 | slot = path->slots[0]; | 3811 | slot = path->slots[0]; |
3828 | BUG_ON(slot < 0); | 3812 | BUG_ON(slot < 0); |
3829 | 3813 | ||