From 721671ade77f4046b45893fbb7864ca84b9504cd Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Thu, 1 Dec 2016 19:26:40 +0000 Subject: aio: add flag to skip fds to aio_dispatch() Polling mode will not call ppoll(2)/epoll_wait(2). Therefore we know there are no fds ready and should avoid looping over fd handlers in aio_dispatch(). Signed-off-by: Stefan Hajnoczi Reviewed-by: Paolo Bonzini Message-id: 20161201192652.9509-2-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi --- include/block/aio.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include/block') diff --git a/include/block/aio.h b/include/block/aio.h index ca551e3..c1519ec 100644 --- a/include/block/aio.h +++ b/include/block/aio.h @@ -295,8 +295,12 @@ bool aio_pending(AioContext *ctx); /* Dispatch any pending callbacks from the GSource attached to the AioContext. * * This is used internally in the implementation of the GSource. + * + * @dispatch_fds: true to process fds, false to skip them + * (can be used as an optimization by callers that know there + * are no fds ready) */ -bool aio_dispatch(AioContext *ctx); +bool aio_dispatch(AioContext *ctx, bool dispatch_fds); /* Progress in completing AIO work to occur. This can issue new pending * aio as a result of executing I/O completion or bh callbacks. -- cgit v1.1