common: extract rt extent size for _get_file_block_size
[xfstests-dev.git] / common / ceph
1 #
2 # CephFS specific common functions.
3 #
4
5 # _ceph_create_file_layout <filename> <stripe unit> <stripe count> <object size>
6 # This function creates a new empty file and sets the file layout according to
7 # parameters.  It will exit if the file already exists.
8 _ceph_create_file_layout()
9 {
10         local fname=$1
11         local stripe_unit=$2
12         local stripe_count=$3
13         local obj_size=$4
14
15         if [ -e $fname ]; then
16                 echo "File $fname already exists."
17                 exit 1
18         fi
19         touch $fname
20         $SETFATTR_PROG -n ceph.file.layout \
21                 -v "stripe_unit=$objsz stripe_count=1 object_size=$objsz" \
22                 $fname
23 }