@@ -4178,3 +4178,9 @@ void btrfs_dec_block_group_swap_extents(struct btrfs_block_group *bg, int amount
bg->swap_extents -= amount;
spin_unlock(&bg->lock);
}
+
+bool btrfs_zoned_bg_is_full(const struct btrfs_block_group *bg)
+{
+ ASSERT(btrfs_is_zoned(bg->fs_info));
+ return (bg->alloc_offset == bg->zone_capacity);
+}
@@ -322,6 +322,7 @@ int btrfs_free_block_groups(struct btrfs_fs_info *info);
int btrfs_rmap_block(struct btrfs_fs_info *fs_info, u64 chunk_start,
struct block_device *bdev, u64 physical, u64 **logical,
int *naddrs, int *stripe_len);
+bool btrfs_zoned_bg_is_full(const struct btrfs_block_group *bg);
static inline u64 btrfs_data_alloc_profile(struct btrfs_fs_info *fs_info)
{
@@ -312,11 +312,4 @@ static inline void btrfs_dev_clear_zone_empty(struct btrfs_device *device, u64 p
{
btrfs_dev_set_empty_zone_bit(device, pos, false);
}
-
-static inline bool btrfs_zoned_bg_is_full(const struct btrfs_block_group *bg)
-{
- ASSERT(btrfs_is_zoned(bg->fs_info));
- return (bg->alloc_offset == bg->zone_capacity);
-}
-
#endif
This function is completely related to block groups, as well as using ASSERT() which isn't defined in either zoned.h or block-group.h. Move the code to block-group.c to make sure the headers are only using code they define themselves. Signed-off-by: Josef Bacik <josef@toxicpanda.com> --- fs/btrfs/block-group.c | 6 ++++++ fs/btrfs/block-group.h | 1 + fs/btrfs/zoned.h | 7 ------- 3 files changed, 7 insertions(+), 7 deletions(-)