common: Use _require_xfs_io_command() instead of helpers
authorLukas Czerner <lczerner@redhat.com>
Mon, 28 Apr 2014 00:55:12 +0000 (10:55 +1000)
committerDave Chinner <david@fromorbit.com>
Mon, 28 Apr 2014 00:55:12 +0000 (10:55 +1000)
Number of helpers for checking xfs_io functionality is slowly
growing.  But it's as easy to simply use _require_xfs_io_command()
directly and just specify the command we want to check. It will also
avoid the need to create helper every time we need to check a new
command in xfs_io.

Remove all the helpers and use _require_xfs_io_command() in the
tests.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
28 files changed:
common/defrag
common/rc
tests/btrfs/026
tests/btrfs/027
tests/btrfs/028
tests/btrfs/047
tests/ext4/001
tests/ext4/002
tests/generic/009
tests/generic/012
tests/generic/016
tests/generic/017
tests/generic/021
tests/generic/022
tests/generic/213
tests/generic/214
tests/generic/223
tests/generic/228
tests/generic/255
tests/generic/256
tests/generic/274
tests/generic/300
tests/generic/311
tests/generic/312
tests/generic/316
tests/shared/298
tests/xfs/252
tests/xfs/290

index a4bc976ee7b60c3c14674950e542c9ce5e282830..732cd64006e364ac2701552d57f0e7aa70c243d4 100644 (file)
@@ -38,7 +38,7 @@ _require_defrag()
     esac
 
     _require_command $DEFRAG_PROG
-    _require_xfs_io_fiemap
+    _require_xfs_io_command "fiemap"
 }
 
 _extent_count()
index 07acbc579cf79bb10f327952870bfb52f3cd5e7c..5c13db5124fa4e0c70b5fbdc4269a36cda682dac 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -1260,47 +1260,6 @@ _require_xfs_io_command()
                _notrun "xfs_io $command failed (old kernel/wrong fs?)"
 }
 
-# check that xfs_io, kernel, and filesystem all support zero
-_require_xfs_io_zero()
-{
-       _require_xfs_io_command "zero"
-}
-
-# check that xfs_io, glibc, kernel, and filesystem all (!) support
-# fallocate
-#
-_require_xfs_io_falloc()
-{
-       _require_xfs_io_command "falloc"
-}
-
-# check that xfs_io, kernel and filesystem all support fallocate with hole
-# punching
-_require_xfs_io_falloc_punch()
-{
-       _require_xfs_io_command "fpunch"
-}
-
-# check that xfs_io, kernel and filesystem all support fallocate with collapse
-# range
-_require_xfs_io_falloc_collapse()
-{
-       _require_xfs_io_command "fcollapse"
-}
-
-# check that xfs_io, kernel, and filesystem all support fallocate with zero
-# range
-_require_xfs_io_falloc_zero()
-{
-       _require_xfs_io_command "fzero"
-}
-
-# check that xfs_io, kernel and filesystem support fiemap
-_require_xfs_io_fiemap()
-{
-       _require_xfs_io_command "fiemap"
-}
-
 # Check that a fs has enough free space (in 1024b blocks)
 #
 _require_fs_space()
index 6c545901f90faea8f15a0b0aec0f60ea668344c9..c2ac561760e04d1f724b1ab690b4351889d0b30b 100644 (file)
@@ -48,7 +48,7 @@ _cleanup()
 _supported_fs btrfs
 _supported_os Linux
 
-_require_xfs_io_fiemap
+_require_xfs_io_command "fiemap"
 _require_cp_reflink
 
 TESTDIR1=$TEST_DIR/test-$seq
index b2dff1c286a9a12bd8f5f8dd840df927ca00181d..d615efd355c8fef95e62aab196a47e1e54886150 100644 (file)
@@ -48,7 +48,7 @@ _cleanup()
 _supported_fs btrfs
 _supported_os Linux
 
-_require_xfs_io_fiemap
+_require_xfs_io_command "fiemap"
 _require_cp_reflink
 
 TESTDIR1=$TEST_DIR/test-$seq
