summaryrefslogtreecommitdiff
path: root/block/blk-zoned.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-12-03 10:39:07 +0100
committerJens Axboe <axboe@kernel.dk>2019-12-03 08:51:25 -0700
commitae58954d8734c44298f55ed71e683ea944994fab (patch)
treeff1253e9b9cbe3550d4930f8a6eeaf6f502cc07d /block/blk-zoned.c
parente94f5819448c5b75829662eaa9c25c17868846cf (diff)
block: don't handle bio based drivers in blk_revalidate_disk_zones
bio based drivers only need to update q->nr_zones. Do that manually instead of overloading blk_revalidate_disk_zones to keep that function simpler for the next round of changes that will rely even more on the request based functionality. Reviewed-by: Javier González <javier@javigon.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-zoned.c')
-rw-r--r--block/blk-zoned.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/block/blk-zoned.c b/block/blk-zoned.c
index 0131f9e14bd1..51d427659ce7 100644
--- a/block/blk-zoned.c
+++ b/block/blk-zoned.c
@@ -419,8 +419,9 @@ static int blk_revalidate_zone_cb(struct blk_zone *zone, unsigned int idx,
*
* Helper function for low-level device drivers to (re) allocate and initialize
* a disk request queue zone bitmaps. This functions should normally be called
- * within the disk ->revalidate method. For BIO based queues, no zone bitmap
- * is allocated.
+ * within the disk ->revalidate method for blk-mq based drivers. For BIO based
+ * drivers only q->nr_zones needs to be updated so that the sysfs exposed value
+ * is correct.
*/
int blk_revalidate_disk_zones(struct gendisk *disk)
{
@@ -433,15 +434,8 @@ int blk_revalidate_disk_zones(struct gendisk *disk)
if (WARN_ON_ONCE(!blk_queue_is_zoned(q)))
return -EIO;
-
- /*
- * BIO based queues do not use a scheduler so only q->nr_zones
- * needs to be updated so that the sysfs exposed value is correct.
- */
- if (!queue_is_mq(q)) {
- q->nr_zones = args.nr_zones;
- return 0;
- }
+ if (WARN_ON_ONCE(!queue_is_mq(q)))
+ return -EIO;
/*
* Ensure that all memory allocations in this context are done as