common/rc: introduce zone check commands

Introduce some zone related helper functions: _zone_type(),
_require_zoned_device(), and _require_non_zoned_device(). They all
take a device path as an argument.

_zone_type() return the zone type of the device according to the
value returned from "/sys/block/<disk>/queue/zoned". See
Documentation/ABI/testing/sysfs-block for a detail.

_require_zoned_device() checks if the device is zoned. If not, it
skips the current test. _require_non_zoned_device() does the

Signed-off-by: Naohiro Aota <>
Reviewed-by: Eryu Guan <>
Signed-off-by: Eryu Guan <>
1 file changed