4 # XFS allocator test (preallocation - allocp, resvsp ,etc)
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
9 # This program is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License as
11 # published by the Free Software Foundation.
13 # This program is distributed in the hope that it would be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write the Free Software Foundation,
20 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #-----------------------------------------------------------------------
28 echo "QA output created by $seq"
32 status=1 # failure is the default!
33 trap "_cleanup; exit \$status" 0 1 2 3 15
34 # This isn't really related to fs block size, it's just what
35 # alloc uses for the "block" unit in it's input parameters...
47 -e 's/[0-9][0-9]*\.\.[0-9][0-9]*/BLOCKRANGE/g' \
48 -e "s/blocksize $bsize/blocksize BSIZE/g"
54 if ! _scratch_mkfs_xfs >$tmp.out 2>&1
57 echo "failed to mkfs $SCRATCH_DEV"
64 echo "failed to mount $SCRATCH_DEV"
71 ls -l $1 | $AWK_PROG '{print "filesize = " $5}'
74 # get standard environment, filters and checks
78 # real QA test starts here
80 _supported_os IRIX Linux
85 out=$SCRATCH_MNT/$$.tmp
87 # since we're using a clean FS here, we make some assumptions
88 # about availability of contiguous blocks
90 # also interesting to note is that ALLOC == FREE. seriously.
91 # the _length is ignored_ in irix. the file is allocated up
92 # to the specified offset, and zero filled if previously
93 # unallocated. the file is truncated at the specified point.
95 echo "*** test 1 - reservations cleared on O_TRUNC"
97 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
103 cat <<EOF | src/alloc -n -b $bsize -f $out -t | _block_filter
108 echo "*** test 2 - reserve & filesize"
110 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
116 echo "*** test 3 - alloc & filesize"
118 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
124 echo "*** test 4 - allocations cleared on O_TRUNC"
126 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
131 cat <<EOF | src/alloc -n -b $bsize -f $out -t | _block_filter
136 echo "*** test 5 - reserve / unreserve"
138 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
146 echo "*** test 6 - reserve adjacent"
148 cat <<EOF | src/alloc -t -n -b $bsize -f $out | _block_filter
154 echo "*** test 7 - alloc"
156 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
165 echo "*** test 8 - alloc & truncate"
167 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
176 echo "*** test 9 - reserve & truncate"
178 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter