t/zbd: add max_active_zone variable
[fio.git] / t / zbd / functions
index fe5b3397f5a5688adaa2b9504667ab011100ef13..529e7944a2f8f3fba7f4e642e1bc283cfe7a20f9 100644 (file)
@@ -239,6 +239,18 @@ max_open_zones() {
     fi
 }
 
+# If sysfs provides, get max_active_zones limit of the zoned block device.
+max_active_zones() {
+       local dev=$1
+       local sys_queue="/sys/block/${dev##*/}/queue/"
+
+       if [[ -e "$sys_queue/max_active_zones" ]]; then
+               cat "$sys_queue/max_active_zones"
+               return
+       fi
+       echo 0
+}
+
 # Get minimum block size to write to seq zones. Refer the sysfs attribute
 # zone_write_granularity which shows the valid minimum size regardless of zoned
 # block device type. If the sysfs attribute is not available, refer physical