From a231fdcaa13dbeff3cb9e1c7eeb98db4024aba4e Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 6 Mar 2019 08:31:26 -0700 Subject: test/io_uring-cp: add some comments Signed-off-by: Jens Axboe --- test/io_uring-cp.c | 4 ++-- 1 file 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; -- cgit