summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2021-02-08 08:28:47 -0700
committerJens Axboe <axboe@kernel.dk>2021-02-08 08:28:47 -0700
commit327d1217db99fba234d36f6218584dcd1bf0338a (patch)
treecb9f6a6d63081f0cb7da817795d31e3528aa558a
parentbe648cf24cf3da1e987349e87e25d2f913721ac0 (diff)
parent51be5d381fbfa49011d7480619fae749a291b4f2 (diff)
downloadliburing-327d1217db99fba234d36f6218584dcd1bf0338a.tar.gz
liburing-327d1217db99fba234d36f6218584dcd1bf0338a.tar.bz2
Merge branch 'master' of https://github.com/CarterLi/liburing
* 'master' of https://github.com/CarterLi/liburing: src/queue.c: don't test `LIBURING_UDATA_TIMEOUT` for the latest kernel since we don't use it internally
-rw-r--r--src/queue.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/queue.c b/src/queue.c
index 8c394dd..4bd4c48 100644
--- a/src/queue.c
+++ b/src/queue.c
@@ -59,7 +59,8 @@ static int __io_uring_peek_cqe(struct io_uring *ring,
break;
cqe = &ring->cq.cqes[head & mask];
- if (cqe->user_data == LIBURING_UDATA_TIMEOUT) {
+ if (!(ring->features & IORING_FEAT_EXT_ARG) &&
+ cqe->user_data == LIBURING_UDATA_TIMEOUT) {
if (cqe->res < 0)
err = cqe->res;
io_uring_cq_advance(ring, 1);
@@ -269,8 +270,9 @@ static int io_uring_wait_cqes_new(struct io_uring *ring,
/*
* Like io_uring_wait_cqe(), except it accepts a timeout value as well. Note
- * that an sqe is used internally to handle the timeout. Applications using
- * this function must never set sqe->user_data to LIBURING_UDATA_TIMEOUT!
+ * that an sqe is used internally to handle the timeout. For kernel doesn't
+ * support IORING_FEAT_EXT_ARG, applications using this function must never
+ * set sqe->user_data to LIBURING_UDATA_TIMEOUT!
*
* For kernels without IORING_FEAT_EXT_ARG (5.10 and older), if 'ts' is
* specified, the application need not call io_uring_submit() before