diff mbox series

[08/10] btrfs: move btrfs_zoned_bg_is_full into block-group.c

Message ID 04ad998f1c1c383fd68577abf613ffd8e4622cec.1663196746.git.josef@toxicpanda.com (mailing list archive)
State New, archived
Headers show
Series btrfs: clean up zoned device helpers | expand

Commit Message

Josef Bacik Sept. 14, 2022, 11:07 p.m. UTC
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(-)

Comments

Johannes Thumshirn Sept. 15, 2022, 2:02 p.m. UTC | #1
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
diff mbox series

Patch

diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c
index e21382a13fe4..3a5f29494d98 100644
--- a/fs/btrfs/block-group.c
+++ b/fs/btrfs/block-group.c
@@ -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);
+}
diff --git a/fs/btrfs/block-group.h b/fs/btrfs/block-group.h
index 6c970a486b68..4edf5486a592 100644
--- a/fs/btrfs/block-group.h
+++ b/fs/btrfs/block-group.h
@@ -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)
 {
diff --git a/fs/btrfs/zoned.h b/fs/btrfs/zoned.h
index de1337e462be..a94de42f9edb 100644
--- a/fs/btrfs/zoned.h
+++ b/fs/btrfs/zoned.h
@@ -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