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 #-----------------------------------------------------------------------
26 seqres=$RESULT_DIR/$seq
27 echo "QA output created by $seq"
31 status=1 # failure is the default!
32 trap "_cleanup; exit \$status" 0 1 2 3 15
33 # This isn't really related to fs block size, it's just what
34 # alloc uses for the "block" unit in it's input parameters...
46 -e 's/[0-9][0-9]*\.\.[0-9][0-9]*/BLOCKRANGE/g' \
47 -e "s/blocksize $bsize/blocksize BSIZE/g"
53 if ! _scratch_mkfs_xfs >$tmp.out 2>&1
56 echo "failed to mkfs $SCRATCH_DEV"
63 echo "failed to mount $SCRATCH_DEV"
70 ls -l $1 | $AWK_PROG '{print "filesize = " $5}'
73 # get standard environment, filters and checks
77 # real QA test starts here
79 _supported_os IRIX Linux
84 out=$SCRATCH_MNT/$$.tmp
86 # since we're using a clean FS here, we make some assumptions
87 # about availability of contiguous blocks
89 # also interesting to note is that ALLOC == FREE. seriously.
90 # the _length is ignored_ in irix. the file is allocated up
91 # to the specified offset, and zero filled if previously
92 # unallocated. the file is truncated at the specified point.
94 echo "*** test 1 - reservations cleared on O_TRUNC"
96 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
102 cat <<EOF | src/alloc -n -b $bsize -f $out -t | _block_filter
107 echo "*** test 2 - reserve & filesize"
109 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
115 echo "*** test 3 - alloc & filesize"
117 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
123 echo "*** test 4 - allocations cleared on O_TRUNC"
125 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
130 cat <<EOF | src/alloc -n -b $bsize -f $out -t | _block_filter
135 echo "*** test 5 - reserve / unreserve"
137 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
145 echo "*** test 6 - reserve adjacent"
147 cat <<EOF | src/alloc -t -n -b $bsize -f $out | _block_filter
153 echo "*** test 7 - alloc"
155 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
164 echo "*** test 8 - alloc & truncate"
166 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
175 echo "*** test 9 - reserve & truncate"
177 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter