Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 252331
b: refs/heads/master
c: 1cd3079
h: refs/heads/master
i:
  252329: dfaa9c5
  252327: 68cda59
v: v3
  • Loading branch information
Tsutomu Itoh authored and Chris Mason committed May 23, 2011
1 parent 0f5e131 commit 788bb0a
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 65a246c5ffe3b487a001de025816326939e63362
refs/heads/master: 1cd307990d6e2b4965620e339a92e0d7ae853e13
8 changes: 2 additions & 6 deletions trunk/fs/btrfs/ctree.c
Original file line number Diff line number Diff line change
Expand Up @@ -3216,7 +3216,6 @@ int btrfs_truncate_item(struct btrfs_trans_handle *trans,
struct btrfs_path *path,
u32 new_size, int from_end)
{
int ret = 0;
int slot;
struct extent_buffer *leaf;
struct btrfs_item *item;
Expand Down Expand Up @@ -3314,12 +3313,11 @@ int btrfs_truncate_item(struct btrfs_trans_handle *trans,
btrfs_set_item_size(leaf, item, new_size);
btrfs_mark_buffer_dirty(leaf);

ret = 0;
if (btrfs_leaf_free_space(root, leaf) < 0) {
btrfs_print_leaf(root, leaf);
BUG();
}
return ret;
return 0;
}

/*
Expand All @@ -3329,7 +3327,6 @@ int btrfs_extend_item(struct btrfs_trans_handle *trans,
struct btrfs_root *root, struct btrfs_path *path,
u32 data_size)
{
int ret = 0;
int slot;
struct extent_buffer *leaf;
struct btrfs_item *item;
Expand Down Expand Up @@ -3394,12 +3391,11 @@ int btrfs_extend_item(struct btrfs_trans_handle *trans,
btrfs_set_item_size(leaf, item, old_size + data_size);
btrfs_mark_buffer_dirty(leaf);

ret = 0;
if (btrfs_leaf_free_space(root, leaf) < 0) {
btrfs_print_leaf(root, leaf);
BUG();
}
return ret;
return 0;
}

/*
Expand Down
1 change: 0 additions & 1 deletion trunk/fs/btrfs/dir-item.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ static struct btrfs_dir_item *insert_with_overflow(struct btrfs_trans_handle
if (di)
return ERR_PTR(-EEXIST);
ret = btrfs_extend_item(trans, root, path, data_size);
WARN_ON(ret > 0);
}
if (ret < 0)
return ERR_PTR(ret);
Expand Down
3 changes: 0 additions & 3 deletions trunk/fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -947,7 +947,6 @@ static int convert_extent_item_v0(struct btrfs_trans_handle *trans,
BUG_ON(ret);

ret = btrfs_extend_item(trans, root, path, new_size);
BUG_ON(ret);

leaf = path->nodes[0];
item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_extent_item);
Expand Down Expand Up @@ -1555,7 +1554,6 @@ int setup_inline_extent_backref(struct btrfs_trans_handle *trans,
size = btrfs_extent_inline_ref_size(type);

ret = btrfs_extend_item(trans, root, path, size);
BUG_ON(ret);

ei = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_extent_item);
refs = btrfs_extent_refs(leaf, ei);
Expand Down Expand Up @@ -1684,7 +1682,6 @@ int update_inline_extent_backref(struct btrfs_trans_handle *trans,
end - ptr - size);
item_size -= size;
ret = btrfs_truncate_item(trans, root, path, item_size, 1);
BUG_ON(ret);
}
btrfs_mark_buffer_dirty(leaf);
return 0;
Expand Down
3 changes: 0 additions & 3 deletions trunk/fs/btrfs/file-item.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,6 @@ static noinline int truncate_one_csum(struct btrfs_trans_handle *trans,
u32 new_size = (bytenr - key->offset) >> blocksize_bits;
new_size *= csum_size;
ret = btrfs_truncate_item(trans, root, path, new_size, 1);
BUG_ON(ret);
} else if (key->offset >= bytenr && csum_end > end_byte &&
end_byte > key->offset) {
/*
Expand All @@ -508,7 +507,6 @@ static noinline int truncate_one_csum(struct btrfs_trans_handle *trans,
new_size *= csum_size;

ret = btrfs_truncate_item(trans, root, path, new_size, 0);
BUG_ON(ret);

key->offset = end_byte;
ret = btrfs_set_item_key_safe(trans, root, path, key);
Expand Down Expand Up @@ -763,7 +761,6 @@ int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans,
goto insert;

ret = btrfs_extend_item(trans, root, path, diff);
BUG_ON(ret);
goto csum;
}

Expand Down
2 changes: 0 additions & 2 deletions trunk/fs/btrfs/inode-item.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ int btrfs_del_inode_ref(struct btrfs_trans_handle *trans,
item_size - (ptr + sub_item_len - item_start));
ret = btrfs_truncate_item(trans, root, path,
item_size - sub_item_len, 1);
BUG_ON(ret);
out:
btrfs_free_path(path);
return ret;
Expand Down Expand Up @@ -167,7 +166,6 @@ int btrfs_insert_inode_ref(struct btrfs_trans_handle *trans,

old_size = btrfs_item_size_nr(path->nodes[0], path->slots[0]);
ret = btrfs_extend_item(trans, root, path, ins_len);
BUG_ON(ret);
ref = btrfs_item_ptr(path->nodes[0], path->slots[0],
struct btrfs_inode_ref);
ref = (struct btrfs_inode_ref *)((unsigned long)ref + old_size);
Expand Down
1 change: 0 additions & 1 deletion trunk/fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -3428,7 +3428,6 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans,
btrfs_file_extent_calc_inline_size(size);
ret = btrfs_truncate_item(trans, root, path,
size, 1);
BUG_ON(ret);
} else if (root->ref_cows) {
inode_sub_bytes(inode, item_end + 1 -
found_key.offset);
Expand Down
1 change: 0 additions & 1 deletion trunk/fs/btrfs/tree-log.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,6 @@ static noinline int overwrite_item(struct btrfs_trans_handle *trans,
} else if (found_size < item_size) {
ret = btrfs_extend_item(trans, root, path,
item_size - found_size);
BUG_ON(ret);
}
} else if (ret) {
return ret;
Expand Down

0 comments on commit 788bb0a

Please sign in to comment.