Commit ed874f0d authored by David Sterba's avatar David Sterba

btrfs: get fs_info from eb in tree_mod_log_eb_copy

We can read fs_info from extent buffer and can drop it from the
parameters.
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent b0c9b3b0
...@@ -726,11 +726,11 @@ tree_mod_log_search(struct btrfs_fs_info *fs_info, u64 start, u64 min_seq) ...@@ -726,11 +726,11 @@ tree_mod_log_search(struct btrfs_fs_info *fs_info, u64 start, u64 min_seq)
return __tree_mod_log_search(fs_info, start, min_seq, 0); return __tree_mod_log_search(fs_info, start, min_seq, 0);
} }
static noinline int static noinline int tree_mod_log_eb_copy(struct extent_buffer *dst,
tree_mod_log_eb_copy(struct btrfs_fs_info *fs_info, struct extent_buffer *dst,
struct extent_buffer *src, unsigned long dst_offset, struct extent_buffer *src, unsigned long dst_offset,
unsigned long src_offset, int nr_items) unsigned long src_offset, int nr_items)
{ {
struct btrfs_fs_info *fs_info = dst->fs_info;
int ret = 0; int ret = 0;
struct tree_mod_elem **tm_list = NULL; struct tree_mod_elem **tm_list = NULL;
struct tree_mod_elem **tm_list_add, **tm_list_rem; struct tree_mod_elem **tm_list_add, **tm_list_rem;
...@@ -3249,8 +3249,7 @@ static int push_node_left(struct btrfs_trans_handle *trans, ...@@ -3249,8 +3249,7 @@ static int push_node_left(struct btrfs_trans_handle *trans,
} else } else
push_items = min(src_nritems - 8, push_items); push_items = min(src_nritems - 8, push_items);
ret = tree_mod_log_eb_copy(fs_info, dst, src, dst_nritems, 0, ret = tree_mod_log_eb_copy(dst, src, dst_nritems, 0, push_items);
push_items);
if (ret) { if (ret) {
btrfs_abort_transaction(trans, ret); btrfs_abort_transaction(trans, ret);
return ret; return ret;
...@@ -3325,8 +3324,8 @@ static int balance_node_right(struct btrfs_trans_handle *trans, ...@@ -3325,8 +3324,8 @@ static int balance_node_right(struct btrfs_trans_handle *trans,
(dst_nritems) * (dst_nritems) *
sizeof(struct btrfs_key_ptr)); sizeof(struct btrfs_key_ptr));
ret = tree_mod_log_eb_copy(fs_info, dst, src, 0, ret = tree_mod_log_eb_copy(dst, src, 0, src_nritems - push_items,
src_nritems - push_items, push_items); push_items);
if (ret) { if (ret) {
btrfs_abort_transaction(trans, ret); btrfs_abort_transaction(trans, ret);
return ret; return ret;
...@@ -3511,7 +3510,7 @@ static noinline int split_node(struct btrfs_trans_handle *trans, ...@@ -3511,7 +3510,7 @@ static noinline int split_node(struct btrfs_trans_handle *trans,
root_add_used(root, fs_info->nodesize); root_add_used(root, fs_info->nodesize);
ASSERT(btrfs_header_level(c) == level); ASSERT(btrfs_header_level(c) == level);
ret = tree_mod_log_eb_copy(fs_info, split, c, 0, mid, c_nritems - mid); ret = tree_mod_log_eb_copy(split, c, 0, mid, c_nritems - mid);
if (ret) { if (ret) {
btrfs_abort_transaction(trans, ret); btrfs_abort_transaction(trans, ret);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment