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);
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)) {
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;
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);
}
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;
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 =
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);