Lines Matching refs:work

63 static void normal_work_helper(struct btrfs_work *work);
68 struct btrfs_work *work = container_of(arg, struct btrfs_work, \
70 normal_work_helper(work); \
238 struct btrfs_work *work; in run_ordered_work() local
246 work = list_entry(list->next, struct btrfs_work, in run_ordered_work()
248 if (!test_bit(WORK_DONE_BIT, &work->flags)) in run_ordered_work()
257 if (test_and_set_bit(WORK_ORDER_DONE_BIT, &work->flags)) in run_ordered_work()
259 trace_btrfs_ordered_sched(work); in run_ordered_work()
261 work->ordered_func(work); in run_ordered_work()
265 list_del(&work->ordered_list); in run_ordered_work()
272 work->ordered_free(work); in run_ordered_work()
273 trace_btrfs_all_work_done(work); in run_ordered_work()
278 static void normal_work_helper(struct btrfs_work *work) in normal_work_helper() argument
291 if (work->ordered_func) in normal_work_helper()
293 wq = work->wq; in normal_work_helper()
295 trace_btrfs_work_sched(work); in normal_work_helper()
297 work->func(work); in normal_work_helper()
299 set_bit(WORK_DONE_BIT, &work->flags); in normal_work_helper()
303 trace_btrfs_all_work_done(work); in normal_work_helper()
306 void btrfs_init_work(struct btrfs_work *work, btrfs_work_func_t uniq_func, in btrfs_init_work() argument
311 work->func = func; in btrfs_init_work()
312 work->ordered_func = ordered_func; in btrfs_init_work()
313 work->ordered_free = ordered_free; in btrfs_init_work()
314 INIT_WORK(&work->normal_work, uniq_func); in btrfs_init_work()
315 INIT_LIST_HEAD(&work->ordered_list); in btrfs_init_work()
316 work->flags = 0; in btrfs_init_work()
320 struct btrfs_work *work) in __btrfs_queue_work() argument
324 work->wq = wq; in __btrfs_queue_work()
326 if (work->ordered_func) { in __btrfs_queue_work()
328 list_add_tail(&work->ordered_list, &wq->ordered_list); in __btrfs_queue_work()
331 trace_btrfs_work_queued(work); in __btrfs_queue_work()
332 queue_work(wq->normal_wq, &work->normal_work); in __btrfs_queue_work()
336 struct btrfs_work *work) in btrfs_queue_work() argument
340 if (test_bit(WORK_HIGH_PRIO_BIT, &work->flags) && wq->high) in btrfs_queue_work()
344 __btrfs_queue_work(dest_wq, work); in btrfs_queue_work()
374 void btrfs_set_work_high_priority(struct btrfs_work *work) in btrfs_set_work_high_priority() argument
376 set_bit(WORK_HIGH_PRIO_BIT, &work->flags); in btrfs_set_work_high_priority()