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