[PATCH 2/3] block: Rename disk_set_zoned()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux