]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: handle space_info setting of bg in btrfs_add_bg_to_space_info
authorJosef Bacik <josef@toxicpanda.com>
Fri, 15 Jul 2022 19:45:23 +0000 (15:45 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 26 Sep 2022 10:27:54 +0000 (12:27 +0200)
commit723de71d41f50709eaf2eef1b08aa409687a3c97
tree3353865eb66ededaa5cd2d1986ae9e8f54c07978
parent9d4b0a129a0d081821f21edccad154f8e2a1b747
btrfs: handle space_info setting of bg in btrfs_add_bg_to_space_info

We previously had the pattern of

btrfs_update_space_info(all, the, bg, fields, &space_info);
link_block_group(bg);
bg->space_info = space_info;

Now that we're passing the bg into btrfs_add_bg_to_space_info we can do
the linking in that function, transforming this to simply

btrfs_add_bg_to_space_info(fs_info, bg);

and put the link_block_group() and bg->space_info assignment directly in
btrfs_add_bg_to_space_info.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/block-group.c
fs/btrfs/space-info.c
fs/btrfs/space-info.h