summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-10-01 10:05:16 -0600
committerJens Axboe <axboe@kernel.dk>2019-10-01 10:19:54 -0600
commite2934e144409e6afc2678ef2558641755cbd4c43 (patch)
tree1a888c417bf55525414a25074d8d50fdf4f25b14 /src
parentf6c8044fd0d4fb8b8b2136d3329b38576a706308 (diff)
downloadliburing-e2934e144409e6afc2678ef2558641755cbd4c43.tar.gz
liburing-e2934e144409e6afc2678ef2558641755cbd4c43.tar.bz2
Switch to 32/64-bit agnostic timeout format
We made a kernel change to support timeouts properly on 32-bit archs, update liburing to use __kernel_timespec instead of the differently sized timespec. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'src')
-rw-r--r--src/include/liburing.h16
-rw-r--r--src/queue.c5
2 files changed, 15 insertions, 6 deletions
diff --git a/src/include/liburing.h b/src/include/liburing.h
index a99a681..2fda45e 100644
--- a/src/include/liburing.h
+++ b/src/include/liburing.h
@@ -14,6 +14,13 @@ extern "C" {
#include "liburing/io_uring.h"
#include "liburing/barrier.h"
+#ifndef CONFIG_HAVE_KERNEL_TIMESPEC
+struct __kernel_timespec {
+ int64_t tv_sec;
+ long long tv_nsec;
+};
+#endif
+
/*
* Library interface to io_uring
*/
@@ -73,10 +80,10 @@ extern void io_uring_queue_exit(struct io_uring *ring);
unsigned io_uring_peek_batch_cqe(struct io_uring *ring,
struct io_uring_cqe **cqes, unsigned count);
extern int io_uring_wait_cqes(struct io_uring *ring,
- struct io_uring_cqe **cqe_ptr, unsigned wait_nr, struct timespec *ts,
- sigset_t *sigmask);
+ struct io_uring_cqe **cqe_ptr, unsigned wait_nr,
+ struct __kernel_timespec *ts, sigset_t *sigmask);
extern int io_uring_wait_cqe_timeout(struct io_uring *ring,
- struct io_uring_cqe **cqe_ptr, struct timespec *ts);
+ struct io_uring_cqe **cqe_ptr, struct __kernel_timespec *ts);
extern int io_uring_submit(struct io_uring *ring);
extern int io_uring_submit_and_wait(struct io_uring *ring, unsigned wait_nr);
extern struct io_uring_sqe *io_uring_get_sqe(struct io_uring *ring);
@@ -245,7 +252,8 @@ static inline void io_uring_prep_nop(struct io_uring_sqe *sqe)
}
static inline void io_uring_prep_timeout(struct io_uring_sqe *sqe,
- struct timespec *ts, unsigned count)
+ struct __kernel_timespec *ts,
+ unsigned count)
{
io_uring_prep_rw(IORING_OP_TIMEOUT, sqe, 0, ts, 1, count);
}
diff --git a/src/queue.c b/src/queue.c
index 2caea87..766aeac 100644
--- a/src/queue.c
+++ b/src/queue.c
@@ -105,7 +105,8 @@ static int __io_uring_flush_sq(struct io_uring *ring)
* this function, as we will do that on its behalf.
*/
int io_uring_wait_cqes(struct io_uring *ring, struct io_uring_cqe **cqe_ptr,
- unsigned wait_nr, struct timespec *ts, sigset_t *sigmask)
+ unsigned wait_nr, struct __kernel_timespec *ts,
+ sigset_t *sigmask)
{
int ret;
@@ -137,7 +138,7 @@ int io_uring_wait_cqes(struct io_uring *ring, struct io_uring_cqe **cqe_ptr,
*/
int io_uring_wait_cqe_timeout(struct io_uring *ring,
struct io_uring_cqe **cqe_ptr,
- struct timespec *ts)
+ struct __kernel_timespec *ts)
{
return io_uring_wait_cqes(ring, cqe_ptr, 1, ts, NULL);
}