summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-01-18 06:10:40 -0700
committerJens Axboe <axboe@kernel.dk>2019-01-18 07:00:14 -0700
commit3640699bea043bed436c3af9ddc5b26fe23ced7a (patch)
treec51e78e318e1f4f5966ec073cda7b194675354b6
parent213d6f39efcfc4a6758d50b383a699b98190aad7 (diff)
Switch to IORING_OP_POLL_ADD/REMOVE
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--src/io_uring.h4
-rw-r--r--src/liburing.h10
-rw-r--r--test/poll-cancel.c4
-rw-r--r--test/poll.c4
4 files changed, 11 insertions, 11 deletions
diff --git a/src/io_uring.h b/src/io_uring.h
index b057733..3b8d623 100644
--- a/src/io_uring.h
+++ b/src/io_uring.h
@@ -54,8 +54,8 @@ struct io_uring_sqe {
#define IORING_OP_FSYNC 3
#define IORING_OP_READ_FIXED 4
#define IORING_OP_WRITE_FIXED 5
-#define IORING_OP_POLL 6
-#define IORING_OP_POLL_CANCEL 7
+#define IORING_OP_POLL_ADD 6
+#define IORING_OP_POLL_REMOVE 7
/*
* sqe->fsync_flags
diff --git a/src/liburing.h b/src/liburing.h
index 8e5e2ee..e287f3d 100644
--- a/src/liburing.h
+++ b/src/liburing.h
@@ -94,20 +94,20 @@ static inline void io_uring_prep_writev(struct io_uring_sqe *sqe, int fd,
sqe->len = nr_vecs;
}
-static inline void io_uring_prep_poll(struct io_uring_sqe *sqe, int fd,
- short poll_mask)
+static inline void io_uring_prep_poll_add(struct io_uring_sqe *sqe, int fd,
+ short poll_mask)
{
memset(sqe, 0, sizeof(*sqe));
- sqe->opcode = IORING_OP_POLL;
+ sqe->opcode = IORING_OP_POLL_ADD;
sqe->fd = fd;
sqe->poll_events = poll_mask;
}
-static inline void io_uring_prep_poll_cancel(struct io_uring_sqe *sqe,
+static inline void io_uring_prep_poll_remove(struct io_uring_sqe *sqe,
void *user_data)
{
memset(sqe, 0, sizeof(*sqe));
- sqe->opcode = IORING_OP_POLL_CANCEL;
+ sqe->opcode = IORING_OP_POLL_REMOVE;
sqe->addr = (unsigned long) user_data;
}
diff --git a/test/poll-cancel.c b/test/poll-cancel.c
index ce82c60..3c62f18 100644
--- a/test/poll-cancel.c
+++ b/test/poll-cancel.c
@@ -38,7 +38,7 @@ int main(int argc, char *argv[])
return 1;
}
- io_uring_prep_poll(sqe, pipe1[0], POLLIN);
+ io_uring_prep_poll_add(sqe, pipe1[0], POLLIN);
io_uring_sqe_set_data(sqe, sqe);
addr = sqe;
@@ -54,7 +54,7 @@ int main(int argc, char *argv[])
return 1;
}
- io_uring_prep_poll_cancel(sqe, addr);
+ io_uring_prep_poll_remove(sqe, addr);
io_uring_sqe_set_data(sqe, sqe);
ret = io_uring_submit(&ring);
diff --git a/test/poll.c b/test/poll.c
index 79788f4..c3800d6 100644
--- a/test/poll.c
+++ b/test/poll.c
@@ -48,7 +48,7 @@ int main(int argc, char *argv[])
return 1;
}
- io_uring_prep_poll(sqe, pipe1[0], POLLIN);
+ io_uring_prep_poll_add(sqe, pipe1[0], POLLIN);
ret = io_uring_submit(&cring);
if (ret <= 0) {
@@ -91,7 +91,7 @@ int main(int argc, char *argv[])
return 1;
}
- io_uring_prep_poll(sqe, pipe2[0], POLLIN);
+ io_uring_prep_poll_add(sqe, pipe2[0], POLLIN);
io_uring_sqe_set_data(sqe, sqe);
ret = io_uring_submit(&pring);