diff mbox series

[2/3] block: Rename disk_set_zoned()

Message ID 20240301192639.410183-3-dlemoal@kernel.org (mailing list archive)
State New, archived
Headers show
Series queue limits cleanup | expand

Commit Message

Damien Le Moal March 1, 2024, 7:26 p.m. UTC
The disk_set_zoned() function operates on the zoned request queue limit
of a block device and does not change anything to the gendisk of the
device. To reflect this behavior and to be consistent with other request
queue limit setting functions, rename disk_set_zoned() to
blk_queue_zoned().

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
---
 block/blk-settings.c    | 10 ++++------
 drivers/nvme/host/zns.c |  2 +-
 drivers/scsi/sd.c       |  2 +-
 include/linux/blkdev.h  |  4 ++--
 4 files changed, 8 insertions(+), 10 deletions(-)

Comments

Christoph Hellwig March 2, 2024, 2:07 p.m. UTC | #1
On Sat, Mar 02, 2024 at 04:26:38AM +0900, Damien Le Moal wrote:
> The disk_set_zoned() function operates on the zoned request queue limit
> of a block device and does not change anything to the gendisk of the
> device. To reflect this behavior and to be consistent with other request
> queue limit setting functions, rename disk_set_zoned() to
> blk_queue_zoned().

Can we just hold this off a bit?  I have the big nvme queue limits series
that removes the zns usage, and early next merge window scsi will be
converted as well and this function will go away entirely.
Damien Le Moal March 4, 2024, 11:41 p.m. UTC | #2
On 3/2/24 23:07, Christoph Hellwig wrote:
> On Sat, Mar 02, 2024 at 04:26:38AM +0900, Damien Le Moal wrote:
>> The disk_set_zoned() function operates on the zoned request queue limit
>> of a block device and does not change anything to the gendisk of the
>> device. To reflect this behavior and to be consistent with other request
>> queue limit setting functions, rename disk_set_zoned() to
>> blk_queue_zoned().
> 
> Can we just hold this off a bit?  I have the big nvme queue limits series
> that removes the zns usage, and early next merge window scsi will be
> converted as well and this function will go away entirely.

I suspected as much, but sent the patches anyway.. Fine with me !
diff mbox series

Patch

diff --git a/block/blk-settings.c b/block/blk-settings.c
index 13865a9f8972..a5102b1cd006 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -1108,13 +1108,11 @@  bool blk_queue_can_use_dma_map_merging(struct request_queue *q,
 EXPORT_SYMBOL_GPL(blk_queue_can_use_dma_map_merging);
 
 /**
- * disk_set_zoned - inidicate a zoned device
- * @disk:	gendisk to configure
+ * blk_queue_zoned - indicate a zoned device
+ * @q:		the request queue for the device
  */
-void disk_set_zoned(struct gendisk *disk)
+void blk_queue_zoned(struct request_queue *q)
 {
-	struct request_queue *q = disk->queue;
-
 	WARN_ON_ONCE(!IS_ENABLED(CONFIG_BLK_DEV_ZONED));
 
 	/*
@@ -1124,7 +1122,7 @@  void disk_set_zoned(struct gendisk *disk)
 	q->limits.zoned = true;
 	blk_queue_zone_write_granularity(q, queue_logical_block_size(q));
 }
-EXPORT_SYMBOL_GPL(disk_set_zoned);
+EXPORT_SYMBOL_GPL(blk_queue_zoned);
 
 int bdev_alignment_offset(struct block_device *bdev)
 {
diff --git a/drivers/nvme/host/zns.c b/drivers/nvme/host/zns.c
index 499bbb0eee8d..96d9206efc5e 100644
--- a/drivers/nvme/host/zns.c
+++ b/drivers/nvme/host/zns.c
@@ -109,7 +109,7 @@  int nvme_update_zone_info(struct nvme_ns *ns, unsigned lbaf)
 		goto free_data;
 	}
 
-	disk_set_zoned(ns->disk);
+	blk_queue_zoned(q);
 	blk_queue_flag_set(QUEUE_FLAG_ZONE_RESETALL, q);
 	disk_set_max_open_zones(ns->disk, le32_to_cpu(id->mor) + 1);
 	disk_set_max_active_zones(ns->disk, le32_to_cpu(id->mar) + 1);
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 0833b3e6aa6e..477451a36038 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -3141,7 +3141,7 @@  static void sd_read_block_characteristics(struct scsi_disk *sdkp)
 		/*
 		 * Host-managed.
 		 */
-		disk_set_zoned(sdkp->disk);
+		blk_queue_zoned(q);
 
 		/*
 		 * Per ZBC and ZAC specifications, writes in sequential write
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 285e82723d64..1081c2d9e6bd 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -321,8 +321,6 @@  struct queue_limits {
 typedef int (*report_zones_cb)(struct blk_zone *zone, unsigned int idx,
 			       void *data);
 
-void disk_set_zoned(struct gendisk *disk);
-
 #define BLK_ALL_ZONES  ((unsigned int)-1)
 int blkdev_report_zones(struct block_device *bdev, sector_t sector,
 		unsigned int nr_zones, report_zones_cb cb, void *data);
@@ -610,6 +608,8 @@  static inline enum rpm_status queue_rpm_status(struct request_queue *q)
 }
 #endif
 
+void blk_queue_zoned(struct request_queue *q);
+
 static inline bool blk_queue_is_zoned(struct request_queue *q)
 {
 	return IS_ENABLED(CONFIG_BLK_DEV_ZONED) && q->limits.zoned;