4 # XFS allocator test (preallocation - allocp, resvsp ,etc)
6 #-----------------------------------------------------------------------
7 # Copyright (c) 2000-2002 Silicon Graphics, Inc. All Rights Reserved.
8 #-----------------------------------------------------------------------
14 echo "QA output created by $seq"
18 status=1 # failure is the default!
19 trap "_cleanup; exit \$status" 0 1 2 3 15
20 # This isn't really related to fs block size, it's just what
21 # alloc uses for the "block" unit in it's input parameters...
33 -e 's/[0-9][0-9]*\.\.[0-9][0-9]*/BLOCKRANGE/g' \
34 -e "s/blocksize $bsize/blocksize BSIZE/g"
40 if ! _scratch_mkfs_xfs >$tmp.out 2>&1
43 echo "failed to mkfs $SCRATCH_DEV"
50 echo "failed to mount $SCRATCH_DEV"
57 ls -l $1 | $AWK_PROG '{print "filesize = " $5}'
60 # get standard environment, filters and checks
64 # real QA test starts here
66 _supported_os IRIX Linux
71 out=$SCRATCH_MNT/$$.tmp
73 # since we're using a clean FS here, we make some assumptions
74 # about availability of contiguous blocks
76 # also interesting to note is that ALLOC == FREE. seriously.
77 # the _length is ignored_ in irix. the file is allocated up
78 # to the specified offset, and zero filled if previously
79 # unallocated. the file is truncated at the specified point.
81 echo "*** test 1 - reservations cleared on O_TRUNC"
83 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
89 cat <<EOF | src/alloc -n -b $bsize -f $out -t | _block_filter
94 echo "*** test 2 - reserve & filesize"
96 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
102 echo "*** test 3 - alloc & filesize"
104 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
110 echo "*** test 4 - allocations cleared on O_TRUNC"
112 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
117 cat <<EOF | src/alloc -n -b $bsize -f $out -t | _block_filter
122 echo "*** test 5 - reserve / unreserve"
124 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
132 echo "*** test 6 - reserve adjacent"
134 cat <<EOF | src/alloc -t -n -b $bsize -f $out | _block_filter
140 echo "*** test 7 - alloc"
142 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
151 echo "*** test 8 - alloc & truncate"
153 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter
162 echo "*** test 9 - reserve & truncate"
164 cat <<EOF | src/alloc -n -b $bsize -f $out | _block_filter