From dc05ba8ab387161e99ef5982c1f21ad8e130e23a Mon Sep 17 00:00:00 2001 From: tianzy Date: Fri, 25 Jul 2008 13:34:21 +0000 Subject: [PATCH] Branch b1_8 add quota statistics and sort out quota lproc code. b=15058 i=johann i=andrew.perepechko --- lustre/include/obd_class.h | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/lustre/include/obd_class.h b/lustre/include/obd_class.h index b609938..9c37b03 100644 --- a/lustre/include/obd_class.h +++ b/lustre/include/obd_class.h @@ -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); } -- 1.8.3.1