Lines Matching refs:work
96 struct btrfs_work *work) in run_ordered_completions() argument
103 set_bit(WORK_DONE_BIT, &work->flags); in run_ordered_completions()
108 work = list_entry(workers->order_list.next, in run_ordered_completions()
111 if (!test_bit(WORK_DONE_BIT, &work->flags)) in run_ordered_completions()
119 if (test_and_set_bit(WORK_ORDER_DONE_BIT, &work->flags)) in run_ordered_completions()
124 work->ordered_func(work); in run_ordered_completions()
128 list_del(&work->order_list); in run_ordered_completions()
129 work->ordered_free(work); in run_ordered_completions()
143 struct btrfs_work *work; in worker_loop() local
149 work = list_entry(cur, struct btrfs_work, list); in worker_loop()
150 list_del(&work->list); in worker_loop()
151 clear_bit(WORK_QUEUED_BIT, &work->flags); in worker_loop()
153 work->worker = worker; in worker_loop()
156 work->func(work); in worker_loop()
163 run_ordered_completions(worker->workers, work); in worker_loop()
386 int btrfs_requeue_work(struct btrfs_work *work) in btrfs_requeue_work() argument
388 struct btrfs_worker_thread *worker = work->worker; in btrfs_requeue_work()
392 if (test_and_set_bit(WORK_QUEUED_BIT, &work->flags)) in btrfs_requeue_work()
396 list_add_tail(&work->list, &worker->pending); in btrfs_requeue_work()
425 int btrfs_queue_worker(struct btrfs_workers *workers, struct btrfs_work *work) in btrfs_queue_worker() argument
432 if (test_and_set_bit(WORK_QUEUED_BIT, &work->flags)) in btrfs_queue_worker()
438 list_add_tail(&work->order_list, &workers->order_list); in btrfs_queue_worker()
441 INIT_LIST_HEAD(&work->order_list); in btrfs_queue_worker()
446 list_add_tail(&work->list, &worker->pending); in btrfs_queue_worker()