ioengines: add get_max_open_zones zoned block device operation
authorNiklas Cassel <niklas.cassel@wdc.com>
Fri, 14 May 2021 12:53:14 +0000 (12:53 +0000)
committerJens Axboe <axboe@kernel.dk>
Fri, 14 May 2021 14:57:31 +0000 (08:57 -0600)
commitd2f442bc0bd507510089d56cd510616093415702
tree2ab78b1fea66d18c9a758d4b7f4820353889ff3d
parenteaa45783ef5079884f96813e74c6b450dc52d0f0
ioengines: add get_max_open_zones zoned block device operation

Define a new IO engine operation to get the maximum number of open zones.
Like the existing IO engine operations: .get_zoned_model, .report_zones,
and .reset_wp, this new IO engine operation is only valid for zoned block
devices.

Similarly to the other zbd IO engine operations, also provide a default
implementation inside oslib/linux-blkzoned.c that will be used if the
ioengine does not override it.

The default Linux oslib implementation is implemented similarly to
blkzoned_get_zoned_model(), i.e. it will return a successful error code
even when the sysfs attribute does not exist.
This is because the sysfs max_open_zones attribute was introduced first
in Linux v5.9.
All error handling is still there, so an ioengine that provides its own
implementation will still have its error code respected properly.

Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
engines/skeleton_external.c
ioengines.h
oslib/blkzoned.h
oslib/linux-blkzoned.c
zbd.c