common/quota: move _qsetup() helper to common code
[xfstests-dev.git] / common / quota
index 1437d5f768bcc9dbabf4f503c12c9e4aee502d6d..32a9a55593d5352f1a1227c41698271719deee93 100644 (file)
@@ -329,5 +329,25 @@ _report_quota_inodes() {
        repquota $1 | egrep "^($qa_user|root|nobody)" | awk '{print $1, $6, $7, $8}' | sort -r
 }
 
        repquota $1 | egrep "^($qa_user|root|nobody)" | awk '{print $1, $6, $7, $8}' | sort -r
 }
 
+# Determine which type of quota we're using
+_qsetup()
+{
+       opt=$1
+       enforce=0
+       if [ $opt = "u" -o $opt = "uno" ]; then
+               type=u
+               eval `_choose_uid`
+       elif [ $opt = "g" -o $opt = "gno" ]; then
+               type=g
+               eval `_choose_gid`
+       elif [ $opt = "p" -o $opt = "pno" ]; then
+               type=p
+               eval `_choose_prid`
+       fi
+       [ $opt = "u" -o $opt = "g" -o $opt = "p" ] && enforce=1
+
+       echo "Using type=$type id=$id" >> $seqres.full
+}
+
 # make sure this script returns success
 /bin/true
 # make sure this script returns success
 /bin/true