diff options
author | Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> | 2019-08-29 12:09:53 +0300 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2019-09-10 08:58:43 +0200 |
commit | bb0c94099382b52734a4a4f3c060e90c9a2ac6cf (patch) | |
tree | ac02b2959676479a50414ee2144fc433681526b1 /job.c | |
parent | b70d08205b2e4044c529eefc21df2c8ab61b473b (diff) |
job: drop job_drain
In job_finish_sync job_enter should be enough for a job to make some
progress and draining is a wrong tool for it. So use job_enter directly
here and drop job_drain with all related staff not used more.
Suggested-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Tested-by: John Snow <jsnow@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'job.c')
-rw-r--r-- | job.c | 12 |
1 files changed, 1 insertions, 11 deletions
@@ -523,16 +523,6 @@ void coroutine_fn job_sleep_ns(Job *job, int64_t ns) job_pause_point(job); } -void job_drain(Job *job) -{ - /* If job is !busy this kicks it into the next pause point. */ - job_enter(job); - - if (job->driver->drain) { - job->driver->drain(job); - } -} - /* Assumes the block_job_mutex is held */ static bool job_timer_not_pending(Job *job) { @@ -991,7 +981,7 @@ int job_finish_sync(Job *job, void (*finish)(Job *, Error **errp), Error **errp) } AIO_WAIT_WHILE(job->aio_context, - (job_drain(job), !job_is_completed(job))); + (job_enter(job), !job_is_completed(job))); ret = (job_is_cancelled(job) && job->ret == 0) ? -ECANCELED : job->ret; job_unref(job); |