summaryrefslogtreecommitdiffstats
path: root/drivers/block
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 /drivers/block
parente94f5819448c5b75829662eaa9c25c17868846cf (diff)
downloadlinux-stable-ae58954d8734c44298f55ed71e683ea944994fab.tar.gz
linux-stable-ae58954d8734c44298f55ed71e683ea944994fab.tar.bz2
linux-stable-ae58954d8734c44298f55ed71e683ea944994fab.zip
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 'drivers/block')
-rw-r--r--drivers/block/null_blk_main.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/block/null_blk_main.c b/drivers/block/null_blk_main.c
index dd6026289fbf..068cd0ae6e2c 100644
--- a/drivers/block/null_blk_main.c
+++ b/drivers/block/null_blk_main.c
@@ -1576,11 +1576,17 @@ static int null_gendisk_register(struct nullb *nullb)
disk->queue = nullb->q;
strncpy(disk->disk_name, nullb->disk_name, DISK_NAME_LEN);
+#ifdef CONFIG_BLK_DEV_ZONED
if (nullb->dev->zoned) {
- ret = blk_revalidate_disk_zones(disk);
- if (ret)
- return ret;
+ if (queue_is_mq(nullb->q)) {
+ ret = blk_revalidate_disk_zones(disk);
+ if (ret)
+ return ret;
+ } else {
+ nullb->q->nr_zones = blkdev_nr_zones(disk);
+ }
}
+#endif
add_disk(disk);
return 0;