X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=t%2Fzbd%2Ffunctions;h=4faa45a92df7831776acc752c7ae81e7440d9fb5;hb=af26c9bf6992e47f5da18955e1edb2d318325db3;hp=529e7944a2f8f3fba7f4e642e1bc283cfe7a20f9;hpb=25868b05c9d388055441a2cf4133534ea51cebc1;p=fio.git diff --git a/t/zbd/functions b/t/zbd/functions index 529e7944..4faa45a9 100644 --- a/t/zbd/functions +++ b/t/zbd/functions @@ -212,8 +212,14 @@ last_online_zone() { # max_open_zones in sysfs, or which lacks zoned block device support completely. max_open_zones() { local dev=$1 + local realdev syspath - if [ -n "${sg_inq}" ] && [ ! -n "${use_libzbc}" ]; then + realdev=$(readlink -f "$dev") + syspath=/sys/block/${realdev##*/}/queue/max_open_zones + + if [ -b "${realdev}" ] && [ -r "${syspath}" ]; then + cat ${syspath} + elif [ -n "${sg_inq}" ] && [ ! -n "${use_libzbc}" ]; then if ! ${sg_inq} -e --page=0xB6 --len=20 --hex "$dev" \ > /dev/null 2>&1; then # When sg_inq can not get max open zones, specify 0 which indicates