Whamcloud - gitweb
b=24055 a patch to detect if quota is turned on properly
[fs/lustre-release.git] / lustre / quota / quota_context.c
index ace8caa..4d56826 100644 (file)
@@ -1496,30 +1496,17 @@ exit:
         EXIT;
 }
 
-int quota_is_on(struct lustre_quota_ctxt *qctxt, struct obd_quotactl *oqctl)
+inline int quota_is_on(struct lustre_quota_ctxt *qctxt,
+                       struct obd_quotactl *oqctl)
 {
-        unsigned int type;
-
-        for (type = USRQUOTA; type < MAXQUOTAS; type++) {
-                if (!Q_TYPESET(oqctl, type))
-                        continue;
-                if (!(qctxt->lqc_flags & UGQUOTA2LQC(oqctl->qc_type)))
-                        return 0;
-        }
-        return 1;
+        return ((qctxt->lqc_flags & UGQUOTA2LQC(oqctl->qc_type)) ==
+                UGQUOTA2LQC(oqctl->qc_type));
 }
 
-int quota_is_off(struct lustre_quota_ctxt *qctxt, struct obd_quotactl *oqctl)
+inline int quota_is_off(struct lustre_quota_ctxt *qctxt,
+                        struct obd_quotactl *oqctl)
 {
-        unsigned int type;
-
-        for (type = USRQUOTA; type < MAXQUOTAS; type++) {
-                if (!Q_TYPESET(oqctl, type))
-                        continue;
-                if (qctxt->lqc_flags & UGQUOTA2LQC(oqctl->qc_type))
-                        return 0;
-        }
-        return 1;
+        return !(qctxt->lqc_flags & UGQUOTA2LQC(oqctl->qc_type));
 }
 
 /**