Commit 3ac6de1a authored by David Sterba's avatar David Sterba

btrfs: drop fs_info parameter from tree_mod_log_set_node_key

It's provided by the extent_buffer.
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent b8b3d625
...@@ -877,13 +877,12 @@ tree_mod_log_eb_move(struct btrfs_fs_info *fs_info, struct extent_buffer *dst, ...@@ -877,13 +877,12 @@ tree_mod_log_eb_move(struct btrfs_fs_info *fs_info, struct extent_buffer *dst,
BUG_ON(ret < 0); BUG_ON(ret < 0);
} }
static noinline void static noinline void tree_mod_log_set_node_key(struct extent_buffer *eb,
tree_mod_log_set_node_key(struct btrfs_fs_info *fs_info, int slot, int atomic)
struct extent_buffer *eb, int slot, int atomic)
{ {
int ret; int ret;
ret = tree_mod_log_insert_key(fs_info, eb, slot, ret = tree_mod_log_insert_key(eb->fs_info, eb, slot,
MOD_LOG_KEY_REPLACE, MOD_LOG_KEY_REPLACE,
atomic ? GFP_ATOMIC : GFP_NOFS); atomic ? GFP_ATOMIC : GFP_NOFS);
BUG_ON(ret < 0); BUG_ON(ret < 0);
...@@ -2007,8 +2006,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans, ...@@ -2007,8 +2006,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
} else { } else {
struct btrfs_disk_key right_key; struct btrfs_disk_key right_key;
btrfs_node_key(right, &right_key, 0); btrfs_node_key(right, &right_key, 0);
tree_mod_log_set_node_key(fs_info, parent, tree_mod_log_set_node_key(parent, pslot + 1, 0);
pslot + 1, 0);
btrfs_set_node_key(parent, &right_key, pslot + 1); btrfs_set_node_key(parent, &right_key, pslot + 1);
btrfs_mark_buffer_dirty(parent); btrfs_mark_buffer_dirty(parent);
} }
...@@ -2052,7 +2050,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans, ...@@ -2052,7 +2050,7 @@ static noinline int balance_level(struct btrfs_trans_handle *trans,
/* update the parent key to reflect our changes */ /* update the parent key to reflect our changes */
struct btrfs_disk_key mid_key; struct btrfs_disk_key mid_key;
btrfs_node_key(mid, &mid_key, 0); btrfs_node_key(mid, &mid_key, 0);
tree_mod_log_set_node_key(fs_info, parent, pslot, 0); tree_mod_log_set_node_key(parent, pslot, 0);
btrfs_set_node_key(parent, &mid_key, pslot); btrfs_set_node_key(parent, &mid_key, pslot);
btrfs_mark_buffer_dirty(parent); btrfs_mark_buffer_dirty(parent);
} }
...@@ -2153,7 +2151,7 @@ static noinline int push_nodes_for_insert(struct btrfs_trans_handle *trans, ...@@ -2153,7 +2151,7 @@ static noinline int push_nodes_for_insert(struct btrfs_trans_handle *trans,
struct btrfs_disk_key disk_key; struct btrfs_disk_key disk_key;
orig_slot += left_nr; orig_slot += left_nr;
btrfs_node_key(mid, &disk_key, 0); btrfs_node_key(mid, &disk_key, 0);
tree_mod_log_set_node_key(fs_info, parent, pslot, 0); tree_mod_log_set_node_key(parent, pslot, 0);
btrfs_set_node_key(parent, &disk_key, pslot); btrfs_set_node_key(parent, &disk_key, pslot);
btrfs_mark_buffer_dirty(parent); btrfs_mark_buffer_dirty(parent);
if (btrfs_header_nritems(left) > orig_slot) { if (btrfs_header_nritems(left) > orig_slot) {
...@@ -2207,8 +2205,7 @@ static noinline int push_nodes_for_insert(struct btrfs_trans_handle *trans, ...@@ -2207,8 +2205,7 @@ static noinline int push_nodes_for_insert(struct btrfs_trans_handle *trans,
struct btrfs_disk_key disk_key; struct btrfs_disk_key disk_key;
btrfs_node_key(right, &disk_key, 0); btrfs_node_key(right, &disk_key, 0);
tree_mod_log_set_node_key(fs_info, parent, tree_mod_log_set_node_key(parent, pslot + 1, 0);
pslot + 1, 0);
btrfs_set_node_key(parent, &disk_key, pslot + 1); btrfs_set_node_key(parent, &disk_key, pslot + 1);
btrfs_mark_buffer_dirty(parent); btrfs_mark_buffer_dirty(parent);
...@@ -3167,7 +3164,7 @@ static void fixup_low_keys(struct btrfs_fs_info *fs_info, ...@@ -3167,7 +3164,7 @@ static void fixup_low_keys(struct btrfs_fs_info *fs_info,
if (!path->nodes[i]) if (!path->nodes[i])
break; break;
t = path->nodes[i]; t = path->nodes[i];
tree_mod_log_set_node_key(fs_info, t, tslot, 1); tree_mod_log_set_node_key(t, tslot, 1);
btrfs_set_node_key(t, key, tslot); btrfs_set_node_key(t, key, tslot);
btrfs_mark_buffer_dirty(path->nodes[i]); btrfs_mark_buffer_dirty(path->nodes[i]);
if (tslot != 0) if (tslot != 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