use dd and lmdd for proper direct/buffered IO on linux and irix

Merge of master-melb:xfs-cmds:29214a by kenmcd.
This commit is contained in:
David Disseldorp
2007-07-24 16:08:47 +00:00
parent b1d0b1cb9d
commit 4459267d2c
6 changed files with 30 additions and 26 deletions
+1 -2
View File
@@ -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
+1 -2
View File
@@ -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
+1 -2
View File
@@ -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
+1 -2
View File
@@ -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
+2 -2
View File
@@ -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.
+15 -7
View File
@@ -46,6 +46,7 @@ _do_stream()
local bsize=$4
local iflag=$5
local dio=$6
local blocks_in_file=`expr $file_size / $bsize`
mkdir $directory_name
if [ "$iflag" = "1" -a "$HOSTOS" != "IRIX" ]; then
@@ -53,15 +54,22 @@ _do_stream()
|| _fail "chattr of filestream flag"
fi
cd $directory_name
local i=1
local oflags=""
if [ "$dio" = "1" ]; then
oflags="-d"
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
dd_cmd="$dd_cmd if=/dev/zero bs=${bsize} count=${blocks_in_file}"
local i=1
while [ $i -le $files ]; do
$XFS_IO_PROG -f -c \
"pwrite $oflags -i /dev/zero -b $bsize 0 ${file_size}" \
frame-${i} >/dev/null
$dd_cmd of=frame-${i} 2>&1 | grep -v records | grep -v secs
i=`expr $i + 1`
done
}