提交 e09c2efe 编写于 作者: D David Sterba

btrfs: drop fs_info parameter from tree_mod_log_insert_key

It's provided by the extent_buffer.
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 6074d45f
...@@ -536,28 +536,26 @@ alloc_tree_mod_elem(struct extent_buffer *eb, int slot, ...@@ -536,28 +536,26 @@ alloc_tree_mod_elem(struct extent_buffer *eb, int slot,
return tm; return tm;
} }
static noinline int static noinline int tree_mod_log_insert_key(struct extent_buffer *eb, int slot,
tree_mod_log_insert_key(struct btrfs_fs_info *fs_info, enum mod_log_op op, gfp_t flags)
struct extent_buffer *eb, int slot,
enum mod_log_op op, gfp_t flags)
{ {
struct tree_mod_elem *tm; struct tree_mod_elem *tm;
int ret; int ret;
if (!tree_mod_need_log(fs_info, eb)) if (!tree_mod_need_log(eb->fs_info, eb))
return 0; return 0;
tm = alloc_tree_mod_elem(eb, slot, op, flags); tm = alloc_tree_mod_elem(eb, slot, op, flags);
if (!tm) if (!tm)
return -ENOMEM; return -ENOMEM;
if (tree_mod_dont_log(fs_info, eb)) { if (tree_mod_dont_log(eb->fs_info, eb)) {
kfree(tm); kfree(tm);
return 0; return 0;
} }
ret = __tree_mod_log_insert(fs_info, tm); ret = __tree_mod_log_insert(eb->fs_info, tm);
tree_mod_log_write_unlock(fs_info); tree_mod_log_write_unlock(eb->fs_info);
if (ret) if (ret)
kfree(tm); kfree(tm);
...@@ -879,8 +877,7 @@ static noinline void tree_mod_log_set_node_key(struct extent_buffer *eb, ...@@ -879,8 +877,7 @@ static noinline void tree_mod_log_set_node_key(struct extent_buffer *eb,
{ {
int ret; int ret;
ret = tree_mod_log_insert_key(eb->fs_info, eb, slot, ret = tree_mod_log_insert_key(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);
} }
...@@ -1178,7 +1175,7 @@ static noinline int __btrfs_cow_block(struct btrfs_trans_handle *trans, ...@@ -1178,7 +1175,7 @@ static noinline int __btrfs_cow_block(struct btrfs_trans_handle *trans,
add_root_to_dirty_list(root); add_root_to_dirty_list(root);
} else { } else {
WARN_ON(trans->transid != btrfs_header_generation(parent)); WARN_ON(trans->transid != btrfs_header_generation(parent));
tree_mod_log_insert_key(fs_info, parent, parent_slot, tree_mod_log_insert_key(parent, parent_slot,
MOD_LOG_KEY_REPLACE, GFP_NOFS); MOD_LOG_KEY_REPLACE, GFP_NOFS);
btrfs_set_node_blockptr(parent, parent_slot, btrfs_set_node_blockptr(parent, parent_slot,
cow->start); cow->start);
...@@ -3441,8 +3438,8 @@ static void insert_ptr(struct btrfs_trans_handle *trans, ...@@ -3441,8 +3438,8 @@ static void insert_ptr(struct btrfs_trans_handle *trans,
(nritems - slot) * sizeof(struct btrfs_key_ptr)); (nritems - slot) * sizeof(struct btrfs_key_ptr));
} }
if (level) { if (level) {
ret = tree_mod_log_insert_key(fs_info, lower, slot, ret = tree_mod_log_insert_key(lower, slot, MOD_LOG_KEY_ADD,
MOD_LOG_KEY_ADD, GFP_NOFS); GFP_NOFS);
BUG_ON(ret < 0); BUG_ON(ret < 0);
} }
btrfs_set_node_key(lower, key, slot); btrfs_set_node_key(lower, key, slot);
...@@ -4914,8 +4911,8 @@ static void del_ptr(struct btrfs_root *root, struct btrfs_path *path, ...@@ -4914,8 +4911,8 @@ static void del_ptr(struct btrfs_root *root, struct btrfs_path *path,
sizeof(struct btrfs_key_ptr) * sizeof(struct btrfs_key_ptr) *
(nritems - slot - 1)); (nritems - slot - 1));
} else if (level) { } else if (level) {
ret = tree_mod_log_insert_key(fs_info, parent, slot, ret = tree_mod_log_insert_key(parent, slot, MOD_LOG_KEY_REMOVE,
MOD_LOG_KEY_REMOVE, GFP_NOFS); GFP_NOFS);
BUG_ON(ret < 0); BUG_ON(ret < 0);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册