Commit c216b203 authored by Nikolay Borisov's avatar Nikolay Borisov Committed by David Sterba

btrfs: Remove fs_info from btrfs_alloc_chunk

It can be referenced from trans since the function is always called
within a transaction.
Signed-off-by: default avatarNikolay Borisov <nborisov@suse.com>
Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 01458828
...@@ -4568,7 +4568,7 @@ void check_system_chunk(struct btrfs_trans_handle *trans, ...@@ -4568,7 +4568,7 @@ void check_system_chunk(struct btrfs_trans_handle *trans,
* the paths we visit in the chunk tree (they were already COWed * the paths we visit in the chunk tree (they were already COWed
* or created in the current transaction for example). * or created in the current transaction for example).
*/ */
ret = btrfs_alloc_chunk(trans, fs_info, flags); ret = btrfs_alloc_chunk(trans, flags);
} }
if (!ret) { if (!ret) {
...@@ -4670,7 +4670,7 @@ static int do_chunk_alloc(struct btrfs_trans_handle *trans, u64 flags, ...@@ -4670,7 +4670,7 @@ static int do_chunk_alloc(struct btrfs_trans_handle *trans, u64 flags,
*/ */
check_system_chunk(trans, fs_info, flags); check_system_chunk(trans, fs_info, flags);
ret = btrfs_alloc_chunk(trans, fs_info, flags); ret = btrfs_alloc_chunk(trans, flags);
trans->allocating_chunk = false; trans->allocating_chunk = false;
spin_lock(&space_info->lock); spin_lock(&space_info->lock);
......
...@@ -5038,13 +5038,12 @@ int btrfs_finish_chunk_alloc(struct btrfs_trans_handle *trans, ...@@ -5038,13 +5038,12 @@ int btrfs_finish_chunk_alloc(struct btrfs_trans_handle *trans,
* require modifying the chunk tree. This division is important for the * require modifying the chunk tree. This division is important for the
* bootstrap process of adding storage to a seed btrfs. * bootstrap process of adding storage to a seed btrfs.
*/ */
int btrfs_alloc_chunk(struct btrfs_trans_handle *trans, int btrfs_alloc_chunk(struct btrfs_trans_handle *trans, u64 type)
struct btrfs_fs_info *fs_info, u64 type)
{ {
u64 chunk_offset; u64 chunk_offset;
lockdep_assert_held(&fs_info->chunk_mutex); lockdep_assert_held(&trans->fs_info->chunk_mutex);
chunk_offset = find_next_chunk(fs_info); chunk_offset = find_next_chunk(trans->fs_info);
return __btrfs_alloc_chunk(trans, chunk_offset, type); return __btrfs_alloc_chunk(trans, chunk_offset, type);
} }
......
...@@ -396,8 +396,7 @@ int btrfs_rmap_block(struct btrfs_fs_info *fs_info, u64 chunk_start, ...@@ -396,8 +396,7 @@ int btrfs_rmap_block(struct btrfs_fs_info *fs_info, u64 chunk_start,
u64 physical, u64 **logical, int *naddrs, int *stripe_len); u64 physical, u64 **logical, int *naddrs, int *stripe_len);
int btrfs_read_sys_array(struct btrfs_fs_info *fs_info); int btrfs_read_sys_array(struct btrfs_fs_info *fs_info);
int btrfs_read_chunk_tree(struct btrfs_fs_info *fs_info); int btrfs_read_chunk_tree(struct btrfs_fs_info *fs_info);
int btrfs_alloc_chunk(struct btrfs_trans_handle *trans, int btrfs_alloc_chunk(struct btrfs_trans_handle *trans, u64 type);
struct btrfs_fs_info *fs_info, u64 type);
void btrfs_mapping_init(struct btrfs_mapping_tree *tree); void btrfs_mapping_init(struct btrfs_mapping_tree *tree);
void btrfs_mapping_tree_free(struct btrfs_mapping_tree *tree); void btrfs_mapping_tree_free(struct btrfs_mapping_tree *tree);
blk_status_t btrfs_map_bio(struct btrfs_fs_info *fs_info, struct bio *bio, blk_status_t btrfs_map_bio(struct btrfs_fs_info *fs_info, struct bio *bio,
......
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