Add option for getting a completion without waiting

This now exposes two helpers:

io_uring_get_completion()
	Return a completion, if we have one (or more) available in
	the ring

io_uring_wait_completion()
	Return a completion, waiting for it if necessary

Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Jens Axboe
2019-01-08 15:14:07 -07:00
parent f93c84e1b0
commit 6a44c6e0f7
3 changed files with 28 additions and 9 deletions

View File

@@ -51,6 +51,8 @@ extern void io_uring_queue_exit(int fd, struct io_uring_sq *sq,
struct io_uring_cq *cq);
extern int io_uring_get_completion(int fd, struct io_uring_cq *cq,
struct io_uring_event **ev_ptr);
extern int io_uring_wait_completion(int fd, struct io_uring_cq *cq,
struct io_uring_event **ev_ptr);
extern int io_uring_submit(int fd, struct io_uring_sq *sq);
extern struct io_uring_iocb *io_uring_get_iocb(struct io_uring_sq *sq);