xfsqa: Add fiemap exerciser

Preliminary fiemap testing support based on a test util written by
Josef Bacik.

For now it's only run with preallocation disabled, because xfs has a
tendency to fill in holes with data blocks (EOF prealloc stuff I
think) and similar for explicit preallocation, so this is breaking
the preallocation tests for now, when it finds a "data" block where
it expects a preallocated block.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
Eric Sandeen
2010-03-06 11:24:54 +11:00
committed by Dave Chinner
parent b2de346746
commit db5926819a
8 changed files with 734 additions and 0 deletions
+62
View File
@@ -0,0 +1,62 @@
#! /bin/sh
# FS QA Test No. 225
#
# Run the fiemap (file extent mapping) tester
#
#-----------------------------------------------------------------------
# Copyright (c) 2009 Eric Sandeen. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it would be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#-----------------------------------------------------------------------
#
# creator
owner=sandeen@sandeen.net
seq=`basename $0`
echo "QA output created by $seq"
here=`pwd`
tmp=tmp/$$
status=1 # failure is the default!
trap "_cleanup; exit \$status" 0 1 2 3 15
_cleanup()
{
cd /
rm -f $tmp.*
_cleanup_testdir
}
# get standard environment, filters and checks
. ./common.rc
. ./common.filter
# real QA test starts here
_supported_fs generic
_supported_os Linux
_setup_testdir
fiemapfile=$TEST_DIR/fiemap.$$
[ -x $here/src/fiemap-tester ] || _notrun "fiemap-tester not built"
echo "fiemap run without preallocation"
$here/src/fiemap-tester -q -p 0 -r 200 /mnt/test/fiemapfile
rm -f $fiemapfile
rm -f $seq.full
status=0
exit
+2
View File
@@ -0,0 +1,2 @@
QA output created by 225
fiemap run without preallocation
Vendored
+19
View File
@@ -11,6 +11,25 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
AC_DEFUN([AC_PACKAGE_WANT_LINUX_FIEMAP_H],
[ AC_CHECK_HEADERS([linux/fiemap.h], [ have_fiemap=true ], [ have_fiemap=false ])
AC_SUBST(have_fiemap)
])
AC_DEFUN([AC_PACKAGE_WANT_FALLOCATE],
[ AC_MSG_CHECKING([for fallocate])
AC_TRY_LINK([
#define _GNU_SOURCE
#define _FILE_OFFSET_BITS 64
#include <fcntl.h>
#include <linux/falloc.h>
], [
fallocate(0, 0, 0, 0);
], have_fallocate=yes
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no))
AC_SUBST(have_fallocate)
])
m4_include([m4/multilib.m4])
m4_include([m4/package_acldev.m4])
m4_include([m4/package_aiodev.m4])
+2
View File
@@ -64,6 +64,8 @@ in
AC_PACKAGE_WANT_GDBM
AC_PACKAGE_WANT_AIO
AC_PACKAGE_WANT_DMAPI
AC_PACKAGE_WANT_LINUX_FIEMAP_H
AC_PACKAGE_WANT_FALLOCATE
;;
esac
+1
View File
@@ -338,3 +338,4 @@ deprecated
222 auto fsr ioctl quick
223 auto quick
224 auto
225 auto quick
+2
View File
@@ -60,6 +60,8 @@ HAVE_DB = @have_db@
HAVE_AIO = @have_aio@
HAVE_DMAPI = @have_dmapi@
HAVE_ATTR_LIST = @have_attr_list@
HAVE_FIEMAP = @have_fiemap@
HAVE_FALLOCATE = @have_fallocate@
GCCFLAGS = -funsigned-char -fno-strict-aliasing -Wall
+8
View File
@@ -25,6 +25,14 @@ ifeq ($(HAVE_XLOG_ASSIGN_LSN), true)
LINUX_TARGETS += loggen
endif
ifeq ($(HAVE_FIEMAP), true)
LINUX_TARGETS += fiemap-tester
endif
ifeq ($(HAVE_FALLOCATE),yes)
LCFLAGS += -DHAVE_FALLOCATE
endif
IRIX_TARGETS = open_unlink
ifeq ($(PKG_PLATFORM),linux)
+638
View File
File diff suppressed because it is too large Load Diff