OSDN Git Service

btrfs: Remove fs_info from btrfs_force_chunk_alloc
authorNikolay Borisov <nborisov@suse.com>
Wed, 20 Jun 2018 12:49:15 +0000 (15:49 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 6 Aug 2018 11:12:38 +0000 (13:12 +0200)
It can be referenced from the passed transaction handle.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c
fs/btrfs/relocation.c
fs/btrfs/volumes.c

index 5bb083d..12cb327 100644 (file)
@@ -2809,8 +2809,7 @@ int btrfs_error_unpin_extent_range(struct btrfs_fs_info *fs_info,
                                   u64 start, u64 end);
 int btrfs_discard_extent(struct btrfs_fs_info *fs_info, u64 bytenr,
                         u64 num_bytes, u64 *actual_bytes);
-int btrfs_force_chunk_alloc(struct btrfs_trans_handle *trans,
-                           struct btrfs_fs_info *fs_info, u64 type);
+int btrfs_force_chunk_alloc(struct btrfs_trans_handle *trans, u64 type);
 int btrfs_trim_fs(struct btrfs_fs_info *fs_info, struct fstrim_range *range);
 
 int btrfs_init_space_info(struct btrfs_fs_info *fs_info);
index 5e15b0c..472872a 100644 (file)
@@ -9497,10 +9497,9 @@ out:
        return ret;
 }
 
-int btrfs_force_chunk_alloc(struct btrfs_trans_handle *trans,
-                           struct btrfs_fs_info *fs_info, u64 type)
+int btrfs_force_chunk_alloc(struct btrfs_trans_handle *trans, u64 type)
 {
-       u64 alloc_flags = get_alloc_profile(fs_info, type);
+       u64 alloc_flags = get_alloc_profile(trans->fs_info, type);
 
        return do_chunk_alloc(trans, alloc_flags, CHUNK_ALLOC_FORCE);
 }
index ef1b5aa..2221403 100644 (file)
@@ -4169,8 +4169,7 @@ restart:
                }
        }
        if (trans && progress && err == -ENOSPC) {
-               ret = btrfs_force_chunk_alloc(trans, fs_info,
-                                             rc->block_group->flags);
+               ret = btrfs_force_chunk_alloc(trans, rc->block_group->flags);
                if (ret == 1) {
                        err = 0;
                        progress = 0;
index 9795d50..fe49793 100644 (file)
@@ -3059,7 +3059,7 @@ static int btrfs_may_alloc_data_chunk(struct btrfs_fs_info *fs_info,
                        if (IS_ERR(trans))
                                return PTR_ERR(trans);
 
-                       ret = btrfs_force_chunk_alloc(trans, fs_info,
+                       ret = btrfs_force_chunk_alloc(trans,
                                                      BTRFS_BLOCK_GROUP_DATA);
                        btrfs_end_transaction(trans);
                        if (ret < 0)