From: Ammar Faizi <[email protected]>
To: Jens Axboe <[email protected]>
Cc: Ammar Faizi <[email protected]>,
Alviro Iskandar Setiawan <[email protected]>,
io-uring Mailing List <[email protected]>,
Linux Kernel Mailing List <[email protected]>,
GNU/Weeb Mailing List <[email protected]>
Subject: [PATCH liburing v1 2/3] liburing.h: Explain the history of `io_uring_get_sqe()`
Date: Thu, 20 Feb 2025 21:34:21 +0700 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
Add a comment for `io_uring_get_sqe()` to provide historical context
and prevent misunderstandings, as seen in Pull Request 1336.
Link: https://github.com/axboe/liburing/pull/1336
Signed-off-by: Ammar Faizi <[email protected]>
---
src/include/liburing.h | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/src/include/liburing.h b/src/include/liburing.h
index b2d76f3224e2..98419e378f72 100644
--- a/src/include/liburing.h
+++ b/src/include/liburing.h
@@ -1622,24 +1622,43 @@ IOURINGINLINE int io_uring_buf_ring_available(struct io_uring *ring,
unsigned short bgid)
{
uint16_t head;
int ret;
ret = io_uring_buf_ring_head(ring, bgid, &head);
if (ret)
return ret;
return (uint16_t) (br->tail - head);
}
+/*
+ * As of liburing-2.2, io_uring_get_sqe() has been converted into a
+ * "static inline" function. However, this change breaks seamless
+ * updates of liburing.so, as applications would need to be recompiled.
+ * To ensure backward compatibility, liburing keeps the original
+ * io_uring_get_sqe() symbol available in the shared library.
+ *
+ * To accomplish this, io_uring_get_sqe() is defined as a non-static
+ * inline function when LIBURING_INTERNAL is set, which only applies
+ * during liburing.so builds.
+ *
+ * This strategy ensures new users adopt the "static inline" version
+ * while preserving compatibility for old applications linked against
+ * the shared library.
+ *
+ * Relevant commits:
+ * 8be8af4afcb4 ("queue: provide io_uring_get_sqe() symbol again")
+ * 52dcdbba35c8 ("src/queue: protect io_uring_get_sqe() with LIBURING_INTERNAL")
+ */
#ifndef LIBURING_INTERNAL
IOURINGINLINE struct io_uring_sqe *io_uring_get_sqe(struct io_uring *ring)
{
return _io_uring_get_sqe(ring);
}
#else
struct io_uring_sqe *io_uring_get_sqe(struct io_uring *ring);
#endif
ssize_t io_uring_mlock_size(unsigned entries, unsigned flags);
ssize_t io_uring_mlock_size_params(unsigned entries, struct io_uring_params *p);
--
Ammar Faizi
next prev parent reply other threads:[~2025-02-20 14:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-20 14:34 [PATCH liburing v1 0/3] Fix Compilation Error on Android and Some Cleanup Ammar Faizi
2025-02-20 14:34 ` [PATCH liburing v1 1/3] liburing.h: Remove redundant double negation Ammar Faizi
2025-02-20 14:34 ` Ammar Faizi [this message]
2025-02-20 14:34 ` [PATCH liburing v1 3/3] Fix missing `aligned_alloc()` on some Android devices Ammar Faizi
2025-02-20 14:51 ` [PATCH liburing v1 0/3] Fix Compilation Error on Android and Some Cleanup Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox