+test_quota_performance() {
+ TESTFILE="$DIR/$tdir/$tfile-0"
+ local size=$1
+ local stime=`date +%s`
+ $RUNAS dd if=/dev/zero of=$TESTFILE bs=1M count=$size || quota_error u $TSTUSR "write failure"
+ local etime=`date +%s`
+ delta=$((etime - stime))
+ if [ $delta -gt 0 ]; then
+ rate=$((size * 1024 / delta))
+ [ $rate -gt 1024 ] || error "SLOW IO for $TSTUSR (user): $rate KB/sec"
+ fi
+ rm -f $TESTFILE
+}
+
+# test basic quota performance b=21696
+test_0() {
+ mkdir -p $DIR/$tdir
+ chmod 0777 $DIR/$tdir
+ MB=100
+ [ "$SLOW" = "no" ] && MB=10
+
+ test_quota_performance $MB
+
+ $LFS setquota -u $TSTUSR -b 0 -B $((1024*1024)) -i 0 -I 0 $DIR
+ test_quota_performance $MB
+
+ resetquota -u $TSTUSR
+}
+run_test_with_stat 0 "Test basic quota performance ==="
+