summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/liburing.h6
-rw-r--r--src/liburing.map4
-rw-r--r--src/queue.c20
3 files changed, 15 insertions, 15 deletions
diff --git a/src/liburing.h b/src/liburing.h
index 158239a..a8d77e1 100644
--- a/src/liburing.h
+++ b/src/liburing.h
@@ -61,15 +61,15 @@ extern int io_uring_queue_init(unsigned entries, struct io_uring *ring,
extern int io_uring_queue_mmap(int fd, struct io_uring_params *p,
struct io_uring *ring);
extern void io_uring_queue_exit(struct io_uring *ring);
-extern int io_uring_get_completion(struct io_uring *ring,
+extern int io_uring_peek_cqe(struct io_uring *ring,
struct io_uring_cqe **cqe_ptr);
-extern int io_uring_wait_completion(struct io_uring *ring,
+extern int io_uring_wait_cqe(struct io_uring *ring,
struct io_uring_cqe **cqe_ptr);
extern int io_uring_submit(struct io_uring *ring);
extern struct io_uring_sqe *io_uring_get_sqe(struct io_uring *ring);
/*
- * Must be called after io_uring_{get,wait}_completion() after the cqe has
+ * Must be called after io_uring_{peek,wait}_cqe() after the cqe has
* been processed by the application.
*/
static inline void io_uring_cqe_seen(struct io_uring *ring,
diff --git a/src/liburing.map b/src/liburing.map
index 67e5171..06f5002 100644
--- a/src/liburing.map
+++ b/src/liburing.map
@@ -2,8 +2,8 @@ LIBURING_0.1 {
global:
io_uring_queue_init;
io_uring_queue_exit;
- io_uring_get_completion;
- io_uring_wait_completion;
+ io_uring_peek_cqe;
+ io_uring_wait_cqe;
io_uring_submit;
io_uring_get_sqe;
local:
diff --git a/src/queue.c b/src/queue.c
index 72b3af2..4b4fea9 100644
--- a/src/queue.c
+++ b/src/queue.c
@@ -10,8 +10,8 @@
#include "liburing.h"
#include "barrier.h"
-static int __io_uring_get_completion(struct io_uring *ring,
- struct io_uring_cqe **cqe_ptr, int wait)
+static int __io_uring_get_cqe(struct io_uring *ring,
+ struct io_uring_cqe **cqe_ptr, int wait)
{
struct io_uring_cq *cq = &ring->cq;
const unsigned mask = *cq->kring_mask;
@@ -45,21 +45,21 @@ static int __io_uring_get_completion(struct io_uring *ring,
}
/*
- * Return an IO completion, if one is readily available
+ * Return an IO completion, if one is readily available. Returns 0 with
+ * cqe_ptr filled in on success, -errno on failure.
*/
-int io_uring_get_completion(struct io_uring *ring,
- struct io_uring_cqe **cqe_ptr)
+int io_uring_peek_cqe(struct io_uring *ring, struct io_uring_cqe **cqe_ptr)
{
- return __io_uring_get_completion(ring, cqe_ptr, 0);
+ return __io_uring_get_cqe(ring, cqe_ptr, 0);
}
/*
- * Return an IO completion, waiting for it if necessary
+ * Return an IO completion, waiting for it if necessary. Returns 0 with
+ * cqe_ptr filled in on success, -errno on failure.
*/
-int io_uring_wait_completion(struct io_uring *ring,
- struct io_uring_cqe **cqe_ptr)
+int io_uring_wait_cqe(struct io_uring *ring, struct io_uring_cqe **cqe_ptr)
{
- return __io_uring_get_completion(ring, cqe_ptr, 1);
+ return __io_uring_get_cqe(ring, cqe_ptr, 1);
}
/*