summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2021-02-13 08:43:00 -0700
committerJens Axboe <axboe@kernel.dk>2021-02-13 08:43:00 -0700
commit5671af310f7c2b0b88101511163188171ba4715d (patch)
treec23d5778823cbfc3a4d518c5c716f5379d0b5d8e
parente7629eccc39410f45157afa552b1033083688cbe (diff)
parent52a91c8aa624300cc879019cdbddfa3cca40055b (diff)
downloadliburing-5671af310f7c2b0b88101511163188171ba4715d.tar.gz
liburing-5671af310f7c2b0b88101511163188171ba4715d.tar.bz2
Merge branch 'Pr1' of https://github.com/romange/liburing
* 'Pr1' of https://github.com/romange/liburing: Add const modifier to functions that do not change the state of the ring
-rw-r--r--src/include/liburing.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/include/liburing.h b/src/include/liburing.h
index 00f37c1..6b2cfa1 100644
--- a/src/include/liburing.h
+++ b/src/include/liburing.h
@@ -96,7 +96,7 @@ extern struct io_uring_probe *io_uring_get_probe(void);
*/
extern void io_uring_free_probe(struct io_uring_probe *probe);
-static inline int io_uring_opcode_supported(struct io_uring_probe *p, int op)
+static inline int io_uring_opcode_supported(const struct io_uring_probe *p, int op)
{
if (op > p->last_op)
return 0;
@@ -531,7 +531,7 @@ static inline void io_uring_prep_renameat(struct io_uring_sqe *sqe, int olddfd,
* Returns number of unconsumed (if SQPOLL) or unsubmitted entries exist in
* the SQ ring
*/
-static inline unsigned io_uring_sq_ready(struct io_uring *ring)
+static inline unsigned io_uring_sq_ready(const struct io_uring *ring)
{
/*
* Without a barrier, we could miss an update and think the SQ wasn't ready.
@@ -547,7 +547,7 @@ static inline unsigned io_uring_sq_ready(struct io_uring *ring)
/*
* Returns how much space is left in the SQ ring.
*/
-static inline unsigned io_uring_sq_space_left(struct io_uring *ring)
+static inline unsigned io_uring_sq_space_left(const struct io_uring *ring)
{
return *ring->sq.kring_entries - io_uring_sq_ready(ring);
}
@@ -572,7 +572,7 @@ static inline int io_uring_sqring_wait(struct io_uring *ring)
/*
* Returns how many unconsumed entries are ready in the CQ ring
*/
-static inline unsigned io_uring_cq_ready(struct io_uring *ring)
+static inline unsigned io_uring_cq_ready(const struct io_uring *ring)
{
return io_uring_smp_load_acquire(ring->cq.ktail) - *ring->cq.khead;
}
@@ -580,7 +580,7 @@ static inline unsigned io_uring_cq_ready(struct io_uring *ring)
/*
* Returns true if the eventfd notification is currently enabled
*/
-static inline bool io_uring_cq_eventfd_enabled(struct io_uring *ring)
+static inline bool io_uring_cq_eventfd_enabled(const struct io_uring *ring)
{
if (!ring->cq.kflags)
return true;