diff mbox series

btrfs-progs: remove max_zone_append_size logic

Message ID 20210923124221.14530-1-johannes.thumshirn@wdc.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: remove max_zone_append_size logic | expand

Commit Message

Johannes Thumshirn Sept. 23, 2021, 12:42 p.m. UTC
max_zone_append_size is unused and can as well be removed just like we did
on the kernel side.

Keep one sanity check though, so we're not adding devices to a zoned FS
that aren't supporting zone append.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
 kernel-shared/ctree.h |  3 ---
 kernel-shared/zoned.c | 10 +---------
 kernel-shared/zoned.h |  1 -
 3 files changed, 1 insertion(+), 13 deletions(-)

Comments

David Sterba Sept. 23, 2021, 7:19 p.m. UTC | #1
On Thu, Sep 23, 2021 at 09:42:21PM +0900, Johannes Thumshirn wrote:
> max_zone_append_size is unused and can as well be removed just like we did
> on the kernel side.
> 
> Keep one sanity check though, so we're not adding devices to a zoned FS
> that aren't supporting zone append.
> 
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

Added to devel, thanks.
diff mbox series

Patch

diff --git a/kernel-shared/ctree.h b/kernel-shared/ctree.h
index e79b1e4ced60..8d8521b9d021 100644
--- a/kernel-shared/ctree.h
+++ b/kernel-shared/ctree.h
@@ -1238,9 +1238,6 @@  struct btrfs_fs_info {
 		u64 zone_size;
 		u64 zoned;
 	};
-
-	/* Max size to emit ZONE_APPEND write command */
-	u64 max_zone_append_size;
 };
 
 static inline bool btrfs_is_zoned(const struct btrfs_fs_info *fs_info)
diff --git a/kernel-shared/zoned.c b/kernel-shared/zoned.c
index c245e59249af..2475e7b097ce 100644
--- a/kernel-shared/zoned.c
+++ b/kernel-shared/zoned.c
@@ -303,13 +303,12 @@  static int report_zones(int fd, const char *file,
 
 	/* Allocate the zone information array */
 	zinfo->zone_size = zone_bytes;
-	zinfo->max_zone_append_size = max_zone_append_size(file);
 	zinfo->nr_zones = device_size / zone_bytes;
 	if (device_size & (zone_bytes - 1))
 		zinfo->nr_zones++;
 
 	if (zoned_model(file) != ZONED_NONE &&
-	    zinfo->max_zone_append_size == 0) {
+	    max_zone_append_size(file) == 0) {
 		error(
 		"zoned: device %s does not support ZONE_APPEND command", file);
 		exit(1);
@@ -1106,7 +1105,6 @@  int btrfs_check_zoned_mode(struct btrfs_fs_info *fs_info)
 	u64 zoned_devices = 0;
 	u64 nr_devices = 0;
 	u64 zone_size = 0;
-	u64 max_zone_append_size = 0;
 	const bool incompat_zoned = btrfs_fs_incompat(fs_info, ZONED);
 	int ret = 0;
 
@@ -1141,11 +1139,6 @@  int btrfs_check_zoned_mode(struct btrfs_fs_info *fs_info)
 				ret = -EINVAL;
 				goto out;
 			}
-			if (!max_zone_append_size ||
-			    (zone_info->max_zone_append_size &&
-			     zone_info->max_zone_append_size < max_zone_append_size))
-				max_zone_append_size =
-					zone_info->max_zone_append_size;
 		}
 		nr_devices++;
 	}
@@ -1191,7 +1184,6 @@  int btrfs_check_zoned_mode(struct btrfs_fs_info *fs_info)
 	}
 
 	fs_info->zone_size = zone_size;
-	fs_info->max_zone_append_size = max_zone_append_size;
 	fs_info->fs_devices->chunk_alloc_policy = BTRFS_CHUNK_ALLOC_ZONED;
 
 out:
diff --git a/kernel-shared/zoned.h b/kernel-shared/zoned.h
index 99f8e9a2faac..1e4956475db9 100644
--- a/kernel-shared/zoned.h
+++ b/kernel-shared/zoned.h
@@ -51,7 +51,6 @@  enum btrfs_zoned_model {
 struct btrfs_zoned_device_info {
 	enum btrfs_zoned_model	model;
 	u64			zone_size;
-	u64		        max_zone_append_size;
 	u32			nr_zones;
 	struct blk_zone		*zones;
 };