btrfs: temporarily export fragment_free_space
authorJosef Bacik <josef@toxicpanda.com>
Thu, 20 Jun 2019 19:37:51 +0000 (15:37 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 9 Sep 2019 12:59:04 +0000 (14:59 +0200)
This is used in caching and reading block groups, so export it while we
move these chunks independently.

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.h
fs/btrfs/extent-tree.c

index 3f8b6ffefb8ae863cef1be3b43a53aeb084bf448..ef101fd5215818a9d0b8f65625b1826b7caa9d2d 100644 (file)
@@ -149,6 +149,7 @@ static inline int btrfs_should_fragment_free_space(
               (btrfs_test_opt(fs_info, FRAGMENT_DATA) &&
                block_group->flags &  BTRFS_BLOCK_GROUP_DATA);
 }
+void btrfs_fragment_free_space(struct btrfs_block_group_cache *block_group);
 #endif
 
 struct btrfs_block_group_cache *btrfs_lookup_first_block_group(
index dab8e90237cda35fd30356e99da6a1c5e5f24f2c..6cae152a481267f396e5fadf90c794d616e9ac36 100644 (file)
@@ -206,7 +206,7 @@ void btrfs_put_caching_control(struct btrfs_caching_control *ctl)
 }
 
 #ifdef CONFIG_BTRFS_DEBUG
-static void fragment_free_space(struct btrfs_block_group_cache *block_group)
+void btrfs_fragment_free_space(struct btrfs_block_group_cache *block_group)
 {
        struct btrfs_fs_info *fs_info = block_group->fs_info;
        u64 start = block_group->key.objectid;
@@ -443,7 +443,7 @@ static noinline void caching_thread(struct btrfs_work *work)
                block_group->space_info->bytes_used += bytes_used >> 1;
                spin_unlock(&block_group->lock);
                spin_unlock(&block_group->space_info->lock);
-               fragment_free_space(block_group);
+               btrfs_fragment_free_space(block_group);
        }
 #endif
 
@@ -550,7 +550,7 @@ int btrfs_cache_block_group(struct btrfs_block_group_cache *cache,
                        cache->space_info->bytes_used += bytes_used >> 1;
                        spin_unlock(&cache->lock);
                        spin_unlock(&cache->space_info->lock);
-                       fragment_free_space(cache);
+                       btrfs_fragment_free_space(cache);
                }
 #endif
                mutex_unlock(&caching_ctl->mutex);
@@ -7968,7 +7968,7 @@ int btrfs_make_block_group(struct btrfs_trans_handle *trans, u64 bytes_used,
                u64 new_bytes_used = size - bytes_used;
 
                bytes_used += new_bytes_used >> 1;
-               fragment_free_space(cache);
+               btrfs_fragment_free_space(cache);
        }
 #endif
        /*