Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / quota / quota_adjust_qunit.c
index 20ee26b..1c20d86 100644 (file)
 # include <linux/fs.h>
 # include <linux/jbd.h>
 # include <linux/quota.h>
-# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
-#  include <linux/smp_lock.h>
-#  include <linux/buffer_head.h>
-#  include <linux/workqueue.h>
-#  include <linux/mount.h>
-# else
-#  include <linux/locks.h>
-# endif
+# include <linux/smp_lock.h>
+# include <linux/buffer_head.h>
+# include <linux/workqueue.h>
+# include <linux/mount.h>
 #else /* __KERNEL__ */
 # include <liblustre.h>
 #endif
@@ -317,7 +313,7 @@ int filter_quota_adjust_qunit(struct obd_export *exp,
                               struct lustre_quota_ctxt *qctxt)
 {
         struct obd_device *obd = exp->exp_obd;
-        unsigned int uid = 0, gid = 0;
+        unsigned int id[MAXQUOTAS] = { 0, 0 };
         int rc = 0;
         ENTRY;
 
@@ -329,13 +325,14 @@ int filter_quota_adjust_qunit(struct obd_export *exp,
                 RETURN(rc);
         }
         if (QAQ_IS_GRP(oqaq))
-                gid = oqaq->qaq_id;
+                id[GRPQUOTA] = oqaq->qaq_id;
         else
-                uid = oqaq->qaq_id;
+                id[USRQUOTA] = oqaq->qaq_id;
 
         if (rc > 0) {
-                rc = qctxt_adjust_qunit(obd, qctxt, uid, gid, 1, 0, NULL);
-                if (rc == -EDQUOT || rc == -EBUSY || rc == -EAGAIN) {
+                rc = qctxt_adjust_qunit(obd, qctxt, id, 1, 0, NULL);
+                if (rc == -EDQUOT || rc == -EBUSY ||
+                    rc == QUOTA_REQ_RETURNED || rc == -EAGAIN) {
                         CDEBUG(D_QUOTA, "rc: %d.\n", rc);
                         rc = 0;
                 }