Merge of master-melb:xfs-cmds:22779a by kenmcd.
echo "Writing $bytes bytes, offset is $words (direct=$direct)" | _filter_io
echo "Writing $bytes bytes at $location $words (direct=$direct)" >>$seq.full
- xfs_io -c "pwrite $offset 512" $flags $SCRATCH_MNT/$seq \
- 2>&1 | _filter_off $offset | _filter_xfs_io | tee -a $seq.full
+ $XFS_IO_PROG -c "pwrite $offset 512" $flags $SCRATCH_MNT/$seq \
+ 2>&1 | _filter_off $offset | _filter_$XFS_IO_PROG | tee -a $seq.full
xfs_bmap -v $SCRATCH_MNT/$seq >>$seq.full
echo "Reading $bytes bytes (direct=$direct)" | _filter_io
echo "Reading $bytes bytes at $location (direct=$direct)" >>$seq.full
- xfs_io -c "pread $offset $bytes" $flags $SCRATCH_MNT/$seq \
- 2>&1 | _filter_off $offset | _filter_xfs_io | tee -a $seq.full
+ $XFS_IO_PROG -c "pread $offset $bytes" $flags $SCRATCH_MNT/$seq \
+ 2>&1 | _filter_off $offset | _filter_$XFS_IO_PROG | tee -a $seq.full
- xfs_io -c "pread -v $offset $bytes" $flags $SCRATCH_MNT/$seq >>$seq.full
+ $XFS_IO_PROG -c "pread -v $offset $bytes" $flags $SCRATCH_MNT/$seq >>$seq.full
echo | tee -a $seq.full
}
_supported_fs xfs
_supported_os IRIX Linux
-[ -x /usr/sbin/xfs_io ] || _notrun "xfs_io executable not found"
+[ -x $XFS_IO_PROG ] || _notrun "$XFS_IO_PROG executable not found"
_require_scratch
_scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
# boundary (and stash xfs_bmap output), before moving onto
# each new test point.
-xfs_io -c "truncate 0" -f $SCRATCH_MNT/$seq
+$XFS_IO_PROG -c "truncate 0" -f $SCRATCH_MNT/$seq
oneTB=`echo 1024 \* 1024 \* 1024 \* 1024 | bc`
count=`expr $upperbound - 1`
_supported_fs xfs
_supported_os IRIX Linux
-[ -x /usr/sbin/xfs_io ] || _notrun "xfs_io executable not found"
+[ -n "$XFS_IO_PROG" ] || _notrun "xfs_io executable not found"
_require_scratch
echo Silence is golden
# reserve 1GiB, truncate at 100bytes
-xfs_io -f -c 'resvsp 0 1g' -c 'truncate 100' $SCRATCH_MNT/ouch
+$XFS_IO_PROG -f -c 'resvsp 0 1g' -c 'truncate 100' $SCRATCH_MNT/ouch
rm -f $SCRATCH_MNT/ouch
# reserve 1GiB, truncate at 1GiB
-xfs_io -f -c 'resvsp 0 1g' -c 'truncate 1g' $SCRATCH_MNT/ouch
+$XFS_IO_PROG -f -c 'resvsp 0 1g' -c 'truncate 1g' $SCRATCH_MNT/ouch
rm -f $SCRATCH_MNT/ouch
# reserve 1GiB, truncate at 2GiB
-xfs_io -f -c 'resvsp 0 1g' -c 'truncate 2g' $SCRATCH_MNT/ouch
+$XFS_IO_PROG -f -c 'resvsp 0 1g' -c 'truncate 2g' $SCRATCH_MNT/ouch
rm -f $SCRATCH_MNT/ouch
# reserve 1GiB, 1GiB hole, reserve 1MiB, truncate at 3GiB
-xfs_io -f -c 'resvsp 0 1g' -c 'resvsp 2g 1m' -c 'truncate 3g' $SCRATCH_MNT/ouch
+$XFS_IO_PROG -f -c 'resvsp 0 1g' -c 'resvsp 2g 1m' -c 'truncate 3g' $SCRATCH_MNT/ouch
rm -f $SCRATCH_MNT/ouch
# success, all done
| _filter_mkfs 2>/dev/null
echo "*** extend loop file"
- xfs_io -c "pwrite $new_size $bsize" $LOOP_DEV | _filter_io
+ $XFS_IO_PROG -c "pwrite $new_size $bsize" $LOOP_DEV | _filter_io
echo "*** mount loop filesystem"
mount -t xfs -o loop $LOOP_DEV $LOOP_MNT
echo direct realtime writes, 4 files, 2m each, increasing offsets.
for i in 0 1 2 3
do
- xfs_io -fdxR $SCRATCH_MNT/rt-direct-$1-$i \
+ $XFS_IO_PROG -fdxR $SCRATCH_MNT/rt-direct-$1-$i \
-c "extsize $1" -c "pwrite ${i}m 1m" \
| _filter_io
done
echo buffered realtime writes, 4 files, 2m each, increasing offsets.
for i in 0 1 2 3
do
- xfs_io -fxR $SCRATCH_MNT/rt-buffera-$1-$i \
+ $XFS_IO_PROG -fxR $SCRATCH_MNT/rt-buffera-$1-$i \
-c "extsize $1" -c "pwrite ${i}m 1m" \
| _filter_io
done
echo buffered realtime writes, 4 files, unaligned byte offsets/sizes.
for i in 0 1 2 3
do
- xfs_io -fxR $SCRATCH_MNT/rt-bufferu-$1-$i \
+ $XFS_IO_PROG -fxR $SCRATCH_MNT/rt-bufferu-$1-$i \
-c "extsize $1" -c "pwrite $i 1" \
| _filter_io
done
# mmap realtime writes, 4 files, unaligned byte offsets/sizes.
for i in 0 1 2 3
do
- xfs_io -fxR $SCRATCH_MNT/rt-mmap-$1-$i \
+ $XFS_IO_PROG -fxR $SCRATCH_MNT/rt-mmap-$1-$i \
-c "extsize $1" -c "pwrite $i 1" \
| _filter_io
done
# unset inode attribute, create files below and check they're not realtime
echo "*** create directory with rtinherit"
-xfs_io -r -c 'chattr +R' $SCRATCH_MNT/testdir
-xfs_io -r -c 'lsattr' $SCRATCH_MNT/testdir | _filter_scratch
+$XFS_IO_PROG -r -c 'chattr +R' $SCRATCH_MNT/testdir
+$XFS_IO_PROG -r -c 'lsattr' $SCRATCH_MNT/testdir | _filter_scratch
echo "*** create child with inherited realtime"
touch $SCRATCH_MNT/testdir/realtime
-xfs_io -r -c 'lsattr' $SCRATCH_MNT/testdir/realtime | _filter_scratch
+$XFS_IO_PROG -r -c 'lsattr' $SCRATCH_MNT/testdir/realtime | _filter_scratch
echo "*** remove rtinherit from directory"
-xfs_io -r -c 'chattr -R' $SCRATCH_MNT/testdir
-xfs_io -r -c 'lsattr' $SCRATCH_MNT/testdir | _filter_scratch
+$XFS_IO_PROG -r -c 'chattr -R' $SCRATCH_MNT/testdir
+$XFS_IO_PROG -r -c 'lsattr' $SCRATCH_MNT/testdir | _filter_scratch
echo "*** create child without inherited realtime"
touch $SCRATCH_MNT/testdir/non-realtime
-xfs_io -r -c 'lsattr' $SCRATCH_MNT/testdir/non-realtime | _filter_scratch
+$XFS_IO_PROG -r -c 'lsattr' $SCRATCH_MNT/testdir/non-realtime | _filter_scratch
echo "*** done"
echo "*** testing nosymlinks directories"
mkdir $SCRATCH_MNT/nosymlinks
echo "*** setting nosymlinks bit"
-xfs_io -r -c 'chattr +n' -c lsattr $SCRATCH_MNT/nosymlinks \
+$XFS_IO_PROG -r -c 'chattr +n' -c lsattr $SCRATCH_MNT/nosymlinks \
| _filter_scratch
touch $SCRATCH_MNT/nosymlinks/source
ln -s $SCRATCH_MNT/nosymlinks/source $SCRATCH_MNT/nosymlinks/target 2>&1 \
find $SCRATCH_MNT | _filter_scratch
echo "*** clearing nosymlinks bit"
-xfs_io -r -c 'chattr -n' -c lsattr $SCRATCH_MNT/nosymlinks | _filter_scratch
+$XFS_IO_PROG -r -c 'chattr -n' -c lsattr $SCRATCH_MNT/nosymlinks | _filter_scratch
ln -s $SCRATCH_MNT/nosymlinks/source $SCRATCH_MNT/nosymlinks/target
ln $SCRATCH_MNT/nosymlinks/source $SCRATCH_MNT/nosymlinks/hardlinksareok2
# echo "*** testing inherited project IDs"
# mkdir $SCRATCH_MNT/projectids
-# xfs_io -r -c 'chattr +P' -c lsattr -c 'chproj 42' $SCRATCH_MNT/projectids\
+# $XFS_IO_PROG -r -c 'chattr +P' -c lsattr -c 'chproj 42' $SCRATCH_MNT/projectids\
# | _filter_scratch
# mkdir -p $SCRATCH_MNT/projectids/a/b
# touch $SCRATCH_MNT/projectids/a/b/c
-# xfs_io -r -c 'lsattr -R' $SCRATCH_MNT/projectids
-# xfs_io -r -c 'lsproj' $SCRATCH_MNT/projectids/a $SCRATCH_MNT/projectids/a/b/c\
+# $XFS_IO_PROG -r -c 'lsattr -R' $SCRATCH_MNT/projectids
+# $XFS_IO_PROG -r -c 'lsproj' $SCRATCH_MNT/projectids/a $SCRATCH_MNT/projectids/a/b/c\
# | _filter_scratch
# echo "*** 3rd listing..."
# find $SCRATCH_MNT | _filter_scratch
_fill_scratch()
{
- xfs_io -f -c "resvsp 0 ${1}" $SCRATCH_MNT/resvfile
+ $XFS_IO_PROG -f -c "resvsp 0 ${1}" $SCRATCH_MNT/resvfile
}
_stress_scratch()
gid=254
prid=253
rm -f $SCRATCH_MNT/resv
-xfs_io -fc "resvsp 0 200m" -c "chproj $prid" $SCRATCH_MNT/resv
+$XFS_IO_PROG -fc "resvsp 0 200m" -c "chproj $prid" $SCRATCH_MNT/resv
chown $uid $SCRATCH_MNT/resv
chgrp $gid $SCRATCH_MNT/resv
echo "### deny a hard link - wrong project ID"
rm -f $SCRATCH_MNT/outer $target/inner
-xfs_io -f -c 'chproj 789' $SCRATCH_MNT/outer
+$XFS_IO_PROG -f -c 'chproj 789' $SCRATCH_MNT/outer
ln $SCRATCH_MNT/outer $target/inner 2>/dev/null
if [ $? -eq 0 ]; then
echo hard link succeeded
xfs_quota -c 'quota -ip 6' $QARGS | filter_xfs_quota
echo "### allow a hard link - right project ID"
-xfs_io -c 'chproj 6' $SCRATCH_MNT/outer
+$XFS_IO_PROG -c 'chproj 6' $SCRATCH_MNT/outer
ln $SCRATCH_MNT/outer $target/inner
if [ $? -eq 0 ]; then
echo hard link succeeded
{
echo; echo "### create files, setting up ownership (type=$type)"
rm -f $SCRATCH_MNT/{buffer,direct,mmap}
- xfs_io -fc "chproj $prid" $SCRATCH_MNT/{buffer,direct,mmap}
+ $XFS_IO_PROG -fc "chproj $prid" $SCRATCH_MNT/{buffer,direct,mmap}
chown $uid $SCRATCH_MNT/{buffer,direct,mmap}
chgrp $gid $SCRATCH_MNT/{buffer,direct,mmap}
for file in $SCRATCH_MNT/{buffer,direct,mmap}; do
$here/src/lstat64 $file | head -3 | filter_scratch
- xfs_io -c lsproj $file
+ $XFS_IO_PROG -c lsproj $file
done
}
{
echo "### some controlled buffered, direct and mmapd IO (type=$type)"
echo "--- initiating parallel IO..." >>$seq.full
- xfs_io -c 'pwrite -b 1m 0 16m' -c 'fsync' \
+ $XFS_IO_PROG -c 'pwrite -b 1m 0 16m' -c 'fsync' \
$SCRATCH_MNT/buffer >>$seq.full 2>&1 &
- xfs_io -c 'pwrite -b 1m 0 16m' -d \
+ $XFS_IO_PROG -c 'pwrite -b 1m 0 16m' -d \
$SCRATCH_MNT/direct >>$seq.full 2>&1 &
- xfs_io -c 't 16m' -c 'mm -rw 0 16m' -c 'mw 0 16m' -c 'ms -s' \
+ $XFS_IO_PROG -c 't 16m' -c 'mm -rw 0 16m' -c 'mw 0 16m' -c 'ms -s' \
$SCRATCH_MNT/mmap >>$seq.full 2>&1 &
wait
echo "--- completed parallel IO ($type)" >>$seq.full
export XFS_REPAIR_PROG="`set_prog_path xfs_repair`"
export XFS_CHECK_PROG="`set_prog_path xfs_check`"
export XFS_DB_PROG="`set_prog_path xfs_db`"
+export XFS_GROWFS_PROG=`set_prog_path xfs_growfs`
+export XFS_IO_PROG="`set_prog_path xfs_io`"
case "$HOSTOS" in
IRIX*)