Whamcloud - gitweb
LU-4681 utils: Fix error message when using hostname
[fs/lustre-release.git] / lustre / osp / osp_sync.c
index e311801..07e3a41 100644 (file)
@@ -344,7 +344,7 @@ static int osp_sync_interpret(const struct lu_env *env,
        LASSERT(d);
 
        CDEBUG(D_HA, "reply req %p/%d, rc %d, transno %u\n", req,
-              cfs_atomic_read(&req->rq_refcount),
+              atomic_read(&req->rq_refcount),
               rc, (unsigned) req->rq_transno);
        LASSERT(rc || req->rq_transno);
 
@@ -677,9 +677,10 @@ static int osp_sync_process_record(const struct lu_env *env,
                rc = osp_sync_new_setattr_job(d, llh, rec);
                break;
        default:
-               CERROR("unknown record type: %x\n", rec->lrh_type);
-                      rc = -EINVAL;
-                      break;
+               CERROR("%s: unknown record type: %x\n", d->opd_obd->obd_name,
+                      rec->lrh_type);
+               /* we should continue processing */
+               return 0;
        }
 
        if (likely(rc == 0)) {
@@ -1105,6 +1106,7 @@ static void osp_sync_llog_fini(const struct lu_env *env, struct osp_device *d)
 int osp_sync_init(const struct lu_env *env, struct osp_device *d)
 {
        struct l_wait_info       lwi = { 0 };
+       struct task_struct      *task;
        int                      rc;
 
        ENTRY;
@@ -1133,10 +1135,11 @@ int osp_sync_init(const struct lu_env *env, struct osp_device *d)
        init_waitqueue_head(&d->opd_syn_thread.t_ctl_waitq);
        CFS_INIT_LIST_HEAD(&d->opd_syn_committed_there);
 
-       rc = PTR_ERR(kthread_run(osp_sync_thread, d,
-                                "osp-syn-%u-%u", d->opd_index, d->opd_group));
-       if (IS_ERR_VALUE(rc)) {
-               CERROR("%s: can't start sync thread: rc = %d\n",
+       task = kthread_run(osp_sync_thread, d, "osp-syn-%u-%u",
+                          d->opd_index, d->opd_group);
+       if (IS_ERR(task)) {
+               rc = PTR_ERR(task);
+               CERROR("%s: cannot start sync thread: rc = %d\n",
                       d->opd_obd->obd_name, rc);
                GOTO(err_llog, rc);
        }
@@ -1214,8 +1217,8 @@ static int osp_sync_id_traction_init(struct osp_device *d)
        mutex_lock(&osp_id_tracker_sem);
        cfs_list_for_each_entry(tr, &osp_id_tracker_list, otr_list) {
                if (tr->otr_dev == d->opd_storage) {
-                       LASSERT(cfs_atomic_read(&tr->otr_refcount));
-                       cfs_atomic_inc(&tr->otr_refcount);
+                       LASSERT(atomic_read(&tr->otr_refcount));
+                       atomic_inc(&tr->otr_refcount);
                        d->opd_syn_tracker = tr;
                        found = tr;
                        break;
@@ -1231,7 +1234,7 @@ static int osp_sync_id_traction_init(struct osp_device *d)
                        tr->otr_dev = d->opd_storage;
                        tr->otr_next_id = 1;
                        tr->otr_committed_id = 0;
-                       cfs_atomic_set(&tr->otr_refcount, 1);
+                       atomic_set(&tr->otr_refcount, 1);
                        CFS_INIT_LIST_HEAD(&tr->otr_wakeup_list);
                        cfs_list_add(&tr->otr_list, &osp_id_tracker_list);
                        tr->otr_tx_cb.dtc_txn_commit =
@@ -1263,7 +1266,7 @@ static void osp_sync_id_traction_fini(struct osp_device *d)
        osp_sync_remove_from_tracker(d);
 
        mutex_lock(&osp_id_tracker_sem);
-       if (cfs_atomic_dec_and_test(&tr->otr_refcount)) {
+       if (atomic_dec_and_test(&tr->otr_refcount)) {
                dt_txn_callback_del(d->opd_storage, &tr->otr_tx_cb);
                LASSERT(cfs_list_empty(&tr->otr_wakeup_list));
                cfs_list_del(&tr->otr_list);