@@ -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;
@@ -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))
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(-)