aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.c
diff options
context:
space:
mode:
authorTsutomu Itoh <t-itoh@jp.fujitsu.com>2011-05-19 01:19:08 -0400
committerChris Mason <chris.mason@oracle.com>2011-05-23 13:24:39 -0400
commit1cd307990d6e2b4965620e339a92e0d7ae853e13 (patch)
treecd3cc9c06e2c7bbbeda4d38bbcc00d44bfd98a02 /fs/btrfs/ctree.c
parent65a246c5ffe3b487a001de025816326939e63362 (diff)
Btrfs: BUG_ON is deleted from the caller of btrfs_truncate_item & btrfs_extend_item
Currently, btrfs_truncate_item and btrfs_extend_item returns only 0. So, the check by BUG_ON in the caller is unnecessary. Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.c')
-rw-r--r--fs/btrfs/ctree.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index 84d7ca1fe0ba..6f1a59cc41ff 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -3216,7 +3216,6 @@ int btrfs_truncate_item(struct btrfs_trans_handle *trans,
3216 struct btrfs_path *path, 3216 struct btrfs_path *path,
3217 u32 new_size, int from_end) 3217 u32 new_size, int from_end)
3218{ 3218{
3219 int ret = 0;
3220 int slot; 3219 int slot;
3221 struct extent_buffer *leaf; 3220 struct extent_buffer *leaf;
3222 struct btrfs_item *item; 3221 struct btrfs_item *item;
@@ -3314,12 +3313,11 @@ int btrfs_truncate_item(struct btrfs_trans_handle *trans,
3314 btrfs_set_item_size(leaf, item, new_size); 3313 btrfs_set_item_size(leaf, item, new_size);
3315 btrfs_mark_buffer_dirty(leaf); 3314 btrfs_mark_buffer_dirty(leaf);
3316 3315
3317 ret = 0;
3318 if (btrfs_leaf_free_space(root, leaf) < 0) { 3316 if (btrfs_leaf_free_space(root, leaf) < 0) {
3319 btrfs_print_leaf(root, leaf); 3317 btrfs_print_leaf(root, leaf);
3320 BUG(); 3318 BUG();
3321 } 3319 }
3322 return ret; 3320 return 0;
3323} 3321}
3324 3322
3325/* 3323/*
@@ -3329,7 +3327,6 @@ int btrfs_extend_item(struct btrfs_trans_handle *trans,
3329 struct btrfs_root *root, struct btrfs_path *path, 3327 struct btrfs_root *root, struct btrfs_path *path,
3330 u32 data_size) 3328 u32 data_size)
3331{ 3329{
3332 int ret = 0;
3333 int slot; 3330 int slot;
3334 struct extent_buffer *leaf; 3331 struct extent_buffer *leaf;
3335 struct btrfs_item *item; 3332 struct btrfs_item *item;
@@ -3394,12 +3391,11 @@ int btrfs_extend_item(struct btrfs_trans_handle *trans,
3394 btrfs_set_item_size(leaf, item, old_size + data_size); 3391 btrfs_set_item_size(leaf, item, old_size + data_size);
3395 btrfs_mark_buffer_dirty(leaf); 3392 btrfs_mark_buffer_dirty(leaf);
3396 3393
3397 ret = 0;
3398 if (btrfs_leaf_free_space(root, leaf) < 0) { 3394 if (btrfs_leaf_free_space(root, leaf) < 0) {
3399 btrfs_print_leaf(root, leaf); 3395 btrfs_print_leaf(root, leaf);
3400 BUG(); 3396 BUG();
3401 } 3397 }
3402 return ret; 3398 return 0;
3403} 3399}
3404 3400
3405/* 3401/*