Commit 6074d45f authored by David Sterba's avatar David Sterba

btrfs: drop fs_info parameter from tree_mod_log_insert_move

It's provided by the extent_buffer.
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 3ac6de1a
...@@ -564,10 +564,8 @@ tree_mod_log_insert_key(struct btrfs_fs_info *fs_info, ...@@ -564,10 +564,8 @@ tree_mod_log_insert_key(struct btrfs_fs_info *fs_info,
return ret; return ret;
} }
static noinline int static noinline int tree_mod_log_insert_move(struct extent_buffer *eb,
tree_mod_log_insert_move(struct btrfs_fs_info *fs_info, int dst_slot, int src_slot, int nr_items)
struct extent_buffer *eb, int dst_slot, int src_slot,
int nr_items)
{ {
struct tree_mod_elem *tm = NULL; struct tree_mod_elem *tm = NULL;
struct tree_mod_elem **tm_list = NULL; struct tree_mod_elem **tm_list = NULL;
...@@ -575,7 +573,7 @@ tree_mod_log_insert_move(struct btrfs_fs_info *fs_info, ...@@ -575,7 +573,7 @@ tree_mod_log_insert_move(struct btrfs_fs_info *fs_info,
int i; int i;
int locked = 0; int locked = 0;
if (!tree_mod_need_log(fs_info, eb)) if (!tree_mod_need_log(eb->fs_info, eb))
return 0; return 0;
tm_list = kcalloc(nr_items, sizeof(struct tree_mod_elem *), GFP_NOFS); tm_list = kcalloc(nr_items, sizeof(struct tree_mod_elem *), GFP_NOFS);
...@@ -603,7 +601,7 @@ tree_mod_log_insert_move(struct btrfs_fs_info *fs_info, ...@@ -603,7 +601,7 @@ tree_mod_log_insert_move(struct btrfs_fs_info *fs_info,
} }
} }
if (tree_mod_dont_log(fs_info, eb)) if (tree_mod_dont_log(eb->fs_info, eb))
goto free_tms; goto free_tms;
locked = 1; locked = 1;
...@@ -613,26 +611,26 @@ tree_mod_log_insert_move(struct btrfs_fs_info *fs_info, ...@@ -613,26 +611,26 @@ tree_mod_log_insert_move(struct btrfs_fs_info *fs_info,
* buffer, i.e. dst_slot < src_slot. * buffer, i.e. dst_slot < src_slot.
*/ */
for (i = 0; i + dst_slot < src_slot && i < nr_items; i++) { for (i = 0; i + dst_slot < src_slot && i < nr_items; i++) {
ret = __tree_mod_log_insert(fs_info, tm_list[i]); ret = __tree_mod_log_insert(eb->fs_info, tm_list[i]);
if (ret) if (ret)
goto free_tms; goto free_tms;
} }
ret = __tree_mod_log_insert(fs_info, tm); ret = __tree_mod_log_insert(eb->fs_info, tm);
if (ret) if (ret)
goto free_tms; goto free_tms;
tree_mod_log_write_unlock(fs_info); tree_mod_log_write_unlock(eb->fs_info);
kfree(tm_list); kfree(tm_list);
return 0; return 0;
free_tms: free_tms:
for (i = 0; i < nr_items; i++) { for (i = 0; i < nr_items; i++) {
if (tm_list[i] && !RB_EMPTY_NODE(&tm_list[i]->node)) if (tm_list[i] && !RB_EMPTY_NODE(&tm_list[i]->node))
rb_erase(&tm_list[i]->node, &fs_info->tree_mod_log); rb_erase(&tm_list[i]->node, &eb->fs_info->tree_mod_log);
kfree(tm_list[i]); kfree(tm_list[i]);
} }
if (locked) if (locked)
tree_mod_log_write_unlock(fs_info); tree_mod_log_write_unlock(eb->fs_info);
kfree(tm_list); kfree(tm_list);
kfree(tm); kfree(tm);
...@@ -872,8 +870,7 @@ tree_mod_log_eb_move(struct btrfs_fs_info *fs_info, struct extent_buffer *dst, ...@@ -872,8 +870,7 @@ tree_mod_log_eb_move(struct btrfs_fs_info *fs_info, struct extent_buffer *dst,
int dst_offset, int src_offset, int nr_items) int dst_offset, int src_offset, int nr_items)
{ {
int ret; int ret;
ret = tree_mod_log_insert_move(fs_info, dst, dst_offset, src_offset, ret = tree_mod_log_insert_move(dst, dst_offset, src_offset, nr_items);
nr_items);
BUG_ON(ret < 0); BUG_ON(ret < 0);
} }
......
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