xfstests: automatically add -F to xfs_io on non-xfs
[xfstests-dev.git] / common / punch
index b9f9acd4ede450ba43809ba08fc99228a81facba..d8f73d025eefed026ba2312089993eb098f54faa 100644 (file)
@@ -311,13 +311,12 @@ _test_generic_punch()
        map_cmd=$4
        filter_cmd=$5
        testfile=$6
-       xfs_io_opt=$7   #needs to be -F if not testing xfs
 
        echo "  1. into a hole"
        if [ "$remove_testfile" ]; then
                rm -f $testfile
        fi
-       $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+       $XFS_IO_PROG -f -c "truncate 20k" \
                -c "$zero_cmd 4k 8k" \
                -c "$map_cmd -v" $testfile | $filter_cmd
        [ $? -ne 0 ] && die_now
@@ -327,7 +326,7 @@ _test_generic_punch()
        if [ "$remove_testfile" ]; then
                rm -f $testfile
        fi
-       $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+       $XFS_IO_PROG -f -c "truncate 20k" \
                -c "pwrite 0 20k" $sync_cmd \
                -c "$zero_cmd 4k 8k" \
                -c "$map_cmd -v" $testfile | $filter_cmd
@@ -338,7 +337,7 @@ _test_generic_punch()
        if [ "$remove_testfile" ]; then
                rm -f $testfile
        fi
-       $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+       $XFS_IO_PROG -f -c "truncate 20k" \
                -c "$alloc_cmd 0 20k" \
                -c "$zero_cmd 4k 8k" \
                -c "$map_cmd -v" $testfile | $filter_cmd
@@ -349,7 +348,7 @@ _test_generic_punch()
        if [ "$remove_testfile" ]; then
                rm -f $testfile
        fi
-       $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+       $XFS_IO_PROG -f -c "truncate 20k" \
                -c "pwrite 8k 8k" $sync_cmd \
                -c "$zero_cmd 4k 8k" \
                -c "$map_cmd -v" $testfile | $filter_cmd
@@ -360,7 +359,7 @@ _test_generic_punch()
        if [ "$remove_testfile" ]; then
                rm -f $testfile
        fi
-       $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+       $XFS_IO_PROG -f -c "truncate 20k" \
                -c "$alloc_cmd 8k 8k" \
                -c "$zero_cmd 4k 8k" \
                -c "$map_cmd -v" $testfile | $filter_cmd
@@ -371,7 +370,7 @@ _test_generic_punch()
        if [ "$remove_testfile" ]; then
                rm -f $testfile
        fi
-       $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+       $XFS_IO_PROG -f -c "truncate 20k" \
                -c "pwrite 0 8k" $sync_cmd \
                -c "$zero_cmd 4k 8k" \
                -c "$map_cmd -v" $testfile | $filter_cmd
@@ -382,7 +381,7 @@ _test_generic_punch()
        if [ "$remove_testfile" ]; then
                rm -f $testfile
        fi
-       $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+       $XFS_IO_PROG -f -c "truncate 20k" \
                -c "pwrite 0 8k" $sync_cmd \
                -c "$alloc_cmd 8k 8k" \
                -c "$zero_cmd 4k 8k" \
@@ -394,7 +393,7 @@ _test_generic_punch()
        if [ "$remove_testfile" ]; then
                rm -f $testfile
        fi
-       $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+       $XFS_IO_PROG -f -c "truncate 20k" \
                -c "$alloc_cmd 0 8k" \
                -c "$zero_cmd 4k 8k" \
                -c "$map_cmd -v" $testfile | $filter_cmd
@@ -405,7 +404,7 @@ _test_generic_punch()
        if [ "$remove_testfile" ]; then
                rm -f $testfile
        fi
-       $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+       $XFS_IO_PROG -f -c "truncate 20k" \
                -c "$alloc_cmd 0 8k" \
                -c "pwrite 8k 8k" $sync_cmd \
                -c "$zero_cmd 4k 8k" \
@@ -417,7 +416,7 @@ _test_generic_punch()
        if [ "$remove_testfile" ]; then
                rm -f $testfile
        fi
-       $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+       $XFS_IO_PROG -f -c "truncate 20k" \
                -c "pwrite 8k 4k" $sync_cmd \
                -c "$zero_cmd 4k 12k" \
                -c "$map_cmd -v" $testfile | $filter_cmd
@@ -428,7 +427,7 @@ _test_generic_punch()
        if [ "$remove_testfile" ]; then
                rm -f $testfile
        fi
-       $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+       $XFS_IO_PROG -f -c "truncate 20k" \
                -c "$alloc_cmd 0 20k" \
                -c "pwrite 0 8k" \
                -c "pwrite 12k 8k" $sync_cmd \
@@ -442,7 +441,7 @@ _test_generic_punch()
        if [ "$remove_testfile" ]; then
                rm -f $testfile
        fi
-       $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+       $XFS_IO_PROG -f -c "truncate 20k" \
                -c "$alloc_cmd 0 20k" \
                -c "pwrite 8k 4k" $sync_cmd \
                -c "$zero_cmd 4k 12k" \
@@ -454,7 +453,7 @@ _test_generic_punch()
        if [ "$remove_testfile" ]; then
                rm -f $testfile
        fi
-       $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+       $XFS_IO_PROG -f -c "truncate 20k" \
                -c "$alloc_cmd 0 20k" \
                -c "pwrite 0k 8k" $sync_cmd \
                -c "pwrite 12k 8k" -c "fsync" \
@@ -465,7 +464,7 @@ _test_generic_punch()
 
        echo "  14. data -> hole @ EOF"
        rm -f $testfile
-       $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+       $XFS_IO_PROG -f -c "truncate 20k" \
                -c "pwrite 0 20k" $sync_cmd \
                -c "$zero_cmd 12k 8k" \
                -c "$map_cmd -v" $testfile | $filter_cmd
@@ -476,7 +475,7 @@ _test_generic_punch()
        if [ "$remove_testfile" ]; then
                rm -f $testfile
        fi
-       $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+       $XFS_IO_PROG -f -c "truncate 20k" \
                -c "pwrite 0 20k" $sync_cmd \
                -c "$zero_cmd 0k 8k" \
                -c "$map_cmd -v" $testfile | $filter_cmd
@@ -490,10 +489,10 @@ _test_generic_punch()
        else
                cp $testfile $testfile.2
        fi
-       $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+       $XFS_IO_PROG -f -c "truncate 20k" \
                -c "pwrite 8k 12k" -c "fsync" $testfile.2 \
                > /dev/null
-       $XFS_IO_PROG $xfs_io_opt -f -c "truncate 20k" \
+       $XFS_IO_PROG -f -c "truncate 20k" \
                -c "pwrite 0 20k" $sync_cmd \
                -c "$zero_cmd 0k 8k" \
                -c "fadvise -d" \
@@ -508,7 +507,7 @@ _test_generic_punch()
                rm -f $testfile
        fi
        block_size=`stat -f $TEST_DEV | grep "Block size" | cut -d " " -f3`
-       $XFS_IO_PROG $xfs_io_opt -f -c "truncate $block_size" \
+       $XFS_IO_PROG -f -c "truncate $block_size" \
                -c "pwrite 0 $block_size" $sync_cmd \
                -c "$zero_cmd 128 128" \
                -c "$map_cmd -v" $testfile | $filter_cmd