All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josef Bacik <josef@toxicpanda.com>
To: linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: [PATCH 02/10] btrfs: move btrfs_check_device_zone_type into volumes.c
Date: Wed, 14 Sep 2022 19:07:42 -0400	[thread overview]
Message-ID: <a156cf2430eeaf93a748882f49ca9dd1cf7d51d4.1663196746.git.josef@toxicpanda.com> (raw)
In-Reply-To: <cover.1663196746.git.josef@toxicpanda.com>

Now that this is only used in volumes.c move it out of zoned.h locally
to volumes.c.  This is in order to avoid having a helper that uses
functions not defined in zoned.h.

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

diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index ea76458d7c70..29652323ef9b 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -2583,6 +2583,25 @@ static int btrfs_finish_sprout(struct btrfs_trans_handle *trans)
 	return ret;
 }
 
+static inline bool btrfs_check_device_zone_type(const struct btrfs_fs_info *fs_info,
+						struct block_device *bdev)
+{
+	if (btrfs_is_zoned(fs_info)) {
+		/*
+		 * We can allow a regular device on a zoned filesystem, because
+		 * we will emulate the zoned capabilities.
+		 */
+		if (!bdev_is_zoned(bdev))
+			return true;
+
+		return fs_info->zone_size ==
+			(bdev_zone_sectors(bdev) << SECTOR_SHIFT);
+	}
+
+	/* Do not allow Host Manged zoned device */
+	return bdev_zoned_model(bdev) != BLK_ZONED_HM;
+}
+
 struct block_device *btrfs_open_device_for_adding(struct btrfs_fs_info *fs_info,
 						  const char *device_path)
 {
diff --git a/fs/btrfs/zoned.h b/fs/btrfs/zoned.h
index 094f3e44c53c..20d7f35406d4 100644
--- a/fs/btrfs/zoned.h
+++ b/fs/btrfs/zoned.h
@@ -311,25 +311,6 @@ 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_check_device_zone_type(const struct btrfs_fs_info *fs_info,
-						struct block_device *bdev)
-{
-	if (btrfs_is_zoned(fs_info)) {
-		/*
-		 * We can allow a regular device on a zoned filesystem, because
-		 * we will emulate the zoned capabilities.
-		 */
-		if (!bdev_is_zoned(bdev))
-			return true;
-
-		return fs_info->zone_size ==
-			(bdev_zone_sectors(bdev) << SECTOR_SHIFT);
-	}
-
-	/* Do not allow Host Manged zoned device */
-	return bdev_zoned_model(bdev) != BLK_ZONED_HM;
-}
-
 static inline bool btrfs_check_super_location(struct btrfs_device *device, u64 pos)
 {
 	/*
-- 
2.26.3


  parent reply	other threads:[~2022-09-14 23:08 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-14 23:07 [PATCH 00/10] btrfs: clean up zoned device helpers Josef Bacik
2022-09-14 23:07 ` [PATCH 01/10] btrfs: add a helper for opening a new device to add to the fs Josef Bacik
2022-09-15 13:54   ` Johannes Thumshirn
2022-09-21  9:39   ` Pankaj Raghav
2022-09-14 23:07 ` Josef Bacik [this message]
2022-09-15 13:55   ` [PATCH 02/10] btrfs: move btrfs_check_device_zone_type into volumes.c Johannes Thumshirn
2022-09-14 23:07 ` [PATCH 03/10] btrfs: move btrfs_can_zone_reset into extent-tree.c Josef Bacik
2022-09-15 13:56   ` Johannes Thumshirn
2022-09-14 23:07 ` [PATCH 04/10] btrfs: move btrfs_check_super_location into scrub.c Josef Bacik
2022-09-15 13:57   ` Johannes Thumshirn
2022-09-14 23:07 ` [PATCH 05/10] btrfs: move btrfs_zoned_meta_io_*lock to extent_io.c Josef Bacik
2022-09-15 13:58   ` Johannes Thumshirn
2022-09-14 23:07 ` [PATCH 06/10] btrfs: move btrfs_clear_treelog_bg to extent-tree.c Josef Bacik
2022-09-15 14:00   ` Johannes Thumshirn
2022-09-14 23:07 ` [PATCH 07/10] btrfs: move btrfs_zoned_data_reloc_*lock to extent_io.c Josef Bacik
2022-09-15 14:01   ` Johannes Thumshirn
2022-09-14 23:07 ` [PATCH 08/10] btrfs: move btrfs_zoned_bg_is_full into block-group.c Josef Bacik
2022-09-15 14:02   ` Johannes Thumshirn
2022-09-14 23:07 ` [PATCH 09/10] btrfs: make the zoned helpers take btrfs_zoned_device_info Josef Bacik
2022-09-15 14:05   ` Johannes Thumshirn
2022-09-14 23:07 ` [PATCH 10/10] btrfs: delete btrfs_check_super_location helper Josef Bacik
2022-09-15  7:29   ` Naohiro Aota

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a156cf2430eeaf93a748882f49ca9dd1cf7d51d4.1663196746.git.josef@toxicpanda.com \
    --to=josef@toxicpanda.com \
    --cc=kernel-team@fb.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.