]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
fstests: fix call sites that used xfs_io directly
authorAmir Goldstein <amir73il@gmail.com>
Mon, 17 Oct 2016 07:23:32 +0000 (10:23 +0300)
committerEryu Guan <eguan@redhat.com>
Thu, 20 Oct 2016 14:20:08 +0000 (22:20 +0800)
Convert those few remaining call sites to use the XFS_IO_PROG env var.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
17 files changed:
common/quota
common/rc
tests/generic/043
tests/generic/044
tests/generic/045
tests/generic/046
tests/generic/047
tests/generic/048
tests/generic/049
tests/generic/224
tests/xfs/109
tests/xfs/114
tests/xfs/190
tests/xfs/201
tests/xfs/229
tests/xfs/250
tests/xfs/291

index fb2b2a041cd20a8cff9359ad75bcb8434c744971..678bc43c83b8b8eb37fe363d056cf951ad258abd 100644 (file)
@@ -139,7 +139,7 @@ _file_as_id()
 
     parent=`dirname $1`
     if [ $3 = p ]; then
-       echo PARENT: xfs_io -r -c "chproj $2" -c "chattr +P" $parent >>$seqres.full
+       echo PARENT: $XFS_IO_PROG -r -c "chproj $2" -c "chattr +P" $parent >>$seqres.full
        $XFS_IO_PROG -r -c "chproj $2" -c "chattr +P" $parent >>$seqres.full 2>&1
        magik='$>'      # (irrelevent, above set projid-inherit-on-parent)
     elif [ $3 = u ]; then
@@ -165,7 +165,7 @@ EOF
 #      exec "dd if=/dev/zero of=$1 bs=$4 count=$5 >>$seqres.full 2>&1";
 
     if [ $3 = p ]; then
-       echo PARENT: xfs_io -r -c "chproj 0" -c "chattr -P" $parent >>$seqres.full
+       echo PARENT: $XFS_IO_PROG -r -c "chproj 0" -c "chattr -P" $parent >>$seqres.full
        $XFS_IO_PROG -r -c "chproj 0" -c "chattr -P" $parent >>$seqres.full 2>&1
     fi
 }
index 7a9fc908f4e7e7d7230ac5113ac42c9572fca234..ba8472b29e3beaa12e5794228b12d103e5d7a4e3 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -3796,8 +3796,8 @@ init_rc()
                exit 1
        fi
        # Figure out if we need to add -F ("foreign", deprecated) option to xfs_io
-       xfs_io -c stat $TEST_DIR 2>&1 | grep -q "is not on an XFS filesystem" && \
-       export XFS_IO_PROG="$XFS_IO_PROG -F"
+       $XFS_IO_PROG -c stat $TEST_DIR 2>&1 | grep -q "is not on an XFS filesystem" && \
+               export XFS_IO_PROG="$XFS_IO_PROG -F"
 
        # xfs_copy doesn't work on v5 xfs yet without -d option
        if [ "$FSTYP" == "xfs" ] && [[ $MKFS_OPTIONS =~ crc=1 ]]; then
index bd8eef8f71bd9eff5f7c8c62411dd78e9d17eabc..b76a5aa8d94502802c56c478a7c44d2486a71900 100755 (executable)
@@ -50,7 +50,7 @@ i=1;
 while [ $i -lt 1000 ]
 do
        file=$SCRATCH_MNT/$i
-       xfs_io -f -c "pwrite -b 64k -S 0xff 0 64k" $file > /dev/null
+       $XFS_IO_PROG -f -c "pwrite -b 64k -S 0xff 0 64k" $file > /dev/null
        if [ $? -ne 0 ]
        then
                echo error creating/writing file $file
index f46e8289f5b10f743cfa27fceab2c0fde54e4e75..0331baa6bb9670f8d72a63322e9a1aba5cbbcef5 100755 (executable)
@@ -50,13 +50,13 @@ i=1;
 while [ $i -lt 1000 ]
 do
        file=$SCRATCH_MNT/$i
-       xfs_io -f -c "pwrite -b 64k -S 0xff 0 64k" $file > /dev/null
+       $XFS_IO_PROG -f -c "pwrite -b 64k -S 0xff 0 64k" $file > /dev/null
        if [ $? -ne 0 ]
        then
                echo error creating/writing file $file
                exit
        fi
-       xfs_io -c "truncate 64k" $file > /dev/null
+       $XFS_IO_PROG -c "truncate 64k" $file > /dev/null
        if [ $? -ne 0 ]
        then
                echo error truncating file $file
index 4ec765095ff67da345f8f2a368b086f5a97fd17b..874c955982f0ab47120399a1e38b711dbddbf5c9 100755 (executable)
@@ -50,13 +50,13 @@ i=1;
 while [ $i -lt 1000 ]
 do
        file=$SCRATCH_MNT/$i
