summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/io_uring-cp.c19
-rw-r--r--test/io_uring-test.c3
2 files changed, 12 insertions, 10 deletions
diff --git a/test/io_uring-cp.c b/test/io_uring-cp.c
index 0fbd1d3..3850743 100644
--- a/test/io_uring-cp.c
+++ b/test/io_uring-cp.c
@@ -177,23 +177,26 @@ int main(int argc, char *argv[])
writes = reads = 0;
write_left = read_left;
while (read_left || write_left) {
- off_t this_size = read_left;
-
- if (this_size > BS)
- this_size = BS;
- else if (!this_size)
- goto skip_read;
/*
* Queue up as many reads as we can
*/
- while (read_left && !queue_read(infd, this_size, offset)) {
+ while (read_left) {
+ off_t this_size = read_left;
+
+ if (this_size > BS)
+ this_size = BS;
+ else if (!this_size)
+ break;
+
+ if (queue_read(infd, this_size, offset))
+ break;
+
read_left -= this_size;
offset += this_size;
reads++;
}
-skip_read:
ret = io_uring_submit(&in_ring);
if (ret < 0) {
fprintf(stderr, "io_uring_submit: %s\n", strerror(-ret));
diff --git a/test/io_uring-test.c b/test/io_uring-test.c
index 4bd0892..a13e405 100644
--- a/test/io_uring-test.c
+++ b/test/io_uring-test.c
@@ -30,7 +30,6 @@ int main(int argc, char *argv[])
}
memset(&p, 0, sizeof(p));
- p.flags = IORING_SETUP_IOPOLL;
ret = io_uring_queue_init(QD, &p, &ring);
if (ret < 0) {
@@ -78,7 +77,7 @@ int main(int argc, char *argv[])
done = 0;
pending = ret;
for (i = 0; i < pending; i++) {
- ret = io_uring_get_completion(&ring, &cqe);
+ ret = io_uring_wait_completion(&ring, &cqe);
if (ret < 0) {
fprintf(stderr, "io_uring_get_completion: %s\n", strerror(-ret));
return 1;