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>
This commit is contained in:
@@ -62,7 +62,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
i = 0;
|
||||
do {
|
||||
ret = io_uring_get_completion(&ring, &cqe);
|
||||
ret = io_uring_peek_cqe(&ring, &cqe);
|
||||
if (ret < 0) {
|
||||
printf("wait completion %d\n", ret);
|
||||
goto err;
|
||||
|
||||
@@ -39,7 +39,7 @@ static int test_single_fsync(struct io_uring *ring)
|
||||
goto err;
|
||||
}
|
||||
|
||||
ret = io_uring_wait_completion(ring, &cqe);
|
||||
ret = io_uring_wait_cqe(ring, &cqe);
|
||||
if (ret < 0) {
|
||||
printf("wait completion %d\n", ret);
|
||||
goto err;
|
||||
@@ -107,7 +107,7 @@ static int test_barrier_fsync(struct io_uring *ring)
|
||||
}
|
||||
|
||||
for (i = 0; i < 5; i++) {
|
||||
ret = io_uring_wait_completion(ring, &cqe);
|
||||
ret = io_uring_wait_cqe(ring, &cqe);
|
||||
if (ret < 0) {
|
||||
printf("child: wait completion %d\n", ret);
|
||||
goto err;
|
||||
|
||||
@@ -146,9 +146,9 @@ reap_events(struct io_uring *ring, unsigned nr)
|
||||
printf("Reaping %u I/Os\n", nr);
|
||||
gettimeofday(&start, NULL);
|
||||
while (left) {
|
||||
ret = io_uring_wait_completion(ring, &cqe);
|
||||
ret = io_uring_wait_cqe(ring, &cqe);
|
||||
if (ret < 0) {
|
||||
printf("io_uring_wait_completion returned %d\n", ret);
|
||||
printf("io_uring_wait_cqe returned %d\n", ret);
|
||||
printf("expected success\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -423,14 +423,14 @@ ioring_poll(struct io_uring *ring, int fd, int fixed)
|
||||
return 1;
|
||||
}
|
||||
|
||||
ret = io_uring_wait_completion(ring, &cqe);
|
||||
ret = io_uring_wait_cqe(ring, &cqe);
|
||||
if (ret < 0) {
|
||||
printf("io_uring_wait_completion failed with %d\n", ret);
|
||||
printf("io_uring_wait_cqe failed with %d\n", ret);
|
||||
return 1;
|
||||
}
|
||||
ret = 0;
|
||||
if (cqe->res != POLLOUT) {
|
||||
printf("io_uring_wait_completion: expected 0x%.8x, got 0x%.8x\n",
|
||||
printf("io_uring_wait_cqe: expected 0x%.8x, got 0x%.8x\n",
|
||||
POLLOUT, cqe->res);
|
||||
ret = 1;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ static int test_single_nop(struct io_uring *ring)
|
||||
goto err;
|
||||
}
|
||||
|
||||
ret = io_uring_wait_completion(ring, &cqe);
|
||||
ret = io_uring_wait_cqe(ring, &cqe);
|
||||
if (ret < 0) {
|
||||
printf("wait completion %d\n", ret);
|
||||
goto err;
|
||||
@@ -71,7 +71,7 @@ static int test_barrier_nop(struct io_uring *ring)
|
||||
}
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
ret = io_uring_wait_completion(ring, &cqe);
|
||||
ret = io_uring_wait_cqe(ring, &cqe);
|
||||
if (ret < 0) {
|
||||
printf("wait completion %d\n", ret);
|
||||
goto err;
|
||||
|
||||
@@ -87,7 +87,7 @@ int main(int argc, char *argv[])
|
||||
return 1;
|
||||
}
|
||||
|
||||
ret = io_uring_wait_completion(&ring, &cqe);
|
||||
ret = io_uring_wait_cqe(&ring, &cqe);
|
||||
if (ret < 0) {
|
||||
printf("child: get cqe failed\n");
|
||||
return 1;
|
||||
@@ -101,7 +101,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
io_uring_cqe_seen(&ring, cqe);
|
||||
|
||||
ret = io_uring_wait_completion(&ring, &cqe);
|
||||
ret = io_uring_wait_cqe(&ring, &cqe);
|
||||
if (ret < 0) {
|
||||
printf("parent: get failed\n");
|
||||
return 1;
|
||||
|
||||
@@ -69,7 +69,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
do {
|
||||
ret = io_uring_wait_completion(&ring, &cqe);
|
||||
ret = io_uring_wait_cqe(&ring, &cqe);
|
||||
if (ret < 0) {
|
||||
printf("child: wait completion %d\n", ret);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user