]> git.baikalelectronics.ru Git - kernel.git/commit
null_blk: add support for max open/active zone limit for zoned devices
authorNiklas Cassel <niklas.cassel@wdc.com>
Fri, 28 Aug 2020 10:54:00 +0000 (12:54 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 29 Sep 2020 14:12:48 +0000 (08:12 -0600)
commit70918fc785f3d5268ab622812b530e65caddbb58
treed4af6747f5f4c0e9561e5dcee4117959d69cb849
parent9626d7738dbf2414ed2d5b43ba1a72ca1355ea2c
null_blk: add support for max open/active zone limit for zoned devices

Add support for user space to set a max open zone and a max active zone
limit via configfs. By default, the default values are 0 == no limit.

Call the block layer API functions used for exposing the configured
limits to sysfs.

Add accounting in null_blk_zoned so that these new limits are respected.
Performing an operation that would exceed these limits results in a
standard I/O error.

A max open zone limit exists in the ZBC standard.
While null_blk_zoned is used to test the Zoned Block Device model in
Linux, when it comes to differences between ZBC and ZNS, null_blk_zoned
mostly follows ZBC.

Therefore, implement the manage open zone resources function from ZBC,
but additionally add support for max active zones.
This enables user space not only to test against a device with an open
zone limit, but also to test against a device with an active zone limit.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/null_blk.h
drivers/block/null_blk_main.c
drivers/block/null_blk_zoned.c