]> www.infradead.org Git - users/hch/configfs.git/commitdiff
btrfs: move btrfs_block_group_root() to block-group.c
authorAnand Jain <anand.jain@oracle.com>
Sun, 19 May 2024 00:14:56 +0000 (08:14 +0800)
committerDavid Sterba <dsterba@suse.com>
Thu, 11 Jul 2024 13:33:18 +0000 (15:33 +0200)
The function btrfs_block_group_root() is declared in disk-io.c; however,
all its callers are in block-group.c. Move it to the latter file and
declare it static.

Reviewed-by: Naohiro Aota <naohiro.aota@wdc.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/block-group.c
fs/btrfs/disk-io.c
fs/btrfs/disk-io.h

index 60066822b53298b0b4d0bbe73da2b314c6f1af85..db666f9807eae4ab2ce29b436d63e033f4e09f72 100644 (file)
@@ -1022,6 +1022,13 @@ static void clear_incompat_bg_bits(struct btrfs_fs_info *fs_info, u64 flags)
        }
 }
 
+static struct btrfs_root *btrfs_block_group_root(struct btrfs_fs_info *fs_info)
+{
+       if (btrfs_fs_compat_ro(fs_info, BLOCK_GROUP_TREE))
+               return fs_info->block_group_root;
+       return btrfs_extent_root(fs_info, 0);
+}
+
 static int remove_block_group_item(struct btrfs_trans_handle *trans,
                                   struct btrfs_path *path,
                                   struct btrfs_block_group *block_group)
index 1ab9169f1dc9a78e7e4a2c2b80e9346ee032ebba..748b94b3c9812deca120ae7fe23408caeb506bbb 100644 (file)
@@ -846,13 +846,6 @@ struct btrfs_root *btrfs_extent_root(struct btrfs_fs_info *fs_info, u64 bytenr)
        return btrfs_global_root(fs_info, &key);
 }
 
-struct btrfs_root *btrfs_block_group_root(struct btrfs_fs_info *fs_info)
-{
-       if (btrfs_fs_compat_ro(fs_info, BLOCK_GROUP_TREE))
-               return fs_info->block_group_root;
-       return btrfs_extent_root(fs_info, 0);
-}
-
 struct btrfs_root *btrfs_create_tree(struct btrfs_trans_handle *trans,
                                     u64 objectid)
 {
index 76eb53fe7a11452c13c6d539d8a8304534b1502b..1f93feae18723ef4aeaea95f9b8651424c2d88ba 100644 (file)
@@ -83,7 +83,6 @@ struct btrfs_root *btrfs_global_root(struct btrfs_fs_info *fs_info,
                                     struct btrfs_key *key);
 struct btrfs_root *btrfs_csum_root(struct btrfs_fs_info *fs_info, u64 bytenr);
 struct btrfs_root *btrfs_extent_root(struct btrfs_fs_info *fs_info, u64 bytenr);
-struct btrfs_root *btrfs_block_group_root(struct btrfs_fs_info *fs_info);
 
 void btrfs_free_fs_info(struct btrfs_fs_info *fs_info);
 void btrfs_btree_balance_dirty(struct btrfs_fs_info *fs_info);