From f47f24cea7d10abbc54e8dc8f184eca509dd77c1 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 8 Jan 2019 15:16:55 -0700 Subject: liburing: add io_uring_iocb_from_ev() helper Returns the iocb associated with a completion event. Signed-off-by: Jens Axboe --- src/liburing.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/liburing.h b/src/liburing.h index 8c81978..d6589f6 100644 --- a/src/liburing.h +++ b/src/liburing.h @@ -56,4 +56,10 @@ extern int io_uring_wait_completion(int fd, struct io_uring_cq *cq, 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); +static inline struct io_uring_iocb * +io_uring_iocb_from_ev(struct io_uring_sq *sq, struct io_uring_event *ev) +{ + return &sq->iocbs[ev->index]; +} + #endif -- cgit