Whamcloud - gitweb
LU-17705 ptlrpc: replace synchronize_rcu() with rcu_barrier()
[fs/lustre-release.git] / lustre / tests / racer / dir_remote.sh
1 #!/bin/bash
2 trap 'kill $(jobs -p)' EXIT
3
4 DIR=$1
5 MAX=$2
6
7 MDTCOUNT=${MDSCOUNT:-$($LFS df $DIR 2> /dev/null | grep -c MDT)}
8 while (( MDTCOUNT > 1 )) ; do
9         remote_dir=$((RANDOM % MAX))
10         file=$((RANDOM % MAX))
11         mdt_idx=$((RANDOM % MDTCOUNT))
12
13         if $RACER_ENABLE_STRIPED_DIRS; then
14                 # stripe_count in range [1,MDTCOUNT]
15                 # $LFS mkdir treats stripe_count 0 and 1 the same
16                 stripe_count_opt="-c$((RANDOM % MDTCOUNT + 1))"
17         else
18                 stripe_count_opt=""
19         fi
20
21         $LFS mkdir -i$mdt_idx $stripe_count_opt $DIR/$remote_dir 2> /dev/null
22         touch $DIR/$remote_dir/$file 2> /dev/null
23         $LFS getdirstripe $DIR/$remote_dir > /dev/null 2>&1
24 done