]> git.baikalelectronics.ru Git - kernel.git/commit
block: Expose queue nr_zones in sysfs
authorDamien Le Moal <damien.lemoal@wdc.com>
Fri, 12 Oct 2018 10:08:48 +0000 (19:08 +0900)
committerJens Axboe <axboe@kernel.dk>
Thu, 25 Oct 2018 17:17:40 +0000 (11:17 -0600)
commite5a478fc57666c4e1aa5205341e9d9d291def0cb
tree3fc654b827875179138aeeeadd68fd1ebb287771
parent560d36a2fd78063363f186b64e64f40421a6398f
block: Expose queue nr_zones in sysfs

Expose through sysfs the nr_zones field of struct request_queue.
Exposing this value helps in debugging disk issues as well as
facilitating scripts based use of the disk (e.g. blktests).

For zoned block devices, the nr_zones field indicates the total number
of zones of the device calculated using the known disk capacity and
zone size. This number of zones is always 0 for regular block devices.

Since nr_zones is defined conditionally with CONFIG_BLK_DEV_ZONED,
introduce the blk_queue_nr_zones() function to return the correct value
for any device, regardless if CONFIG_BLK_DEV_ZONED is set.

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-sysfs.c
include/linux/blkdev.h