btrfs: move btrfs_free_excluded_extents() into block-group.c
authorFilipe Manana <fdmanana@suse.com>
Fri, 30 Jun 2023 15:03:51 +0000 (16:03 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Aug 2023 12:52:13 +0000 (14:52 +0200)
The function btrfs_free_excluded_extents() is only used by block-group.c,
so move it into block-group.c and make it static. Also removed unnecessary
variables that are used only once.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/block-group.c
fs/btrfs/extent-tree.c
fs/btrfs/extent-tree.h

index 3cbd80b..a127865 100644 (file)
@@ -835,6 +835,12 @@ out:
        return ret;
 }
 
+static inline void btrfs_free_excluded_extents(const struct btrfs_block_group *bg)
+{
+       clear_extent_bits(&bg->fs_info->excluded_extents, bg->start,
+                         bg->start + bg->length - 1, EXTENT_UPTODATE);
+}
+
 static noinline void caching_thread(struct btrfs_work *work)
 {
        struct btrfs_block_group *block_group;
index 1a0fb15..d674e42 100644 (file)
@@ -69,18 +69,6 @@ static int block_group_bits(struct btrfs_block_group *cache, u64 bits)
        return (cache->flags & bits) == bits;
 }
 
-void btrfs_free_excluded_extents(struct btrfs_block_group *cache)
-{
-       struct btrfs_fs_info *fs_info = cache->fs_info;
-       u64 start, end;
-
-       start = cache->start;
-       end = start + cache->length - 1;
-
-       clear_extent_bits(&fs_info->excluded_extents, start, end,
-                         EXTENT_UPTODATE);
-}
-
 /* simple helper to search for an existing data extent at a given offset */
 int btrfs_lookup_data_extent(struct btrfs_fs_info *fs_info, u64 start, u64 len)
 {
index 3b2f265..b9e148a 100644 (file)
@@ -96,7 +96,6 @@ int btrfs_get_extent_inline_ref_type(const struct extent_buffer *eb,
                                     enum btrfs_inline_ref_type is_data);
 u64 hash_extent_data_ref(u64 root_objectid, u64 owner, u64 offset);
 
-void btrfs_free_excluded_extents(struct btrfs_block_group *cache);
 int btrfs_run_delayed_refs(struct btrfs_trans_handle *trans, unsigned long count);
 void btrfs_cleanup_ref_head_accounting(struct btrfs_fs_info *fs_info,
                                  struct btrfs_delayed_ref_root *delayed_refs,