Whamcloud - gitweb
LU-5275 obdclass: Remove lprocfs_vars argument from class_register_type function
[fs/lustre-release.git] / lustre / quota / qsd_writeback.c
index 17dfb55..e24f28c 100644 (file)
@@ -56,7 +56,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;
        }
 
@@ -417,7 +416,7 @@ static int qsd_upd_thread(void *arg)
        struct lu_env           *env;
        int                      qtype, rc = 0;
        bool                     uptodate;
-       struct lquota_entry     *lqe, *tmp;
+       struct lquota_entry     *lqe;
        __u64                    cur_time;
        ENTRY;
 
@@ -427,7 +426,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);
        }
@@ -450,8 +449,9 @@ static int qsd_upd_thread(void *arg)
 
                spin_lock(&qsd->qsd_adjust_lock);
                cur_time = cfs_time_current_64();
-               list_for_each_entry_safe(lqe, tmp, &qsd->qsd_adjust_list,
-                                        lqe_link) {
+               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))
@@ -499,7 +499,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));