]> git.baikalelectronics.ru Git - kernel.git/commitdiff
block: pass a gendisk to blk_queue_clear_zone_settings
authorChristoph Hellwig <hch@lst.de>
Wed, 6 Jul 2022 07:03:41 +0000 (09:03 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 6 Jul 2022 12:46:26 +0000 (06:46 -0600)
Switch to a gendisk based API in preparation for moving all zone related
fields from the request_queue to the gendisk.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20220706070350.1703384-8-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-settings.c
block/blk-zoned.c
block/blk.h

index 35b7bba306a8354b0ebafc81039f84a5e766ccb2..8bb9eef5310eb040780ca42db0feb1655dc2db68 100644 (file)
@@ -946,7 +946,7 @@ void disk_set_zoned(struct gendisk *disk, enum blk_zoned_model model)
                blk_queue_zone_write_granularity(q,
                                                queue_logical_block_size(q));
        } else {
-               blk_queue_clear_zone_settings(q);
+               disk_clear_zone_settings(disk);
        }
 }
 EXPORT_SYMBOL_GPL(disk_set_zoned);
index 90a5c9cc80ab36a2d0b61f70b6ad3a8ef80aff45..82a4fa89678ce438663febb8c7e7f57a82ddb6c1 100644 (file)
@@ -622,8 +622,10 @@ int blk_revalidate_disk_zones(struct gendisk *disk,
 }
 EXPORT_SYMBOL_GPL(blk_revalidate_disk_zones);
 
-void blk_queue_clear_zone_settings(struct request_queue *q)
+void disk_clear_zone_settings(struct gendisk *disk)
 {
+       struct request_queue *q = disk->queue;
+
        blk_mq_freeze_queue(q);
 
        blk_queue_free_zone_bitmaps(q);
index 58ad50cacd2d5bd3759d70cbe0b1d7b64ad3d57f..7482a3a441dd91ffc6329981257d615069b2dfa5 100644 (file)
@@ -406,10 +406,10 @@ static inline int blk_iolatency_init(struct request_queue *q) { return 0; }
 
 #ifdef CONFIG_BLK_DEV_ZONED
 void blk_queue_free_zone_bitmaps(struct request_queue *q);
-void blk_queue_clear_zone_settings(struct request_queue *q);
+void disk_clear_zone_settings(struct gendisk *disk);
 #else
 static inline void blk_queue_free_zone_bitmaps(struct request_queue *q) {}
-static inline void blk_queue_clear_zone_settings(struct request_queue *q) {}
+static inline void disk_clear_zone_settings(struct gendisk *disk) {}
 #endif
 
 int blk_alloc_ext_minor(void);