]> 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)
commitb70425998671cf4e1f422cb53afee8272af71d92
tree858cb365d8459eed119c9e51371ee25d99d53e2a
parente7d69ad26b11f6b78f003ba3625f7c907424ffbc
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