4 export PATH=`dirname $0`:`dirname $0`/../utils:$PATH
5 CREATEMANY=${CREATEMANY:-createmany}
6 STATMANY=${STATMANY:-statmany}
7 UNLINKMANY=${UNLINKMANY:-unlinkmany}
10 MOUNT=${MOUNT:-/mnt/lustre}
11 MOUNT2=${MOUNT2:-/mnt/lustre2}
17 [ $CR_PID ] && kill -9 $CR_PID
18 [ $ST_PID ] && kill -9 $ST_PID
24 LOCKFILE=$LOCKDIR/lockfile
34 while [ $MINRES -gt $MAXRES ]; do
35 FILETMP=$MINDIR/f$$${NUM}
36 DIRTMP=$DIR/d$$/d${NUM}
39 FILERES=`ls -id $FILETMP | awk '{ print $1 }'`
40 DIRRES=`ls -id $DIRTMP | awk '{ print $1 }'`
41 if [ $DIRRES -gt $MAXRES ]; then
45 if [ $FILERES -lt $MINRES -o -z "$MINFILE" ]; then
46 [ -f "$MINFILE" ] && rm $MINFILE
59 $LCTL mark "start dir: $LOCKDIR=$MAXRES file: $LOCKFILE=$MINRES"
60 # link will lock $LOCKFILE and $DIR as it creates ${LOCKFILE}{0,1,...}
61 $CREATEMANY -l$LOCKFILE $LOCKFILE -$COUNT &
64 while ! test -f ${LOCKFILE}1 ; do
68 # this will lock $DIR and ${LOCKFILE}0
69 $STATMANY -s $DIR2/lockdir/lockfile 1 -$COUNT &
74 $UNLINKMANY $DIR2/lockdir/lockfile 1 $(($COUNT * 1000)) || true