common/rc: factor out _scratch_xfs_[get|set]_sb_field
[xfstests-dev.git] / dmapi / src / suite2 / bindir / make_holey
1 #!/bin/ksh
2 #
3 # Copyright (c) 2000-2001 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5
6 if [[ $# != 3 ]]
7 then print "usage: ${0##*/} bindir target_file count"
8      exit 1
9 fi
10
11 typeset -i offset
12 typeset -i length
13 typeset -i count
14
15 RANDOM=$SECONDS
16 offset=0
17 length=$RANDOM
18 count=$3
19
20 while (( count > 0 ))
21 do 
22         print "Count: $count"
23         $1/wf -l $length -L $offset -b 512 $2
24         (( offset = RANDOM * 512 + offset + length )) 
25         (( length = RANDOM ))
26         (( count = count - 1 ))
27 done
28
29