Whamcloud - gitweb
Branch b1_8
authortianzy <tianzy>
Fri, 25 Jul 2008 13:34:21 +0000 (13:34 +0000)
committertianzy <tianzy>
Fri, 25 Jul 2008 13:34:21 +0000 (13:34 +0000)
add quota statistics and sort out quota lproc code.
b=15058
i=johann
i=andrew.perepechko

lustre/include/obd_class.h

index b609938..9c37b03 100644 (file)
@@ -1434,15 +1434,34 @@ static inline int obd_quotactl(struct obd_export *exp,
 }
 
 static inline int obd_quota_adjust_qunit(struct obd_export *exp,
-                                         struct quota_adjust_qunit *oqaq)
+                                         struct quota_adjust_qunit *oqaq,
+                                         struct lustre_quota_ctxt *qctxt)
 {
+#ifdef LPROCFS
+        struct timeval work_start;
+        struct timeval work_end;
+        long timediff;
+#endif
         int rc;
         ENTRY;
 
+#ifdef LPROCFS
+        if (qctxt)
+                do_gettimeofday(&work_start);
+#endif
         EXP_CHECK_OP(exp, quota_adjust_qunit);
         EXP_COUNTER_INCREMENT(exp, quota_adjust_qunit);
 
-        rc = OBP(exp->exp_obd, quota_adjust_qunit)(exp, oqaq);
+        rc = OBP(exp->exp_obd, quota_adjust_qunit)(exp, oqaq, qctxt);
+
+#ifdef LPROCFS
+        if (qctxt) {
+                do_gettimeofday(&work_end);
+                timediff = cfs_timeval_sub(&work_end, &work_start, NULL);
+                lprocfs_counter_add(qctxt->lqc_stats, LQUOTA_ADJUST_QUNIT,
+                                    timediff);
+        }
+#endif
         RETURN(rc);
 }