diff options
author | Jens Axboe <axboe@kernel.dk> | 2019-04-07 18:36:43 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-04-07 18:36:43 -0600 |
commit | db11f116c72a8ff3e306a8d5d1882d90c412c36d (patch) | |
tree | d4e2e6679a2030bd55bdf6a2b728146790911a1b /test | |
parent | 1245d8320aa564bfcc63e8d64781fb391b421331 (diff) |
Use io_uring_cqe_get_data() internally
Replace all cqe->user_data casts with io_uring_cqe_get_data().
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'test')
-rw-r--r-- | test/io_uring-cp.c | 2 | ||||
-rw-r--r-- | test/io_uring_enter.c | 2 | ||||
-rw-r--r-- | test/poll-cancel.c | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/test/io_uring-cp.c b/test/io_uring-cp.c index 3790736..4df8139 100644 --- a/test/io_uring-cp.c +++ b/test/io_uring-cp.c @@ -173,7 +173,7 @@ static int copy_file(struct io_uring *ring, off_t insize) if (!cqe) break; - data = (struct io_data *) (uintptr_t) cqe->user_data; + data = io_uring_cqe_get_data(cqe); if (cqe->res < 0) { if (cqe->res == -EAGAIN) { queue_prepped(ring, data); diff --git a/test/io_uring_enter.c b/test/io_uring_enter.c index a86eeaa..4dc46c4 100644 --- a/test/io_uring_enter.c +++ b/test/io_uring_enter.c @@ -154,7 +154,7 @@ reap_events(struct io_uring *ring, unsigned nr) } if (cqe->res != 4096) printf("cqe->res: %d, expected 4096\n", cqe->res); - iov = (struct iovec *)cqe->user_data; + iov = io_uring_cqe_get_data(cqe); free(iov->iov_base); free(iov); left--; diff --git a/test/poll-cancel.c b/test/poll-cancel.c index 722e7ff..4a3626d 100644 --- a/test/poll-cancel.c +++ b/test/poll-cancel.c @@ -93,7 +93,7 @@ int main(int argc, char *argv[]) return 1; } - pd = (struct poll_data *) (uintptr_t) cqe->user_data; + pd = io_uring_cqe_get_data(cqe); if (cqe->res != 0) { printf("sqe (add=%d/remove=%d) failed with %ld\n", pd->is_poll, pd->is_cancel, (long) cqe->res); @@ -106,7 +106,7 @@ int main(int argc, char *argv[]) return 1; } - pd = (struct poll_data *) (uintptr_t) cqe->user_data; + pd = io_uring_cqe_get_data(cqe); if (cqe->res != 0) { printf("sqe (add=%d/remove=%d) failed with %ld\n", pd->is_poll, pd->is_cancel, (long) cqe->res); |