From: David Disseldorp Date: Tue, 24 Jul 2007 16:08:47 +0000 (+0000) Subject: use dd and lmdd for proper direct/buffered IO on linux and irix X-Git-Tag: v1.1.0~473 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4459267d2c61e8a65bd594305652833694bc25d7;p=xfstests-dev.git use dd and lmdd for proper direct/buffered IO on linux and irix Merge of master-melb:xfs-cmds:29214a by kenmcd. --- diff --git a/170 b/170 index 4e9a9c2e..0b4b0a8b 100644 --- a/170 +++ b/170 @@ -29,6 +29,7 @@ _cleanup() # get standard environment, filters and checks . ./common.rc . ./common.filter +. ./common.filestreams # real QA test starts here _supported_fs xfs @@ -36,8 +37,6 @@ _supported_os IRIX Linux _require_scratch -. ./common.filestreams - _check_filestreams_support || _notrun "filestreams not available" # test small stream, multiple I/O per file, 30s timeout diff --git a/171 b/171 index b98b5404..0cd39104 100644 --- a/171 +++ b/171 @@ -29,6 +29,7 @@ _cleanup() # get standard environment, filters and checks . ./common.rc . ./common.filter +. ./common.filestreams # real QA test starts here _supported_fs xfs @@ -36,8 +37,6 @@ _supported_os IRIX Linux _require_scratch -. ./common.filestreams - _check_filestreams_support || _notrun "filestreams not available" # test large numbers of files, single I/O per file, 120s timeout diff --git a/172 b/172 index e76e9e77..03983a81 100644 --- a/172 +++ b/172 @@ -29,6 +29,7 @@ _cleanup() # get standard environment, filters and checks . ./common.rc . ./common.filter +. ./common.filestreams # real QA test starts here _supported_fs xfs @@ -36,8 +37,6 @@ _supported_os IRIX Linux _require_scratch -. ./common.filestreams - _check_filestreams_support || _notrun "filestreams not available" # test reaper works by setting timeout low. Expected to fail diff --git a/173 b/173 index 2d2e0807..8bd77956 100644 --- a/173 +++ b/173 @@ -29,6 +29,7 @@ _cleanup() # get standard environment, filters and checks . ./common.rc . ./common.filter +. ./common.filestreams # real QA test starts here _supported_fs xfs @@ -36,8 +37,6 @@ _supported_os IRIX Linux _require_scratch -. ./common.filestreams - _check_filestreams_support || _notrun "filestreams not available" # test large number of streams, multiple I/O per file, 120s timeout diff --git a/174 b/174 index 9ad23021..0b984bca 100644 --- a/174 +++ b/174 @@ -16,6 +16,7 @@ echo "QA output created by $seq" here=`pwd` tmp=/tmp/$$ +rm -f $seq.full status=1 # failure is the default! trap "_cleanup; exit \$status" 0 1 2 3 15 @@ -28,6 +29,7 @@ _cleanup() # get standard environment, filters and checks . ./common.rc . ./common.filter +. ./common.filestreams # real QA test starts here _supported_fs xfs @@ -35,8 +37,6 @@ _supported_os IRIX Linux _require_scratch -. ./common.filestreams - _check_filestreams_support || _notrun "filestreams not available" # test number of streams greater than AGs. Expected to fail. diff --git a/common.filestreams b/common.filestreams index 9994b7b1..b385271c 100644 --- a/common.filestreams +++ b/common.filestreams @@ -40,30 +40,38 @@ _set_stream_timeout_centisecs() _do_stream() { - local directory_name=$1 - local files=$2 - local file_size=$3 - local bsize=$4 + local directory_name=$1 + local files=$2 + local file_size=$3 + local bsize=$4 local iflag=$5 local dio=$6 + local blocks_in_file=`expr $file_size / $bsize` - mkdir $directory_name + mkdir $directory_name if [ "$iflag" = "1" -a "$HOSTOS" != "IRIX" ]; then $XFS_IO_PROG -x -c "chattr +S" $directory_name \ || _fail "chattr of filestream flag" fi - cd $directory_name - local i=1 - local oflags="" - if [ "$dio" = "1" ]; then - oflags="-d" + cd $directory_name + + local dd_cmd="" + if [ "$HOSTOS" == "IRIX" ]; then + # for irix use lmdd + dd_cmd="lmdd" + [ "$dio" = "1" ] && dd_cmd="$dd_cmd odirect=1" + else + # for linux use dd + dd_cmd="dd" + [ "$dio" = "1" ] && dd_cmd="$dd_cmd oflag=direct" fi - while [ $i -le $files ]; do - $XFS_IO_PROG -f -c \ - "pwrite $oflags -i /dev/zero -b $bsize 0 ${file_size}" \ - frame-${i} >/dev/null - i=`expr $i + 1` - done + dd_cmd="$dd_cmd if=/dev/zero bs=${bsize} count=${blocks_in_file}" + + local i=1 + while [ $i -le $files ]; do + $dd_cmd of=frame-${i} 2>&1 | grep -v records | grep -v secs + i=`expr $i + 1` + done } _filter_agno()