3 # $Id: 071,v 1.1 2003/07/07 03:34:36 fsgqa Exp $
5 # Exercise IO at large file offsets (just terabytes for now).
7 #-----------------------------------------------------------------------
8 # Copyright (c) 2000-2003 Silicon Graphics, Inc. All Rights Reserved.
10 # This program is free software; you can redistribute it and/or modify it
11 # under the terms of version 2 of the GNU General Public License as
12 # published by the Free Software Foundation.
14 # This program is distributed in the hope that it would be useful, but
15 # WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 # Further, this software is distributed without any warranty that it is
19 # free of the rightful claim of any third person regarding infringement
20 # or the like. Any license provided herein, whether implied or
21 # otherwise, applies only to this software file. Patent licenses, if
22 # any, provided herein do not apply to combinations of this program with
23 # other software, or any other product whatsoever.
25 # You should have received a copy of the GNU General Public License along
26 # with this program; if not, write the Free Software Foundation, Inc., 59
27 # Temple Place - Suite 330, Boston MA 02111-1307, USA.
29 # Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
30 # Mountain View, CA 94043, or:
34 # For further information regarding this notice, see:
36 # http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
37 #-----------------------------------------------------------------------
43 echo "QA output created by $seq"
48 status=1 # failure is the default!
53 umount $SCRATCH_DEV 2>/dev/null
55 trap "_cleanup; exit \$status" 0 1 2 3 15
57 # get standard environment, filters and checks
68 [ `$direct` ] && flags=-d
70 echo "Writing $bytes bytes at $location (direct=$direct)" | tee -a $seq.full
71 xfs_io -c "pwrite $offset 512" $flags $SCRATCH_MNT/$seq
73 echo "Saving block map to $seq.full" | tee -a $seq.full
74 xfs_bmap -v $SCRATCH_MNT/$seq >>$seq.full
76 echo "Reading $bytes bytes at $location (direct=$direct)" | tee -a $seq.full
77 xfs_io -c "pread $offset $bytes" $flags $SCRATCH_MNT/$seq
78 xfs_io -c "pread -v $offset $bytes" $flags $SCRATCH_MNT/$seq >>$seq.full
80 echo | tee -a $seq.full
83 # real QA test starts here
85 _scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
90 oneTB=`echo 1024 \* 1024 \* 1024 \* 1024 | bc`
92 # Step from 1Tb through 16Tb, doing seek/writes/reads on each
93 # boundary (using holey files), 1byte back from the boundary,
94 # and 1FSB back from the boundary (and xfs_bmaps all the way).
96 xfs_io -c "truncate 0" -f $SCRATCH_MNT/$seq
99 while [ $count -le 16 ]
102 offset=`echo $oneTB \* $count | bc`
103 write_block "$count Tb" $offset 512 false
104 offset=`echo $oneTB \* $count \- 1 | bc`
105 write_block "$count Tb minus 1 byte" $offset 512 false
106 offset=`echo $oneTB \* $count \- $dbsize | bc`
107 write_block "$count Tb minus 1 FSB" $offset 512 false
110 offset=`echo $oneTB \* $count | bc`
111 write_block "$count Tb" $offset $dbsize true
112 offset=`echo $oneTB \* $count \- 1 | bc`
113 write_block "$count Tb minus 1 FSB" $offset $dbsize true
115 count=`expr $count + 1`