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>
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
}
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:
#
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
}
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