-       xfs_io -f -c "pwrite -b 64k -S 0xff 0 64k" $file > /dev/null
+       $XFS_IO_PROG -f -c "pwrite -b 64k -S 0xff 0 64k" $file > /dev/null
        if [ $? -ne 0 ]
        then
                echo error creating/writing file $file
                exit
        fi
-       xfs_io -c "truncate 32k" $file > /dev/null
+       $XFS_IO_PROG -c "truncate 32k" $file > /dev/null
        if [ $? -ne 0 ]
        then
                echo error truncating file $file
index 08f11370512378b4ca4c043c35e718bb8c23de08..5a894b858cd15706ff1f2a7ed12655f2898597f8 100755 (executable)
@@ -50,13 +50,13 @@ i=1;
 while [ $i -lt 1000 ]
 do
        file=$SCRATCH_MNT/$i
-       xfs_io -f -c "pwrite -b 32k -S 0xff 0 32k" $file > /dev/null
+       $XFS_IO_PROG -f -c "pwrite -b 32k -S 0xff 0 32k" $file > /dev/null
        if [ $? -ne 0 ]
        then
                echo error creating/writing file $file
                exit
        fi
-       xfs_io -c "truncate 64k" $file > /dev/null
+       $XFS_IO_PROG -c "truncate 64k" $file > /dev/null
        if [ $? -ne 0 ]
        then
                echo error truncating file $file
index b894ee6113865c9759540b833abcc183570b92a9..631dc1e4240fb8c3f3e917399f38b93bffcb8648 100755 (executable)
@@ -81,7 +81,7 @@ i=1;
 while [ $i -lt 1000 ]
 do
        file=$SCRATCH_MNT/$i
-       xfs_io -f -c "pwrite -b 32k -S 0xff 0 32k" -c "fsync" $file > /dev/null
+       $XFS_IO_PROG -f -c "pwrite -b 32k -S 0xff 0 32k" -c "fsync" $file > /dev/null
        if [ $? -ne 0 ]
        then
                echo error creating/writing file $file
index 6f5f44466dae3d589c2bc2a6f7f80e4b127ff56a..51d7efd28a47469e8a91584531dcb67409cb6ae8 100755 (executable)
@@ -84,7 +84,7 @@ i=1;
 while [ $i -lt 1000 ]
 do
        file=$SCRATCH_MNT/$i
-       xfs_io -f -c "pwrite -b 64k -S 0xff 0 10m" $file > /dev/null
+       $XFS_IO_PROG -f -c "pwrite -b 64k -S 0xff 0 10m" $file > /dev/null
        if [ $? -ne 0 ]
        then
                echo error creating/writing file $file
index 320318e61dd014a6d87224b45f009d76ede48120..1299242233ce92fb052b07c51d698ae88dd00985 100755 (executable)
@@ -81,7 +81,7 @@ i=1;
 while [ $i -lt 1000 ]
 do
        file=$SCRATCH_MNT/$i
-       xfs_io -f -c "pwrite -b 32k -S 0xff 0 32k" $file > /dev/null
+       $XFS_IO_PROG -f -c "pwrite -b 32k -S 0xff 0 32k" $file > /dev/null
        if [ $? -ne 0 ]
        then
                echo error creating/writing file $file
index 391d8776b1c38718266a044ab4209604b6d58790..2c30a75258f3f67a2544c711a3195b21a43f17c7 100755 (executable)
@@ -59,7 +59,7 @@ _scratch_mount >> $seqres.full 2>&1
 
 # set the reserved block pool to almost empty for XFS
 if [ "$FSTYP" = "xfs" ]; then
-       xfs_io -x -c "resblks 4" $SCRATCH_MNT >> $seqres.full 2>&1
+       $XFS_IO_PROG -x -c "resblks 4" $SCRATCH_MNT >> $seqres.full 2>&1
 fi
 
 FILES=1000
@@ -71,7 +71,7 @@ for i in `seq 0 1 $FILES`; do
        # tripped over.
         (
                sleep 5
-               xfs_io -f -c "truncate 10485760" $SCRATCH_MNT/testfile.$i
+               $XFS_IO_PROG -f -c "truncate 10485760" $SCRATCH_MNT/testfile.$i
                dd if=/dev/zero of=$SCRATCH_MNT/testfile.$i bs=4k conv=notrunc
        ) > /dev/null 2>&1 &
 done
index ac2061983e2b4c2ee07ec1c41d7fcfc62bc47eb4..e0fdec3dd7994dcfedd862be9438d370958960ff 100755 (executable)
@@ -50,7 +50,7 @@ populate()
        i=0
        while [ $i -le $files -a "X$faststart" = "X" ]; do
                file=$SCRATCH_MNT/f$i
-               xfs_io -f -d -c 'pwrite -b 64k 0 64k' $file >/dev/null
+               $XFS_IO_PROG -f -d -c 'pwrite -b 64k 0 64k' $file >/dev/null
                let i=$i+1
        done
 
