From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server-vie001.gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_DBL_BLOCKED_OPENDNS, URIBL_ZEN_BLOCKED_OPENDNS autolearn=ham autolearn_force=no version=3.4.6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1740062098; bh=LbQkwTDIu9g+6v+t8LjVmjJshSoNf7WjKV5AFx6vUuE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding:Message-ID:Date:From: Reply-To:Subject:To:Cc:In-Reply-To:References:Resent-Date: Resent-From:Resent-To:Resent-Cc:User-Agent:Content-Type: Content-Transfer-Encoding; b=LPtvd8tlVb2viqcehzfDj2Z5F19wvvm861uzy2+3IEa644XN3neHmVWYcCH5+pIOg ByT7QcKSE90hNTDJIivsuiXH+vL1TrdazRsLrf7+7P8H2D645yb0/JNkA2lDdzJ1XV OMPzyhOuojCRByx6+0TlCQMg0u6pI5O0HFtReDFHzdC4oZYS4mPRklwWJwuSAB71v7 nhmd5mvwOuFpITeGmkJzAp6ie2DtUkkyQPoQZ7A/yyCemKSX27Rs76hQfnQqIMm4cD M1odogMBwWoEYIA9XQZ5MVdutgt/XqENO4kaehxRfusxpmxxRNmsl+q+MgS5/wCb+8 yJAUK5QkE8OPg== Received: from integral2.. (unknown [182.253.126.96]) by server-vie001.gnuweeb.org (Postfix) with ESMTPSA id DF02A20744A5; Thu, 20 Feb 2025 14:34:56 +0000 (UTC) From: Ammar Faizi To: Jens Axboe Cc: Ammar Faizi , Alviro Iskandar Setiawan , io-uring Mailing List , Linux Kernel Mailing List , GNU/Weeb Mailing List 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 Message-Id: <20250220143422.3597245-3-ammarfaizi2@gnuweeb.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250220143422.3597245-1-ammarfaizi2@gnuweeb.org> References: <20250220143422.3597245-1-ammarfaizi2@gnuweeb.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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 --- 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