summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-01-08 15:16:55 -0700
committerJens Axboe <axboe@kernel.dk>2019-01-08 15:38:03 -0700
commitf47f24cea7d10abbc54e8dc8f184eca509dd77c1 (patch)
tree1b0bad76f9335e44551366f57da29249fd70edc6 /src
parent6a44c6e0f7eb1d7692c96b2512974b858cfc95f0 (diff)
liburing: add io_uring_iocb_from_ev() helper
Returns the iocb associated with a completion event. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'src')
-rw-r--r--src/liburing.h6
1 files changed, 6 insertions, 0 deletions
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