@@ -77,7 +77,7 @@ allocate()
                {
                        j=0
                        while [ $j -lt 100 ]; do
-                               xfs_io -f -c 'pwrite -b 64k 0 16m' $file \
+                               $XFS_IO_PROG -f -c 'pwrite -b 64k 0 16m' $file \
                                        >/dev/null 2>&1
                                rm $file
                                let j=$j+1
index 50cc71b608cb2a93c7bd45341d12308135a50480..24474f744978a51b3b3fa25f9fb1f8c71fd50d34 100755 (executable)
@@ -44,7 +44,7 @@ _check_paths()
        sync; sleep 1
        echo ""
        echo "Check parent"
-       if ! xfs_io -x -c 'parent -c' $SCRATCH_MNT | _filter_num; then
+       if ! $XFS_IO_PROG -x -c 'parent -c' $SCRATCH_MNT | _filter_num; then
                exit 1
        fi
 }
@@ -55,7 +55,7 @@ _print_names()
        echo "Print out hardlink names for given path, $1"
        echo ""
 
-       xfs_io -x -c parent $1 | awk '/p_ino.*=/ {$3 = "inodeXXX"; print; next} {print}' 
+       $XFS_IO_PROG -x -c parent $1 | awk '/p_ino.*=/ {$3 = "inodeXXX"; print; next} {print}'
 }
 
 _test_create()
index 614a80c37079a5131f0033d6b6792a0642c5bf80..d68821627546e1602fcce457a1c1ac322df725e1 100755 (executable)
@@ -62,8 +62,8 @@ dd if=/dev/zero of=$SCRATCH_MNT/$filename bs=1024k count=10 >> $seqres.full 2>&1
 echo Punching holes in file
 echo Punching holes in file >> $seqres.full
 for i in $holes ; do
-       echo xfs_io -c "unresvsp `echo $i |$SED_PROG 's/:/ /g'`" $SCRATCH_MNT/$filename >> $seqres.full
-       xfs_io -c "unresvsp `echo $i |$SED_PROG 's/:/ /g'`" $SCRATCH_MNT/$filename ;
+       echo $XFS_IO_PROG -c "unresvsp `echo $i |$SED_PROG 's/:/ /g'`" $SCRATCH_MNT/$filename >> $seqres.full
+       $XFS_IO_PROG -c "unresvsp `echo $i |$SED_PROG 's/:/ /g'`" $SCRATCH_MNT/$filename ;
 done
 
 echo Verifying holes are in the correct spots:
index ac8abf491b5c640f4a729000bc44ea1c78a0db92..45dc42fae2f589d768f5febd5dcf37bc239b8f7f 100755 (executable)
@@ -56,7 +56,7 @@ do_pwrite()
        end=`expr $2 \* $min_align`
        length=`expr $end - $offset`
 
-       xfs_io -d -f $file -c "pwrite $offset $length" >/dev/null
+       $XFS_IO_PROG -d -f $file -c "pwrite $offset $length" >/dev/null
 }
 
 _require_scratch
index b8fd914b4d3c879082d9f1692944ab6accd8b695..0a42bcf6fa929e1860ddda552e0ebed370c83267 100755 (executable)
@@ -60,7 +60,7 @@ EXTSIZE="256k"
 mkdir ${TDIR}
 
 # Set the test directory extsize
-xfs_io -c "extsize ${EXTSIZE}" ${TDIR}
+$XFS_IO_PROG -c "extsize ${EXTSIZE}" ${TDIR}
 
 # Create a set of holey files
 echo "generating ${NFILES} files"
index 0cdc3822fa328c871adecbdd872ababa0f44fab0..f807c5a5abade0b3e43c64b86e2f23475999de3d 100755 (executable)
@@ -81,7 +81,7 @@ _test_loop()
        mount -t xfs -o loop $LOOP_DEV $LOOP_MNT
 
        echo "*** preallocate large file"
-       xfs_io -f -c "resvsp 0 $fsize" $LOOP_MNT/foo | _filter_io
+       $XFS_IO_PROG -f -c "resvsp 0 $fsize" $LOOP_MNT/foo | _filter_io
 
        echo "*** unmount loop filesystem"
        umount $LOOP_MNT > /dev/null 2>&1
index c226e65145e0949e563156eddc47d836add79b7a..905dffad698ea20bbab7abf8c1cfba6f8dcbf5e7 100755 (executable)
@@ -69,7 +69,7 @@ done
 sync
 
 # Soak up any remaining freespace
-xfs_io -f -c "pwrite 0 16m" -c "fsync" $SCRATCH_MNT/space_file.large >> $seqres.full 2>&1
+$XFS_IO_PROG -f -c "pwrite 0 16m" -c "fsync" $SCRATCH_MNT/space_file.large >> $seqres.full 2>&1
 
 # Take a look at freespace for any post-mortem on the test
 _scratch_unmount