index f17f1029353d51eeb3e5d75c83eee8e7e3eeb2aa..50cffd35a5008b8670f190ed748616cd154afb05 100644 (file)
@@ -46,7 +46,7 @@ _cleanup()
 _supported_fs btrfs
 _supported_os Linux
 
-_require_xfs_io_fiemap
+_require_xfs_io_command "fiemap"
 _require_cp_reflink
 
 rm -f $seqres.full
index cc1936dfac68b4b15488d62d6194e65c73632897..2dc6499be973e706051809a0082965240c9cd5ff 100755 (executable)
@@ -59,7 +59,7 @@ _supported_fs btrfs
 _supported_os Linux
 _require_scratch
 _require_fssum
-_require_xfs_io_fiemap
+_require_xfs_io_command "fiemap"
 _require_btrfs_send_stream_version
 _need_to_be_root
 
index 8239f0ee876bac158ee7788bf34d497ec8657195..827d8066cde269c32d63aa78d10be51ec2939ea4 100755 (executable)
@@ -45,7 +45,7 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
 # real QA test starts here
 _supported_fs ext4
 _supported_os Linux
-_require_xfs_io_falloc_zero
+_require_xfs_io_command "fzero"
 
 testfile=$TEST_DIR/001.$$
 
index 12be25393d35bdb0439c43d14a600ec53c436b87..8cb3fd14ad892bb952c8ae185853897a1aac1043 100755 (executable)
@@ -119,7 +119,7 @@ _check_ext4_eof_flag()
 # Prerequisites for the test run.
 _supported_fs ext4
 _supported_os Linux
-_require_xfs_io_falloc
+_require_xfs_io_command "falloc"
 
 # Real QA test starts here.
 rm -f $seqres.full
index b4d3e4bb15a1f56c472eb1251901066f4aa6ccb3..65abe3c12ba37d1e201088ccd97cae62e461ed38 100644 (file)
@@ -44,7 +44,7 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
 
 # real QA test starts here
 _supported_os Linux
-_require_xfs_io_falloc_zero
+_require_xfs_io_command "fzero"
 
 testfile=$TEST_DIR/009.$$
 
index e68929950138cea1426cae52879f2a1d95c81426..730625bba6938d2a84cdc4605f17d1d6a008fe45 100755 (executable)
@@ -51,10 +51,10 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
 _supported_fs generic
 _supported_os Linux
 
-_require_xfs_io_falloc_punch
-_require_xfs_io_falloc
-_require_xfs_io_fiemap
-_require_xfs_io_falloc_collapse
+_require_xfs_io_command "fpunch"
+_require_xfs_io_command "falloc"
+_require_xfs_io_command "fiemap"
+_require_xfs_io_command "fcollapse"
 
 testfile=$TEST_DIR/$seq.$$
 
index 13a44883e0f5153c19c1b33f3de13ad9c290c4b9..15a255190b1c80b7682c501a50d796329850e169 100755 (executable)
@@ -51,10 +51,10 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
 _supported_fs generic
 _supported_os Linux
 
-_require_xfs_io_falloc_punch
-_require_xfs_io_falloc
-_require_xfs_io_fiemap
-_require_xfs_io_falloc_collapse
+_require_xfs_io_command "fpunch"
+_require_xfs_io_command "falloc"
+_require_xfs_io_command "fiemap"
+_require_xfs_io_command "fcollapse"
 
 testfile=$TEST_DIR/$seq.$$
 
index 93a4045bc3af38070558b6591fa15086399af2de..13b7254d8b2a80ccb84a0890eb36c8042823d92c 100755 (executable)
@@ -43,8 +43,8 @@ _supported_fs generic
 _supported_os Linux
 
 _require_scratch
-_require_xfs_io_fiemap
-_require_xfs_io_falloc_collapse
+_require_xfs_io_command "fiemap"
+_require_xfs_io_command "fcollapse"
 _do_die_on_error=y
 testfile=$SCRATCH_MNT/$seq.$$
 BLOCKS=10240
