diff options
author | Jens Axboe <axboe@kernel.dk> | 2019-01-10 15:08:49 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-01-10 15:08:49 -0700 |
commit | fa863f6b4ad73c6bea2cabbd50803af78895e1d5 (patch) | |
tree | 79662e97a3b0b32b8da41e018ce0c6124eead1f2 /test/io_uring-cp.c | |
parent | d5b4ae1c58f49d3d665faadd0e2eddcef9aadc68 (diff) |
Fix test cases
- Don't use polled IO for the io_uring-test, that'll fail if the
fs/device doesn't suppor it
- copy read-in was broken for io_uring-cp
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'test/io_uring-cp.c')
-rw-r--r-- | test/io_uring-cp.c | 19 |
1 files changed, 11 insertions, 8 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)); |