diff options
author | Jens Axboe <axboe@kernel.dk> | 2019-09-21 14:29:35 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-09-21 14:29:35 -0600 |
commit | 97690231261f38a97f26c2cffbdeae501faa7ae8 (patch) | |
tree | 878d00ba31d530b0e5e1070586e5c26f0410ac6b /src | |
parent | 5652c3bcda738c16ab4e6f12e637559cc379a4e7 (diff) | |
parent | 59df60ecfb64776841afa9091994e4ecf7890807 (diff) | |
download | liburing-97690231261f38a97f26c2cffbdeae501faa7ae8.tar.gz liburing-97690231261f38a97f26c2cffbdeae501faa7ae8.tar.bz2 |
Merge branch 'sq_space_left' of https://github.com/rouzier/liburing
* 'sq_space_left' of https://github.com/rouzier/liburing:
Add io_uring_sq_space_left()
Diffstat (limited to 'src')
-rw-r--r-- | src/include/liburing.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/include/liburing.h b/src/include/liburing.h index 7c6731f..1cae1cd 100644 --- a/src/include/liburing.h +++ b/src/include/liburing.h @@ -241,6 +241,11 @@ static inline void io_uring_prep_timeout(struct io_uring_sqe *sqe, io_uring_prep_rw(IORING_OP_TIMEOUT, sqe, 0, ts, 1, count); } +static inline unsigned io_uring_sq_space_left(struct io_uring *ring) +{ + return *ring->sq.kring_entries - (ring->sq.sqe_tail - ring->sq.sqe_head); +} + #ifdef __cplusplus } #endif |