Lines Matching refs:work
55 struct btrfs_fs_info * __pure btrfs_work_owner(const struct btrfs_work *work) in btrfs_work_owner() argument
57 return work->wq->fs_info; in btrfs_work_owner()
213 struct btrfs_work *work; in run_ordered_work() local
222 work = list_first_entry(list, struct btrfs_work, ordered_list); in run_ordered_work()
223 if (!test_bit(WORK_DONE_BIT, &work->flags)) in run_ordered_work()
239 if (test_and_set_bit(WORK_ORDER_DONE_BIT, &work->flags)) in run_ordered_work()
241 trace_btrfs_ordered_sched(work); in run_ordered_work()
243 work->ordered_func(work, false); in run_ordered_work()
247 list_del(&work->ordered_list); in run_ordered_work()
250 if (work == self) { in run_ordered_work()
278 work->ordered_func(work, true); in run_ordered_work()
280 trace_btrfs_all_work_done(wq->fs_info, work); in run_ordered_work()
294 struct btrfs_work *work = container_of(normal_work, struct btrfs_work, in btrfs_work_helper() local
296 struct btrfs_workqueue *wq = work->wq; in btrfs_work_helper()
307 if (work->ordered_func) in btrfs_work_helper()
310 trace_btrfs_work_sched(work); in btrfs_work_helper()
312 work->func(work); in btrfs_work_helper()
321 set_bit(WORK_DONE_BIT, &work->flags); in btrfs_work_helper()
322 run_ordered_work(wq, work); in btrfs_work_helper()
325 trace_btrfs_all_work_done(wq->fs_info, work); in btrfs_work_helper()
329 void btrfs_init_work(struct btrfs_work *work, btrfs_func_t func, in btrfs_init_work() argument
332 work->func = func; in btrfs_init_work()
333 work->ordered_func = ordered_func; in btrfs_init_work()
334 INIT_WORK(&work->normal_work, btrfs_work_helper); in btrfs_init_work()
335 INIT_LIST_HEAD(&work->ordered_list); in btrfs_init_work()
336 work->flags = 0; in btrfs_init_work()
339 void btrfs_queue_work(struct btrfs_workqueue *wq, struct btrfs_work *work) in btrfs_queue_work() argument
343 work->wq = wq; in btrfs_queue_work()
345 if (work->ordered_func) { in btrfs_queue_work()
347 list_add_tail(&work->ordered_list, &wq->ordered_list); in btrfs_queue_work()
350 trace_btrfs_work_queued(work); in btrfs_queue_work()
351 queue_work(wq->normal_wq, &work->normal_work); in btrfs_queue_work()