int mc_timer(void) { struct timer_work t_work = { KTHREAD_WORK_INIT(t_work.work, mc_timer_work_func), }; if (!queue_kthread_work(&mc_timer_worker, &t_work.work)) return false; flush_kthread_work(&t_work.work); return true; }
/** * rvt_destroy_cq - destroy a completion queue * @ibcq: the completion queue to destroy. * * Called by ib_destroy_cq() in the generic verbs code. * * Return: always 0 */ int rvt_destroy_cq(struct ib_cq *ibcq) { struct rvt_cq *cq = ibcq_to_rvtcq(ibcq); struct rvt_dev_info *rdi = cq->rdi; flush_kthread_work(&cq->comptask); spin_lock(&rdi->n_cqs_lock); rdi->n_cqs_allocated--; spin_unlock(&rdi->n_cqs_lock); if (cq->ip) kref_put(&cq->ip->ref, rvt_release_mmap_info); else vfree(cq->queue); kfree(cq); return 0; }