@@ -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);
}
}
@@ -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 */
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 <den@openvz.org> Suggested-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> CC: Kevin Wolf <kwolf@redhat.com> CC: Max Reitz <mreitz@redhat.com> CC: Stefan Hajnoczi <stefanha@redhat.com> CC: Fam Zheng <fam@euphon.net> CC: Juan Quintela <quintela@redhat.com> CC: "Dr. David Alan Gilbert" <dgilbert@redhat.com> CC: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> CC: Denis Plotnikov <dplotnikov@virtuozzo.com> --- block/aio_task.c | 13 ++----------- include/block/aio_task.h | 1 - 2 files changed, 2 insertions(+), 12 deletions(-)