btrfs: Remove fs_info argument from remove_from_free_space_tree
This function alreay takes a transaction handle which holds a reference to the fs_info. Use that and remove the extra argument. Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
committed by
David Sterba
parent
c31683a6ef
commit
25a356d3f6
@@ -8173,8 +8173,7 @@ static int alloc_reserved_file_extent(struct btrfs_trans_handle *trans,
|
|||||||
btrfs_mark_buffer_dirty(path->nodes[0]);
|
btrfs_mark_buffer_dirty(path->nodes[0]);
|
||||||
btrfs_free_path(path);
|
btrfs_free_path(path);
|
||||||
|
|
||||||
ret = remove_from_free_space_tree(trans, fs_info, ins->objectid,
|
ret = remove_from_free_space_tree(trans, ins->objectid, ins->offset);
|
||||||
ins->offset);
|
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
@@ -8256,8 +8255,7 @@ static int alloc_reserved_tree_block(struct btrfs_trans_handle *trans,
|
|||||||
btrfs_mark_buffer_dirty(leaf);
|
btrfs_mark_buffer_dirty(leaf);
|
||||||
btrfs_free_path(path);
|
btrfs_free_path(path);
|
||||||
|
|
||||||
ret = remove_from_free_space_tree(trans, fs_info, ins->objectid,
|
ret = remove_from_free_space_tree(trans, ins->objectid, num_bytes);
|
||||||
num_bytes);
|
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
|||||||
@@ -806,14 +806,13 @@ int __remove_from_free_space_tree(struct btrfs_trans_handle *trans,
|
|||||||
}
|
}
|
||||||
|
|
||||||
int remove_from_free_space_tree(struct btrfs_trans_handle *trans,
|
int remove_from_free_space_tree(struct btrfs_trans_handle *trans,
|
||||||
struct btrfs_fs_info *fs_info,
|
|
||||||
u64 start, u64 size)
|
u64 start, u64 size)
|
||||||
{
|
{
|
||||||
struct btrfs_block_group_cache *block_group;
|
struct btrfs_block_group_cache *block_group;
|
||||||
struct btrfs_path *path;
|
struct btrfs_path *path;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (!btrfs_fs_compat_ro(fs_info, FREE_SPACE_TREE))
|
if (!btrfs_fs_compat_ro(trans->fs_info, FREE_SPACE_TREE))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
path = btrfs_alloc_path();
|
path = btrfs_alloc_path();
|
||||||
@@ -822,7 +821,7 @@ int remove_from_free_space_tree(struct btrfs_trans_handle *trans,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
block_group = btrfs_lookup_block_group(fs_info, start);
|
block_group = btrfs_lookup_block_group(trans->fs_info, start);
|
||||||
if (!block_group) {
|
if (!block_group) {
|
||||||
ASSERT(0);
|
ASSERT(0);
|
||||||
ret = -ENOENT;
|
ret = -ENOENT;
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ int add_to_free_space_tree(struct btrfs_trans_handle *trans,
|
|||||||
struct btrfs_fs_info *fs_info,
|
struct btrfs_fs_info *fs_info,
|
||||||
u64 start, u64 size);
|
u64 start, u64 size);
|
||||||
int remove_from_free_space_tree(struct btrfs_trans_handle *trans,
|
int remove_from_free_space_tree(struct btrfs_trans_handle *trans,
|
||||||
struct btrfs_fs_info *fs_info,
|
|
||||||
u64 start, u64 size);
|
u64 start, u64 size);
|
||||||
|
|
||||||
#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
|
#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
|
||||||
|
|||||||
Reference in New Issue
Block a user