]> git.baikalelectronics.ru Git - kernel.git/commit
block: Introduce blkdev_nr_zones() helper
authorDamien Le Moal <damien.lemoal@wdc.com>
Fri, 12 Oct 2018 10:08:43 +0000 (19:08 +0900)
committerJens Axboe <axboe@kernel.dk>
Thu, 25 Oct 2018 17:17:40 +0000 (11:17 -0600)
commit9a0706c065f603fc43393b34394374c87e41445e
tree858cb365d8459eed119c9e51371ee25d99d53e2a
parente51d344457292dfaeebe14e85cf872723762c976
block: Introduce blkdev_nr_zones() helper

Introduce the blkdev_nr_zones() helper function to get the total
number of zones of a zoned block device. This number is always 0 for a
regular block device (q->limits.zoned == BLK_ZONED_NONE case).

Replace hard-coded number of zones calculation in dmz_get_zoned_device()
with a call to this helper.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-zoned.c
drivers/md/dm-zoned-target.c
include/linux/blkdev.h