Lines Matching refs:pctl
42 struct xfs_pwork_ctl *pctl;
46 pctl = pwork->pctl;
47 error = pctl->work_fn(pctl->mp, pwork);
48 if (error && !pctl->error)
49 pctl->error = error;
50 if (atomic_dec_and_test(&pctl->nr_work))
51 wake_up(&pctl->poll_wait);
62 struct xfs_pwork_ctl *pctl,
74 pctl->wq = alloc_workqueue("%s-%d",
77 if (!pctl->wq)
79 pctl->work_fn = work_fn;
80 pctl->error = 0;
81 pctl->mp = mp;
82 atomic_set(&pctl->nr_work, 0);
83 init_waitqueue_head(&pctl->poll_wait);
91 struct xfs_pwork_ctl *pctl,
95 pwork->pctl = pctl;
96 atomic_inc(&pctl->nr_work);
97 queue_work(pctl->wq, &pwork->work);
103 struct xfs_pwork_ctl *pctl)
105 destroy_workqueue(pctl->wq);
106 pctl->wq = NULL;
107 return pctl->error;
116 struct xfs_pwork_ctl *pctl)
118 while (wait_event_timeout(pctl->poll_wait,
119 atomic_read(&pctl->nr_work) == 0, HZ) == 0)