All of lore.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Jens Axboe <axboe@kernel.dk>, linux-block@vger.kernel.org
Cc: Christoph Hellwig <hch@lst.de>
Subject: [PATCH 2/3] block: Rename disk_set_zoned()
Date: Sat,  2 Mar 2024 04:26:38 +0900	[thread overview]
Message-ID: <20240301192639.410183-3-dlemoal@kernel.org> (raw)
In-Reply-To: <20240301192639.410183-1-dlemoal@kernel.org>

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

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;
-- 
2.44.0


  parent reply	other threads:[~2024-03-01 19:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-01 19:26 [PATCH 0/3] queue limits cleanup Damien Le Moal
2024-03-01 19:26 ` [PATCH 1/3] virtio_blk: Do not use disk_set_max_open/active_zones() Damien Le Moal
2024-03-02 14:06   ` Christoph Hellwig
2024-03-04  7:49   ` Johannes Thumshirn
2024-03-01 19:26 ` Damien Le Moal [this message]
2024-03-02 14:07   ` [PATCH 2/3] block: Rename disk_set_zoned() Christoph Hellwig
2024-03-04 23:41     ` Damien Le Moal
2024-03-01 19:26 ` [PATCH 3/3] block: Rename disk_set_max_open/active_zones() Damien Le Moal
2024-03-02 14:08   ` Christoph Hellwig
2024-03-06 15:35 ` (subset) [PATCH 0/3] queue limits cleanup Jens Axboe

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=20240301192639.410183-3-dlemoal@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-block@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.