Whamcloud - gitweb
LU-7988 hsm: remove hsd.request_sz from struct hsm_scan_data
[fs/lustre-release.git] / lustre / quota / qsd_writeback.c
index 56dbdcb..3109ca3 100644 (file)
@@ -21,7 +21,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright (c) 2012, 2013, Intel Corporation.
+ * Copyright (c) 2012, 2014, Intel Corporation.
  * Use is subject to license terms.
  *
  * Author: Johann Lombardi <johann.lombardi@intel.com>
@@ -30,6 +30,7 @@
 
 #define DEBUG_SUBSYSTEM S_LQUOTA
 
+#include <linux/kthread.h>
 #include "qsd_internal.h"
 
 extern struct kmem_cache *upd_kmem;
@@ -56,7 +57,6 @@ static struct qsd_upd_rec *qsd_upd_alloc(struct qsd_qtype_info *qqi,
 
        OBD_SLAB_ALLOC_PTR_GFP(upd, upd_kmem, GFP_NOFS);
        if (upd == NULL) {
-               CERROR("Failed to allocate upd");
                return NULL;
        }
 
@@ -339,7 +339,7 @@ void qsd_adjust_schedule(struct lquota_entry *lqe, bool defer, bool cancel)
                        lqe->lqe_adjust_time = defer ?
                                cfs_time_shift_64(QSD_WB_INTERVAL) :
                                cfs_time_current_64();
-               /* lqe reference transfered to list */
+               /* lqe reference transferred to list */
                if (defer)
                        list_add_tail(&lqe->lqe_link,
                                          &qsd->qsd_adjust_list);
@@ -390,7 +390,7 @@ static bool qsd_job_pending(struct qsd_instance *qsd, struct list_head *upd,
                return job_pending;
        }
 
-       for (qtype = USRQUOTA; qtype < MAXQUOTAS; qtype++) {
+       for (qtype = USRQUOTA; qtype < LL_MAXQUOTAS; qtype++) {
                struct qsd_qtype_info *qqi = qsd->qsd_type_array[qtype];
 
                if (!qsd_type_enabled(qsd, qtype))
@@ -427,7 +427,7 @@ static int qsd_upd_thread(void *arg)
 
        rc = lu_env_init(env, LCT_DT_THREAD);
        if (rc) {
-               CERROR("%s: Fail to init env.", qsd->qsd_svname);
+               CERROR("%s: cannot init env: rc = %d\n", qsd->qsd_svname, rc);
                OBD_FREE_PTR(env);
                RETURN(rc);
        }
@@ -480,7 +480,7 @@ static int qsd_upd_thread(void *arg)
                if (uptodate)
                        continue;
 
-               for (qtype = USRQUOTA; qtype < MAXQUOTAS; qtype++)
+               for (qtype = USRQUOTA; qtype < LL_MAXQUOTAS; qtype++)
                        qsd_start_reint_thread(qsd->qsd_type_array[qtype]);
        }
        lu_env_fini(env);
@@ -500,7 +500,7 @@ int qsd_start_upd_thread(struct qsd_instance *qsd)
        task = kthread_run(qsd_upd_thread, (void *)qsd,
                           "lquota_wb_%s", qsd->qsd_svname);
        if (IS_ERR(task)) {
-               CERROR("Fail to start quota update thread. rc: %ld\n",
+               CERROR("fail to start quota update thread: rc = %ld\n",
                        PTR_ERR(task));
                thread_set_flags(thread, SVC_STOPPED);
                RETURN(PTR_ERR(task));
@@ -516,7 +516,7 @@ static void qsd_cleanup_deferred(struct qsd_instance *qsd)
 {
        int     qtype;
 
-       for (qtype = USRQUOTA; qtype < MAXQUOTAS; qtype++) {
+       for (qtype = USRQUOTA; qtype < LL_MAXQUOTAS; qtype++) {
                struct qsd_upd_rec      *upd, *tmp;
                struct qsd_qtype_info   *qqi = qsd->qsd_type_array[qtype];