]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
btrfs: get fs_info from eb in should_balance_chunk
authorDavid Sterba <dsterba@suse.com>
Wed, 20 Mar 2019 15:38:52 +0000 (16:38 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 29 Apr 2019 17:02:39 +0000 (19:02 +0200)
We can read fs_info from extent buffer and can drop it from the
parameters.

Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c

index 7fabbbae3c62f0bc5ec91b54062f8f8dbef7b4d5..4576f0e69d336183433f5f2d8e8c711997842397 100644 (file)
@@ -3561,10 +3561,10 @@ static int chunk_soft_convert_filter(u64 chunk_type,
        return 0;
 }
 
-static int should_balance_chunk(struct btrfs_fs_info *fs_info,
-                               struct extent_buffer *leaf,
+static int should_balance_chunk(struct extent_buffer *leaf,
                                struct btrfs_chunk *chunk, u64 chunk_offset)
 {
+       struct btrfs_fs_info *fs_info = leaf->fs_info;
        struct btrfs_balance_control *bctl = fs_info->balance_ctl;
        struct btrfs_balance_args *bargs = NULL;
        u64 chunk_type = btrfs_chunk_type(leaf, chunk);
@@ -3744,8 +3744,7 @@ again:
                        spin_unlock(&fs_info->balance_lock);
                }
 
-               ret = should_balance_chunk(fs_info, leaf, chunk,
-                                          found_key.offset);
+               ret = should_balance_chunk(leaf, chunk, found_key.offset);
 
                btrfs_release_path(path);
                if (!ret) {