diff options
author | Jens Axboe <axboe@kernel.dk> | 2019-04-18 08:32:06 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-04-18 08:38:08 -0600 |
commit | 39e0ebd4fc66046bf733a47aaa899a556093ebc6 (patch) | |
tree | c5f82c6cd37137063b4e46eeab486fa3b56d7ba7 /src/queue.c | |
parent | 4916320ec374cc5d2b4062c48d2e4c576472b739 (diff) |
Rename completion helpers
We have io_uring_get_sqe() on the submission side, yet the completion
side is named _completion. Rename as follows:
io_uring_get_completion() io_uring_peek_cqe()
iO_uring_wait_completion() io_uring_wait_cqe()
This better tells the user what the _get variant does by calling it
_peek instead, and we move to using _cqe() as the postfix instead
of _completion.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'src/queue.c')
-rw-r--r-- | src/queue.c | 20 |
1 files changed, 10 insertions, 10 deletions
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); } /* |