OSDN Git Service

btrfs: Remove fs_info from btrfs_make_block_group
authorNikolay Borisov <nborisov@suse.com>
Wed, 20 Jun 2018 12:48:55 +0000 (15:48 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 6 Aug 2018 11:12:34 +0000 (13:12 +0200)
This function is always called with a valid transaction handle from
where we can reference the fs_info. No functional changes.

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/volumes.c

index e671a1f..b77f9ac 100644 (file)
@@ -2716,8 +2716,8 @@ int btrfs_free_block_groups(struct btrfs_fs_info *info);
 int btrfs_read_block_groups(struct btrfs_fs_info *info);
 int btrfs_can_relocate(struct btrfs_fs_info *fs_info, u64 bytenr);
 int btrfs_make_block_group(struct btrfs_trans_handle *trans,
-                          struct btrfs_fs_info *fs_info, u64 bytes_used,
-                          u64 type, u64 chunk_offset, u64 size);
+                          u64 bytes_used, u64 type, u64 chunk_offset,
+                          u64 size);
 void btrfs_add_raid_kobjects(struct btrfs_fs_info *fs_info);
 struct btrfs_trans_handle *btrfs_start_trans_remove_block_group(
                                struct btrfs_fs_info *fs_info,
index 1058668..fa78a01 100644 (file)
@@ -10241,10 +10241,10 @@ next:
        trans->can_flush_pending_bgs = can_flush_pending_bgs;
 }
 
-int btrfs_make_block_group(struct btrfs_trans_handle *trans,
-                          struct btrfs_fs_info *fs_info, u64 bytes_used,
+int btrfs_make_block_group(struct btrfs_trans_handle *trans, u64 bytes_used,
                           u64 type, u64 chunk_offset, u64 size)
 {
+       struct btrfs_fs_info *fs_info = trans->fs_info;
        struct btrfs_block_group_cache *cache;
        int ret;
 
index 1da1629..e806669 100644 (file)
@@ -4900,7 +4900,7 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
        refcount_inc(&em->refs);
        write_unlock(&em_tree->lock);
 
-       ret = btrfs_make_block_group(trans, info, 0, type, start, num_bytes);
+       ret = btrfs_make_block_group(trans, 0, type, start, num_bytes);
        if (ret)
                goto error_del_extent;
 
@@ -5175,7 +5175,7 @@ int btrfs_num_copies(struct btrfs_fs_info *fs_info, u64 logical, u64 len)
                /*
                 * There could be two corrupted data stripes, we need
                 * to loop retry in order to rebuild the correct data.
-                * 
+                *
                 * Fail a stripe at a time on every retry except the
                 * stripe under reconstruction.
                 */