Lines Matching refs:work

57 static void normal_work_helper(struct btrfs_work *work);
62 struct btrfs_work *work = container_of(arg, struct btrfs_work, \
64 normal_work_helper(work); \
226 struct btrfs_work *work; in run_ordered_work() local
234 work = list_entry(list->next, struct btrfs_work, in run_ordered_work()
236 if (!test_bit(WORK_DONE_BIT, &work->flags)) in run_ordered_work()
245 if (test_and_set_bit(WORK_ORDER_DONE_BIT, &work->flags)) in run_ordered_work()
247 trace_btrfs_ordered_sched(work); in run_ordered_work()
249 work->ordered_func(work); in run_ordered_work()
253 list_del(&work->ordered_list); in run_ordered_work()
260 work->ordered_free(work); in run_ordered_work()
261 trace_btrfs_all_work_done(work); in run_ordered_work()
266 static void normal_work_helper(struct btrfs_work *work) in normal_work_helper() argument
279 if (work->ordered_func) in normal_work_helper()
281 wq = work->wq; in normal_work_helper()
283 trace_btrfs_work_sched(work); in normal_work_helper()
285 work->func(work); in normal_work_helper()
287 set_bit(WORK_DONE_BIT, &work->flags); in normal_work_helper()
291 trace_btrfs_all_work_done(work); in normal_work_helper()
294 void btrfs_init_work(struct btrfs_work *work, btrfs_work_func_t uniq_func, in btrfs_init_work() argument
299 work->func = func; in btrfs_init_work()
300 work->ordered_func = ordered_func; in btrfs_init_work()
301 work->ordered_free = ordered_free; in btrfs_init_work()
302 INIT_WORK(&work->normal_work, uniq_func); in btrfs_init_work()
303 INIT_LIST_HEAD(&work->ordered_list); in btrfs_init_work()
304 work->flags = 0; in btrfs_init_work()
308 struct btrfs_work *work) in __btrfs_queue_work() argument
312 work->wq = wq; in __btrfs_queue_work()
314 if (work->ordered_func) { in __btrfs_queue_work()
316 list_add_tail(&work->ordered_list, &wq->ordered_list); in __btrfs_queue_work()
319 trace_btrfs_work_queued(work); in __btrfs_queue_work()
320 queue_work(wq->normal_wq, &work->normal_work); in __btrfs_queue_work()
324 struct btrfs_work *work) in btrfs_queue_work() argument
328 if (test_bit(WORK_HIGH_PRIO_BIT, &work->flags) && wq->high) in btrfs_queue_work()
332 __btrfs_queue_work(dest_wq, work); in btrfs_queue_work()
362 void btrfs_set_work_high_priority(struct btrfs_work *work) in btrfs_set_work_high_priority() argument
364 set_bit(WORK_HIGH_PRIO_BIT, &work->flags); in btrfs_set_work_high_priority()