]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfstests: add a helper to get the minimum dio size
authorChristoph Hellwig <hch@infradead.org>
Wed, 6 Nov 2013 10:59:32 +0000 (10:59 +0000)
committerRich Johnston <rjohnston@sgi.com>
Wed, 13 Nov 2013 02:17:56 +0000 (20:17 -0600)
Various tests opencode checks to find out the minimum support direct I/O
size.  Replace those with a generic helper that handles network filesystems as
well.  Also remove the Linux 2.4 workaround we had in once place.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
common/rc
tests/generic/091
tests/generic/240
tests/generic/263

index ea3af128086d0652918d7a7de692722ac6b0f668..f73414bddaebddf4cb412f0d670e41d04ac604aa 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -2179,6 +2179,21 @@ _scale_fsstress_args()
     echo $args
 }
 
+#
+# Return the logical block size if running on a block device,
+# else substitute the page size.
+#
+_min_dio_alignment()
+{
+    dev=$1
+
+    if [ -b "$dev" ]; then
+        blockdev --getss $dev
+    else
+        $here/src/feature -s
+    fi
+}
+
 run_check()
 {
        echo "# $@" >> $seqres.full 2>&1
index cee012dce97e2dd88ef0eb15dad14a507636768f..bb176f13c0ca1602389b8638752215a34a65810f 100755 (executable)
@@ -54,11 +54,7 @@ run_fsx()
 }
 
 psize=`$here/src/feature -s`
-bsize=`blockdev --getss $TEST_DEV`
-kernel=`uname -r  | sed -e 's/\(2\..\).*/\1/'`
-
-# 2.4 Linux kernels support bsize aligned direct I/O only
-[ "$HOSTOS" = "Linux" -a "$kernel" = "2.4" ] && bsize=$psize
+bsize=`_min_dio_alignment $TEST_DEV`
 
 # fsx usage:
 # 
index e6923180f92acf22123fa2ea33a19963e635a8f2..e26f49512d78dc726276ad3075d6bc3c4825ae7b 100755 (executable)
@@ -60,7 +60,7 @@ rm -f $seqres.full
 
 rm -f $TEST_DIR/aiodio_sparse
 
-logical_block_size=`blockdev --getss $TEST_DEV`
+logical_block_size=`_min_dio_alignment $TEST_DEV`
 fs_block_size=`stat -f $TEST_DIR | grep "Block size:" | awk '{print $3}'`
 
 if [ $fs_block_size -le $logical_block_size ]; then
index 377b199a4ebaa704110f0ad35b16cce4ea3d1d88..bc59865edde4863a0d7290572c03d8dcb1ef4f7f 100755 (executable)
@@ -54,7 +54,7 @@ run_fsx()
 }
 
 psize=`$here/src/feature -s`
-bsize=`blockdev --getss $TEST_DEV`
+bsize=`_min_dio_alignment $TEST_DEV`
 
 run_fsx -N 10000  -o 8192   -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z
 run_fsx -N 10000  -o 128000 -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z