Lines Matching refs:work
54 static void normal_work_helper(struct btrfs_work *work);
59 struct btrfs_work *work = container_of(arg, struct btrfs_work, \
61 normal_work_helper(work); \
71 btrfs_work_owner(const struct btrfs_work *work) in btrfs_work_owner() argument
73 return work->wq->fs_info; in btrfs_work_owner()
258 struct btrfs_work *work; in run_ordered_work() local
268 work = list_entry(list->next, struct btrfs_work, in run_ordered_work()
270 if (!test_bit(WORK_DONE_BIT, &work->flags)) in run_ordered_work()
279 if (test_and_set_bit(WORK_ORDER_DONE_BIT, &work->flags)) in run_ordered_work()
281 trace_btrfs_ordered_sched(work); in run_ordered_work()
283 work->ordered_func(work); in run_ordered_work()
287 list_del(&work->ordered_list); in run_ordered_work()
295 wtag = work; in run_ordered_work()
296 work->ordered_free(work); in run_ordered_work()
302 static void normal_work_helper(struct btrfs_work *work) in normal_work_helper() argument
316 if (work->ordered_func) in normal_work_helper()
318 wq = work->wq; in normal_work_helper()
320 wtag = work; in normal_work_helper()
322 trace_btrfs_work_sched(work); in normal_work_helper()
324 work->func(work); in normal_work_helper()
326 set_bit(WORK_DONE_BIT, &work->flags); in normal_work_helper()
333 void btrfs_init_work(struct btrfs_work *work, btrfs_work_func_t uniq_func, in btrfs_init_work() argument
338 work->func = func; in btrfs_init_work()
339 work->ordered_func = ordered_func; in btrfs_init_work()
340 work->ordered_free = ordered_free; in btrfs_init_work()
341 INIT_WORK(&work->normal_work, uniq_func); in btrfs_init_work()
342 INIT_LIST_HEAD(&work->ordered_list); in btrfs_init_work()
343 work->flags = 0; in btrfs_init_work()
347 struct btrfs_work *work) in __btrfs_queue_work() argument
351 work->wq = wq; in __btrfs_queue_work()
353 if (work->ordered_func) { in __btrfs_queue_work()
355 list_add_tail(&work->ordered_list, &wq->ordered_list); in __btrfs_queue_work()
358 trace_btrfs_work_queued(work); in __btrfs_queue_work()
359 queue_work(wq->normal_wq, &work->normal_work); in __btrfs_queue_work()
363 struct btrfs_work *work) in btrfs_queue_work() argument
367 if (test_bit(WORK_HIGH_PRIO_BIT, &work->flags) && wq->high) in btrfs_queue_work()
371 __btrfs_queue_work(dest_wq, work); in btrfs_queue_work()
401 void btrfs_set_work_high_priority(struct btrfs_work *work) in btrfs_set_work_high_priority() argument
403 set_bit(WORK_HIGH_PRIO_BIT, &work->flags); in btrfs_set_work_high_priority()