btrfs-progs: Remove root argument from pin_down_bytes

This argument is used to obtain a reference to fs_info, which can
already be done from the passed trans handle, so use that instead.
This is in preparation for delayed refs support.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
master
Nikolay Borisov 2018-06-08 15:47:44 +03:00 committed by David Sterba
parent 0cbcc58b96
commit 819ac53931
1 changed files with 4 additions and 5 deletions

View File

@ -2098,9 +2098,8 @@ static int finish_current_insert(struct btrfs_trans_handle *trans)
return 0;
}
static int pin_down_bytes(struct btrfs_trans_handle *trans,
struct btrfs_root *root,
u64 bytenr, u64 num_bytes, int is_data)
static int pin_down_bytes(struct btrfs_trans_handle *trans, u64 bytenr,
u64 num_bytes, int is_data)
{
int err = 0;
struct extent_buffer *buf;
@ -2108,7 +2107,7 @@ static int pin_down_bytes(struct btrfs_trans_handle *trans,
if (is_data)
goto pinit;
buf = btrfs_find_tree_block(root->fs_info, bytenr, num_bytes);
buf = btrfs_find_tree_block(trans->fs_info, bytenr, num_bytes);
if (!buf)
goto pinit;
@ -2360,7 +2359,7 @@ static int __free_extent(struct btrfs_trans_handle *trans,
}
if (pin) {
ret = pin_down_bytes(trans, root, bytenr, num_bytes,
ret = pin_down_bytes(trans, bytenr, num_bytes,
is_data);
if (ret > 0)
mark_free = 1;