index 7f3753ad247c2aad82f6acaf2f2a7f2ab436c7a9..eb88e016dace8aa2b03b7d8b7082258723a3612a 100755 (executable)
@@ -51,10 +51,10 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
 _supported_fs generic
 _supported_os Linux
 
-_require_xfs_io_falloc_punch
-_require_xfs_io_falloc
-_require_xfs_io_fiemap
-_require_xfs_io_falloc_collapse
+_require_xfs_io_command "fpunch"
+_require_xfs_io_command "falloc"
+_require_xfs_io_command "fiemap"
+_require_xfs_io_command "fcollapse"
 
 testfile=$TEST_DIR/$seq.$$
 
index 55e7206e679a9cc94ed08add85bb7cea217aad66..55bf8c54938d05e9386a5b15c4d7dd379a77612a 100755 (executable)
@@ -51,10 +51,10 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
 _supported_fs generic
 _supported_os Linux
 
-_require_xfs_io_falloc_punch
-_require_xfs_io_falloc
-_require_xfs_io_fiemap
-_require_xfs_io_falloc_collapse
+_require_xfs_io_command "fpunch"
+_require_xfs_io_command "falloc"
+_require_xfs_io_command "fiemap"
+_require_xfs_io_command "fcollapse"
 
 testfile=$TEST_DIR/$seq.$$
 
index 3c8a304251c686e2a6f2942c479b363083fd2dd8..c99520ffc4649ff63508661a933b4f7a38a36539 100755 (executable)
@@ -54,7 +54,7 @@ _supported_os Linux
 
 rm -f $seqres.full
 
-_require_xfs_io_falloc
+_require_xfs_io_command "falloc"
 
 # check there's enough freespace on $TEST_DIR ... (1GiB + 1MiB)
 avail=`df -P $TEST_DIR | awk 'END {print $4}'`
index 1885534f275560349c640d6fde363d894c08b66a..444c1fe1a078669a21534917fad88f69c76a0eba 100755 (executable)
@@ -53,7 +53,7 @@ _supported_os Linux
 rm -f $seqres.full
 rm -f $TEST_DIR/ouch*
 
-_require_xfs_io_falloc
+_require_xfs_io_command "falloc"
 
 # Ok, off we go.
 
index 7b0e584091c4415d0433c753a8ce0ae6840ecddd..a67b8d584f00f5978acbae6d58b85a72c2d6d62e 100755 (executable)
@@ -46,7 +46,7 @@ _supported_fs generic
 _supported_os Linux
 
 _require_scratch
-_require_xfs_io_falloc
+_require_xfs_io_command "falloc"
 
 rm -f $seqres.full
 
index 03d4491fd6112f0f32770db15902d4043d90ca4c..7ac0872a69b3d0c895a44bda7b334a9089aa3ec2 100755 (executable)
@@ -53,7 +53,7 @@ _supported_os Linux
 rm -f $seqres.full
 
 # Sanity check to see if fallocate works
-_require_xfs_io_falloc
+_require_xfs_io_command "falloc"
 
 # Check if we have good enough space available
 avail=`df -P $TEST_DIR | awk 'END {print $4}'`
index dd329b469932d554f22cbcfe88aa70737d531e1a..8419065eebcd60e792281b8022fb721cf37aa24a 100755 (executable)
@@ -46,9 +46,9 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
 _supported_fs generic 
 _supported_os Linux
 
-_require_xfs_io_falloc_punch
-_require_xfs_io_falloc
-_require_xfs_io_fiemap
+_require_xfs_io_command "fpunch"
+_require_xfs_io_command "falloc"
+_require_xfs_io_command "fiemap"
 
 testfile=$TEST_DIR/255.$$
 
index cfe7237151ba0418cbf9ca36492b259fa6dee295..e6cc7dcff4780a06e04f4ed937a585b769601210 100755 (executable)
@@ -46,7 +46,7 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
 _supported_fs generic
 _supported_os Linux
 
