Commit 4ca75f1b authored by David Sterba's avatar David Sterba

btrfs: get fs_info from trans in create_free_space_inode

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 90787766
...@@ -3411,8 +3411,7 @@ static int cache_save_setup(struct btrfs_block_group_cache *block_group, ...@@ -3411,8 +3411,7 @@ static int cache_save_setup(struct btrfs_block_group_cache *block_group,
if (block_group->ro) if (block_group->ro)
goto out_free; goto out_free;
ret = create_free_space_inode(fs_info, trans, block_group, ret = create_free_space_inode(trans, block_group, path);
path);
if (ret) if (ret)
goto out_free; goto out_free;
goto again; goto again;
......
...@@ -185,20 +185,19 @@ static int __create_free_space_inode(struct btrfs_root *root, ...@@ -185,20 +185,19 @@ static int __create_free_space_inode(struct btrfs_root *root,
return 0; return 0;
} }
int create_free_space_inode(struct btrfs_fs_info *fs_info, int create_free_space_inode(struct btrfs_trans_handle *trans,
struct btrfs_trans_handle *trans,
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;
u64 ino; u64 ino;
ret = btrfs_find_free_objectid(fs_info->tree_root, &ino); ret = btrfs_find_free_objectid(trans->fs_info->tree_root, &ino);
if (ret < 0) if (ret < 0)
return ret; return ret;
return __create_free_space_inode(fs_info->tree_root, trans, path, ino, return __create_free_space_inode(trans->fs_info->tree_root, trans, path,
block_group->key.objectid); ino, block_group->key.objectid);
} }
int btrfs_check_trunc_cache_free_space(struct btrfs_fs_info *fs_info, int btrfs_check_trunc_cache_free_space(struct btrfs_fs_info *fs_info,
......
...@@ -41,8 +41,7 @@ struct btrfs_io_ctl; ...@@ -41,8 +41,7 @@ struct btrfs_io_ctl;
struct inode *lookup_free_space_inode(struct btrfs_fs_info *fs_info, struct inode *lookup_free_space_inode(struct btrfs_fs_info *fs_info,
struct btrfs_block_group_cache struct btrfs_block_group_cache
*block_group, struct btrfs_path *path); *block_group, struct btrfs_path *path);
int create_free_space_inode(struct btrfs_fs_info *fs_info, int create_free_space_inode(struct btrfs_trans_handle *trans,
struct btrfs_trans_handle *trans,
struct btrfs_block_group_cache *block_group, struct btrfs_block_group_cache *block_group,
struct btrfs_path *path); struct btrfs_path *path);
......
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