This is a leftover from a different use cases, it's used to wait for
the manager to startup. Rename it as such.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
struct io_wq_hash *hash;
refcount_t refs;
struct io_wq_hash *hash;
refcount_t refs;
- struct completion done;
+ struct completion started;
atomic_t worker_refs;
struct completion worker_done;
atomic_t worker_refs;
struct completion worker_done;
current->flags |= PF_IO_WORKER;
wq->manager = current;
current->flags |= PF_IO_WORKER;
wq->manager = current;
+ complete(&wq->started);
do {
set_current_state(TASK_INTERRUPTIBLE);
do {
set_current_state(TASK_INTERRUPTIBLE);
ret = io_wq_fork_thread(io_wq_manager, wq);
current->flags &= ~PF_IO_WORKER;
if (ret >= 0) {
ret = io_wq_fork_thread(io_wq_manager, wq);
current->flags &= ~PF_IO_WORKER;
if (ret >= 0) {
- wait_for_completion(&wq->done);
+ wait_for_completion(&wq->started);
}
wq->task_pid = current->pid;
}
wq->task_pid = current->pid;
- init_completion(&wq->done);
+ init_completion(&wq->started);
refcount_set(&wq->refs, 1);
init_completion(&wq->worker_done);
refcount_set(&wq->refs, 1);
init_completion(&wq->worker_done);