summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author李通洲 <carter.li@eoitek.com>2021-02-08 10:28:07 +0800
committer李通洲 <carter.li@eoitek.com>2021-02-08 10:30:06 +0800
commit51be5d381fbfa49011d7480619fae749a291b4f2 (patch)
tree4d3fbc5fe2a157d5867beacea16f671630f798d9
parentccfe96eb3dca697e58f1dc42f82fb79f01a948b1 (diff)
downloadliburing-51be5d381fbfa49011d7480619fae749a291b4f2.tar.gz
liburing-51be5d381fbfa49011d7480619fae749a291b4f2.tar.bz2
src/queue.c: don't test `LIBURING_UDATA_TIMEOUT`
for the latest kernel since we don't use it internally Signed-off-by: 李通洲 <carter.li@eoitek.com>
-rw-r--r--src/queue.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/queue.c b/src/queue.c
index 94f791e..7ac689d 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);
@@ -267,8 +268,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