Commit 6ad3cf6d authored by David Sterba's avatar David Sterba

btrfs: get fs_info from trans in insert_ptr

We can read fs_info from the transaction and can drop it from the
parameters.
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 55d32ed8
...@@ -3407,7 +3407,7 @@ static noinline int insert_new_root(struct btrfs_trans_handle *trans, ...@@ -3407,7 +3407,7 @@ static noinline int insert_new_root(struct btrfs_trans_handle *trans,
* blocknr is the block the key points to. * blocknr is the block the key points to.
*/ */
static void insert_ptr(struct btrfs_trans_handle *trans, static void insert_ptr(struct btrfs_trans_handle *trans,
struct btrfs_fs_info *fs_info, struct btrfs_path *path, struct btrfs_path *path,
struct btrfs_disk_key *key, u64 bytenr, struct btrfs_disk_key *key, u64 bytenr,
int slot, int level) int slot, int level)
{ {
...@@ -3420,7 +3420,7 @@ static void insert_ptr(struct btrfs_trans_handle *trans, ...@@ -3420,7 +3420,7 @@ static void insert_ptr(struct btrfs_trans_handle *trans,
lower = path->nodes[level]; lower = path->nodes[level];
nritems = btrfs_header_nritems(lower); nritems = btrfs_header_nritems(lower);
BUG_ON(slot > nritems); BUG_ON(slot > nritems);
BUG_ON(nritems == BTRFS_NODEPTRS_PER_BLOCK(fs_info)); BUG_ON(nritems == BTRFS_NODEPTRS_PER_BLOCK(trans->fs_info));
if (slot != nritems) { if (slot != nritems) {
if (level) { if (level) {
ret = tree_mod_log_insert_move(lower, slot + 1, slot, ret = tree_mod_log_insert_move(lower, slot + 1, slot,
...@@ -3520,7 +3520,7 @@ static noinline int split_node(struct btrfs_trans_handle *trans, ...@@ -3520,7 +3520,7 @@ static noinline int split_node(struct btrfs_trans_handle *trans,
btrfs_mark_buffer_dirty(c); btrfs_mark_buffer_dirty(c);
btrfs_mark_buffer_dirty(split); btrfs_mark_buffer_dirty(split);
insert_ptr(trans, fs_info, path, &disk_key, split->start, insert_ptr(trans, path, &disk_key, split->start,
path->slots[level + 1] + 1, level + 1); path->slots[level + 1] + 1, level + 1);
if (path->slots[level] >= mid) { if (path->slots[level] >= mid) {
...@@ -4084,8 +4084,7 @@ static noinline void copy_for_split(struct btrfs_trans_handle *trans, ...@@ -4084,8 +4084,7 @@ static noinline void copy_for_split(struct btrfs_trans_handle *trans,
btrfs_set_header_nritems(l, mid); btrfs_set_header_nritems(l, mid);
btrfs_item_key(right, &disk_key, 0); btrfs_item_key(right, &disk_key, 0);
insert_ptr(trans, fs_info, path, &disk_key, right->start, insert_ptr(trans, path, &disk_key, right->start, path->slots[1] + 1, 1);
path->slots[1] + 1, 1);
btrfs_mark_buffer_dirty(right); btrfs_mark_buffer_dirty(right);
btrfs_mark_buffer_dirty(l); btrfs_mark_buffer_dirty(l);
...@@ -4291,7 +4290,7 @@ static noinline int split_leaf(struct btrfs_trans_handle *trans, ...@@ -4291,7 +4290,7 @@ static noinline int split_leaf(struct btrfs_trans_handle *trans,
if (split == 0) { if (split == 0) {
if (mid <= slot) { if (mid <= slot) {
btrfs_set_header_nritems(right, 0); btrfs_set_header_nritems(right, 0);
insert_ptr(trans, fs_info, path, &disk_key, insert_ptr(trans, path, &disk_key,
right->start, path->slots[1] + 1, 1); right->start, path->slots[1] + 1, 1);
btrfs_tree_unlock(path->nodes[0]); btrfs_tree_unlock(path->nodes[0]);
free_extent_buffer(path->nodes[0]); free_extent_buffer(path->nodes[0]);
...@@ -4300,7 +4299,7 @@ static noinline int split_leaf(struct btrfs_trans_handle *trans, ...@@ -4300,7 +4299,7 @@ static noinline int split_leaf(struct btrfs_trans_handle *trans,
path->slots[1] += 1; path->slots[1] += 1;
} else { } else {
btrfs_set_header_nritems(right, 0); btrfs_set_header_nritems(right, 0);
insert_ptr(trans, fs_info, path, &disk_key, insert_ptr(trans, path, &disk_key,
right->start, path->slots[1], 1); right->start, path->slots[1], 1);
btrfs_tree_unlock(path->nodes[0]); btrfs_tree_unlock(path->nodes[0]);
free_extent_buffer(path->nodes[0]); free_extent_buffer(path->nodes[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