1#!/bin/bash 2# SPDX-License-Identifier: GPL-2.0 3 4. "$(cd "$(dirname "$0")" && pwd)"/test_common.sh 5ERR_CODE=0 6 7ublk_io_and_remove() 8{ 9 run_io_and_remove "$@" 10 ERR_CODE=$? 11 if [ ${ERR_CODE} -ne 0 ]; then 12 echo "$TID failure: $*" 13 _show_result $TID $ERR_CODE 14 fi 15} 16 17if ! _have_program fio; then 18 exit "$UBLK_SKIP_CODE" 19fi 20 21if ! _have_feature "ZERO_COPY"; then 22 exit "$UBLK_SKIP_CODE" 23fi 24if ! _have_feature "AUTO_BUF_REG"; then 25 exit "$UBLK_SKIP_CODE" 26fi 27if ! _have_feature "BATCH_IO"; then 28 exit "$UBLK_SKIP_CODE" 29fi 30 31_prep_test "stress" "run IO and remove device(zero copy)" 32 33_create_backfile 0 256M 34_create_backfile 1 128M 35_create_backfile 2 128M 36 37ublk_io_and_remove 8G -t null -q 4 -b & 38ublk_io_and_remove 256M -t loop -q 4 --auto_zc -b "${UBLK_BACKFILES[0]}" & 39ublk_io_and_remove 256M -t stripe -q 4 --auto_zc -b "${UBLK_BACKFILES[1]}" "${UBLK_BACKFILES[2]}" & 40ublk_io_and_remove 8G -t null -q 4 -z --auto_zc --auto_zc_fallback -b & 41wait 42 43_cleanup_test "stress" 44_show_result $TID $ERR_CODE 45