OBD_SLAB_ALLOC_PTR_GFP(upd, upd_kmem, GFP_NOFS);
if (upd == NULL) {
- CERROR("Failed to allocate upd");
return NULL;
}
struct lu_env *env;
int qtype, rc = 0;
bool uptodate;
- struct lquota_entry *lqe, *tmp;
+ struct lquota_entry *lqe;
__u64 cur_time;
ENTRY;
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);
}
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))
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));