diff mbox series

[03/10] btrfs: move btrfs_can_zone_reset into extent-tree.c

Message ID ee8a825f6de91a3b8ee7d4594cc62e8c4e71057c.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 helper is only used in extent-tree.c to decide if we need to zone
reset for a discard.  Move it out of zoned.h locally to extent-tree.c.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/extent-tree.c | 15 +++++++++++++++
 fs/btrfs/zoned.h       | 15 ---------------
 2 files changed, 15 insertions(+), 15 deletions(-)

Comments

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

Patch

diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 7cf7844c9dba..0785c1491313 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -1271,6 +1271,21 @@  static int btrfs_issue_discard(struct block_device *bdev, u64 start, u64 len,
 	return ret;
 }
 
+static inline bool btrfs_can_zone_reset(struct btrfs_device *device,
+					u64 physical, u64 length)
+{
+	u64 zone_size;
+
+	if (!btrfs_dev_is_sequential(device, physical))
+		return false;
+
+	zone_size = device->zone_info->zone_size;
+	if (!IS_ALIGNED(physical, zone_size) || !IS_ALIGNED(length, zone_size))
+		return false;
+
+	return true;
+}
+
 static int do_discard_extent(struct btrfs_discard_stripe *stripe, u64 *bytes)
 {
 	struct btrfs_device *dev = stripe->dev;
diff --git a/fs/btrfs/zoned.h b/fs/btrfs/zoned.h
index 20d7f35406d4..aabdd364e889 100644
--- a/fs/btrfs/zoned.h
+++ b/fs/btrfs/zoned.h
@@ -320,21 +320,6 @@  static inline bool btrfs_check_super_location(struct btrfs_device *device, u64 p
 	return device->zone_info == NULL || !btrfs_dev_is_sequential(device, pos);
 }
 
-static inline bool btrfs_can_zone_reset(struct btrfs_device *device,
-					u64 physical, u64 length)
-{
-	u64 zone_size;
-
-	if (!btrfs_dev_is_sequential(device, physical))
-		return false;
-
-	zone_size = device->zone_info->zone_size;
-	if (!IS_ALIGNED(physical, zone_size) || !IS_ALIGNED(length, zone_size))
-		return false;
-
-	return true;
-}
-
 static inline void btrfs_zoned_meta_io_lock(struct btrfs_fs_info *fs_info)
 {
 	if (!btrfs_is_zoned(fs_info))