test/io_uring-cp: add some comments
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
@@ -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
|
* Queue is full at this point. Find at least one completion.
|
||||||
* a write
|
|
||||||
*/
|
*/
|
||||||
got_comp = 0;
|
got_comp = 0;
|
||||||
while (write_left) {
|
while (write_left) {
|
||||||
@@ -184,6 +183,7 @@ static int copy_file(struct io_uring *ring, off_t insize)
|
|||||||
strerror(-cqe->res));
|
strerror(-cqe->res));
|
||||||
return 1;
|
return 1;
|
||||||
} else if (cqe->res != data->iov.iov_len) {
|
} else if (cqe->res != data->iov.iov_len) {
|
||||||
|
/* Short read/write, adjust and requeue */
|
||||||
data->iov.iov_base += cqe->res;
|
data->iov.iov_base += cqe->res;
|
||||||
data->iov.iov_len -= cqe->res;
|
data->iov.iov_len -= cqe->res;
|
||||||
data->offset += cqe->res;
|
data->offset += cqe->res;
|
||||||
|
|||||||
Reference in New Issue
Block a user