#!/bin/bash
ROOT=/mnt/ceph
#mkdir $ROOT/

declare -a os=("524288" "1048576" "4194304" "8388608")
declare -a su=("65536" "131072" "262144" "524288")
declare -a sc=("2" "4" "8" "16")

setlayout () {
   echo "setfattr -n ceph.dir.layout.stripe_unit  -v  $3 $1"
   echo "setfattr -n ceph.dir.layout.stripe_count -v  $4 $1"
   echo "setfattr -n ceph.dir.layout.object_size  -v  $2 $1"
   setfattr -n ceph.dir.layout.stripe_unit  -v  $3 $1
   setfattr -n ceph.dir.layout.stripe_count -v  $4 $1
   setfattr -n ceph.dir.layout.object_size  -v  $2 $1

}


for s in ${os[@]}; do
   for u in ${su[@]}; do
     for c in ${sc[@]}; do
       d="$ROOT/test_os-${s}_su-${u}_sc-${c}"
       echo "mkdir $d"
       mkdir $d
       setlayout $d $s $u $c
     done
   done
done