-_require_xfs_io_falloc_punch
+_require_xfs_io_command "fpunch"
 _require_scratch
 _require_user
 
index 7c4887f4cbc56c6ab8abc40773691782d7bc3773..2d8d4962851268007615d49a57f8a5b96b97d255 100755 (executable)
@@ -48,7 +48,7 @@ _cleanup()
 _supported_fs generic
 _supported_os IRIX Linux
 _require_scratch
-_require_xfs_io_falloc
+_require_xfs_io_command "falloc"
 
 echo "------------------------------"
 echo "preallocation test"
index 4e07f8a455c21bf831dceabb9be21a248eecdddb..01d460032d1b3b96dc04cb63c3d71fd7f4e9643f 100755 (executable)
@@ -46,8 +46,8 @@ _require_scratch
 
 # xfs_io is not required for this test, but it's the best way to verify
 # the test system supports fallocate() for allocation and hole punching
-_require_xfs_io_falloc
-_require_xfs_io_falloc_punch
+_require_xfs_io_command "falloc"
+_require_xfs_io_command "fpunch"
 
 rm -f $seqres.full
 
index 284b59d54abead2e16ed5afbed2f1ca9828201c0..e38904980c4e1d5bdc14f3b6525cc78b76908d45 100755 (executable)
@@ -59,7 +59,7 @@ _require_dm_flakey
 
 # xfs_io is not required for this test, but it's the best way to verify
 # the test system supports fallocate() for allocation
-_require_xfs_io_falloc
+_require_xfs_io_command "falloc"
 
 [ -x $here/src/fsync-tester ] || _notrun "fsync-tester not built"
 
index eaec43cc1b07a5629418983b70223bcd4a1d8aae..1ed49626be98d124c1e8ede7d406bf1b5c837dbf 100755 (executable)
@@ -46,7 +46,7 @@ _cleanup()
 # real QA test starts here
 _supported_fs generic
 _supported_os Linux
-_require_xfs_io_falloc
+_require_xfs_io_command "falloc"
 _require_scratch
 
 # 5G in byte
index 8cb297522ea27d4c3aacda99f0a8e175aa8f88e7..29a4331f9d217cc2ad9e5876ec4828aa755dc4dd 100755 (executable)
@@ -45,8 +45,8 @@ _cleanup()
 _supported_fs generic
 _supported_os Linux
 
-_require_xfs_io_falloc_punch
-_require_xfs_io_fiemap
+_require_xfs_io_command "fpunch"
+_require_xfs_io_command "fiemap"
 
 testfile=$TEST_DIR/$seq.$$
 
index 6b5402c8328229342ad0419da4df3e31a0759667..f13c14b3fd14ae599f7d2afd4da29a4e968f3e61 100755 (executable)
@@ -33,7 +33,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
 _supported_fs ext4 xfs
 _supported_os Linux
 _require_fstrim
-_require_xfs_io_fiemap
+_require_xfs_io_command "fiemap"
 _require_fs_space $TEST_DIR 307200
 [ "$FSTYP" = "ext4" ] && _require_dumpe2fs
 
index 00be41adf595c6840857ed2b60eefee5bb1e4445..b2c4c089d8acac350a308174bed64fb9a540ab1d 100755 (executable)
@@ -46,8 +46,8 @@ trap "_cleanup ; exit \$status" 0 1 2 3 15
 _supported_fs xfs 
 _supported_os Linux
 
-_require_xfs_io_falloc_punch
-_require_xfs_io_fiemap
+_require_xfs_io_command "fpunch"
+_require_xfs_io_command "fiemap"
 
 testfile=$TEST_DIR/252.$$
 
index cbe7108d5bbd172a510f079c809ffa06db3e2a55..55322ec965ea3d79e44beabf8557c10a7c327cc1 100755 (executable)
@@ -46,7 +46,7 @@ trap "exit \$status" 0 1 2 3 15
 _supported_fs xfs
 _supported_os Linux
 
-_require_xfs_io_zero
+_require_xfs_io_command "zero"
 
 testfile=$TEST_DIR/290.$$