Whamcloud - gitweb
LU-9558 llite: handle struct vm_operations changes
[fs/lustre-release.git] / lustre / quota / qsd_writeback.c
index 9b12c2c..47fd727 100644 (file)
@@ -338,12 +338,14 @@ void qsd_adjust_schedule(struct lquota_entry *lqe, bool defer, bool cancel)
        }
 
        if (list_empty(&lqe->lqe_link)) {
-               if (cancel)
+               if (!cancel) {
+                       lqe->lqe_adjust_time = ktime_get_seconds();
+                       if (defer)
+                               lqe->lqe_adjust_time += QSD_WB_INTERVAL;
+               } else {
                        lqe->lqe_adjust_time = 0;
-               else
-                       lqe->lqe_adjust_time = defer ?
-                               cfs_time_shift_64(QSD_WB_INTERVAL) :
-                               cfs_time_current_64();
+               }
+
                /* lqe reference transferred to list */
                if (defer)
                        list_add_tail(&lqe->lqe_link,
@@ -376,8 +378,7 @@ static bool qsd_job_pending(struct qsd_instance *qsd, struct list_head *upd,
                struct lquota_entry *lqe;
                lqe = list_entry(qsd->qsd_adjust_list.next,
                                     struct lquota_entry, lqe_link);
-               if (cfs_time_beforeq_64(lqe->lqe_adjust_time,
-                                       cfs_time_current_64()))
+               if (ktime_get_seconds() > lqe->lqe_adjust_time)
                        job_pending = true;
        }
        spin_unlock(&qsd->qsd_adjust_lock);
@@ -388,16 +389,14 @@ static bool qsd_job_pending(struct qsd_instance *qsd, struct list_head *upd,
                job_pending = true;
        }
 
-       if (qsd->qsd_acct_failed) {
-               /* don't bother kicking off reintegration if space accounting
-                * failed to be enabled */
-               write_unlock(&qsd->qsd_lock);
-               return job_pending;
-       }
-
        for (qtype = USRQUOTA; qtype < LL_MAXQUOTAS; qtype++) {
                struct qsd_qtype_info *qqi = qsd->qsd_type_array[qtype];
 
+               /* don't bother kicking off reintegration if space accounting
+                * failed to be enabled */
+               if (qqi->qqi_acct_failed)
+                       continue;
+
                if (!qsd_type_enabled(qsd, qtype))
                        continue;
 
@@ -423,7 +422,7 @@ static int qsd_upd_thread(void *arg)
        int                      qtype, rc = 0;
        bool                     uptodate;
        struct lquota_entry     *lqe;
-       __u64                    cur_time;
+       time64_t cur_time;
        ENTRY;
 
        OBD_ALLOC_PTR(env);
@@ -454,13 +453,12 @@ static int qsd_upd_thread(void *arg)
                }
 
                spin_lock(&qsd->qsd_adjust_lock);
-               cur_time = cfs_time_current_64();
+               cur_time = ktime_get_seconds();
                while (!list_empty(&qsd->qsd_adjust_list)) {
                        lqe = list_entry(qsd->qsd_adjust_list.next,
                                         struct lquota_entry, lqe_link);
                        /* deferred items are sorted by time */
-                       if (!cfs_time_beforeq_64(lqe->lqe_adjust_time,
-                                                cur_time))
+                       if (lqe->lqe_adjust_time > cur_time)
                                break;
 
                        list_del_init(&lqe->lqe_link);