3 #-----------------------------------------------------------------------
4 # Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License as
8 # published by the Free Software Foundation.
10 # This program is distributed in the hope that it would be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write the Free Software Foundation,
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 #-----------------------------------------------------------------------
23 # XFS allocator test (preallocation - allocp, resvsp ,etc)
29 echo "QA output created by $seq"
33 status=1 # failure is the default!
34 trap "_cleanup; exit \$status" 0 1 2 3 15
35 # This isn't really related to fs block size, it's just what
36 # alloc uses for the "block" unit in it's input parameters...
48 -e 's/[0-9][0-9]*\.\.[0-9][0-9]*/BLOCKRANGE/g' \
49 -e "s/blocksize $bsize/blocksize BSIZE/g"
55 if ! _scratch_mkfs_xfs >$tmp.out 2>&1
58 echo "failed to mkfs $SCRATCH_DEV"
65 echo "failed to mount $SCRATCH_DEV"
72 ls -l $1 | $AWK_PROG '{print "filesize = " $5}'
75 # get standard environment, filters and checks
79 # real QA test starts here
81 _supported_os IRIX Linux
86 out=$SCRATCH_MNT/$$.tmp
88 # since we're using a clean FS here, we make some assumptions
89 # about availability of contiguous blocks
91 # also interesting to note is that ALLOC == FREE. seriously.
92 # the _length is ignored_ in irix. the file is allocated up
93 # to the specified offset, and zero filled if previously
94 # unallocated. the file is truncated at the specified point.
96 echo "*** test 1 - reservations cleared on O_TRUNC"
98 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
104 cat <<EOF | src/alloc -n -b $bsize -f $out -t | _block_filter
109 echo "*** test 2 - reserve & filesize"
111 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
117 echo "*** test 3 - alloc & filesize"
119 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
125 echo "*** test 4 - allocations cleared on O_TRUNC"
127 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
132 cat <<EOF | src/alloc -n -b $bsize -f $out -t | _block_filter
137 echo "*** test 5 - reserve / unreserve"
139 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
147 echo "*** test 6 - reserve adjacent"
149 cat <<EOF | src/alloc -t -n -b $bsize -f $out | _block_filter
155 echo "*** test 7 - alloc"
157 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
166 echo "*** test 8 - alloc & truncate"
168 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
177 echo "*** test 9 - reserve & truncate"
179 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter