It is not used outside the module. Actually there are 2 kind of waiters: - for a slot and - for all tasks to finish This patch limits external API to listed types.
Signed-off-by: Denis V. Lunev <d...@openvz.org> Suggested-by: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> CC: Kevin Wolf <kw...@redhat.com> CC: Max Reitz <mre...@redhat.com> CC: Stefan Hajnoczi <stefa...@redhat.com> CC: Fam Zheng <f...@euphon.net> CC: Juan Quintela <quint...@redhat.com> CC: "Dr. David Alan Gilbert" <dgilb...@redhat.com> CC: Vladimir Sementsov-Ogievskiy <vsement...@virtuozzo.com> CC: Denis Plotnikov <dplotni...@virtuozzo.com> --- block/aio_task.c | 13 ++----------- include/block/aio_task.h | 1 - 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/block/aio_task.c b/block/aio_task.c index cf62e5c58b..7ba15ff41f 100644 --- a/block/aio_task.c +++ b/block/aio_task.c @@ -54,26 +54,17 @@ static void coroutine_fn aio_task_co(void *opaque) qemu_co_queue_restart_all(&pool->waiters); } -void coroutine_fn aio_task_pool_wait_one(AioTaskPool *pool) -{ - assert(pool->busy_tasks > 0); - - qemu_co_queue_wait(&pool->waiters, NULL); - - assert(pool->busy_tasks < pool->max_busy_tasks); -} - void coroutine_fn aio_task_pool_wait_slot(AioTaskPool *pool) { while (pool->busy_tasks >= pool->max_busy_tasks) { - aio_task_pool_wait_one(pool); + qemu_co_queue_wait(&pool->waiters, NULL); } } void coroutine_fn aio_task_pool_wait_all(AioTaskPool *pool) { while (pool->busy_tasks > 0) { - aio_task_pool_wait_one(pool); + qemu_co_queue_wait(&pool->waiters, NULL); } } diff --git a/include/block/aio_task.h b/include/block/aio_task.h index 50bc1e1817..50b1c036c5 100644 --- a/include/block/aio_task.h +++ b/include/block/aio_task.h @@ -48,7 +48,6 @@ bool aio_task_pool_empty(AioTaskPool *pool); void coroutine_fn aio_task_pool_start_task(AioTaskPool *pool, AioTask *task); void coroutine_fn aio_task_pool_wait_slot(AioTaskPool *pool); -void coroutine_fn aio_task_pool_wait_one(AioTaskPool *pool); void coroutine_fn aio_task_pool_wait_all(AioTaskPool *pool); #endif /* BLOCK_AIO_TASK_H */ -- 2.17.1