summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-03-06 08:31:26 -0700
committerJens Axboe <axboe@kernel.dk>2019-03-06 08:31:26 -0700
commita231fdcaa13dbeff3cb9e1c7eeb98db4024aba4e (patch)
tree712872898ae6b5ccc9347b861ef3a426403f0852
parent5fefee2333356a8d6c640af9f2e2efbbe93dcd67 (diff)
test/io_uring-cp: add some comments
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--test/io_uring-cp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/io_uring-cp.c b/test/io_uring-cp.c
index e129d84..3790736 100644
--- a/test/io_uring-cp.c
+++ b/test/io_uring-cp.c
@@ -154,8 +154,7 @@ static int copy_file(struct io_uring *ring, off_t insize)
}
/*
- * read queue full, get at least one completion and queue up
- * a write
+ * Queue is full at this point. Find at least one completion.
*/
got_comp = 0;
while (write_left) {
@@ -184,6 +183,7 @@ static int copy_file(struct io_uring *ring, off_t insize)
strerror(-cqe->res));
return 1;
} else if (cqe->res != data->iov.iov_len) {
+ /* Short read/write, adjust and requeue */
data->iov.iov_base += cqe->res;
data->iov.iov_len -= cqe->res;
data->offset += cqe->res;