Linux kernel 5.9 introduced a new sysfs attribute "max_active_zones". It
is an attribute of zoned block devices which indicates the limit of zones
in open or close status. To refer the attribute from test cases,
introduce the helper function _test_dev_max_active_zones(). If the
attribute is available, the function returns the attribute value.
Otherwise, returns 0 to indicate that the device does not have the limit.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
[[ -n ${TEST_DEV_PART_SYSFS} ]]
}
+_test_dev_max_active_zones() {
+ if [[ -r "${TEST_DEV_SYSFS}/queue/max_active_zones" ]]; then
+ _test_dev_queue_get max_active_zones
+ else
+ echo 0
+ fi
+}
+
_require_test_dev_is_partition() {
if ! _test_dev_is_partition; then
SKIP_REASON="${TEST_DEV} is not a partition device"