Re: [PATCH 17/19] io_uring: add support for IORING_OP_POLL
From: Hannes Reinecke <hare@suse.de>
Date: 2019-02-10 09:28:05
Also in:
linux-block
On 2/9/19 10:13 PM, Jens Axboe wrote:
This is basically a direct port of bfe4037e722e, which implements a one-shot poll command through aio. Description below is based on that commit as well. However, instead of adding a POLL command and relying on io_cancel(2) to remove it, we mimic the epoll(2) interface of having a command to add a poll notification, IORING_OP_POLL_ADD, and one to remove it again, IORING_OP_POLL_REMOVE. To poll for a file descriptor the application should submit an sqe of type IORING_OP_POLL. It will poll the fd for the events specified in the poll_events field. Unlike poll or epoll without EPOLLONESHOT this interface always works in one shot mode, that is once the sqe is completed, it will have to be resubmitted. Based-on-code-from: Christoph Hellwig [off-list ref] Signed-off-by: Jens Axboe <axboe@kernel.dk> --- fs/io_uring.c | 261 +++++++++++++++++++++++++++++++++- include/uapi/linux/io_uring.h | 3 + 2 files changed, 263 insertions(+), 1 deletion(-)
I still would like to be able to properly terminate the I/O on aio_cancel. But this can probably be done in a later patch. Reviewed-by: Hannes Reinecke <hare@suse.com> Cheers, Hannes -- To unsubscribe, send a message with 'unsubscribe linux-aio' in the body to majordomo@kvack.org. For more info on Linux AIO, see: http://www.kvack.org/aio/ Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>