]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix macro name for io_uring_queue_init_mem check.
authorMasahiko Sawada <msawada@postgresql.org>
Wed, 31 Dec 2025 19:18:17 +0000 (11:18 -0800)
committerMasahiko Sawada <msawada@postgresql.org>
Wed, 31 Dec 2025 19:18:17 +0000 (11:18 -0800)
Commit f54af9f2679d added a check for
io_uring_queue_init_mem(). However, it used the macro name
HAVE_LIBURING_QUEUE_INIT_MEM in both meson.build and the C code, while
the Autotools build script defined HAVE_IO_URING_QUEUE_INIT_MEM. As a
result, the optimization was never enabled in builds configured with
Autotools, as the C code checked for the wrong macro name.

This commit changes the macro name to HAVE_IO_URING_QUEUE_INIT_MEM in
meson.build and the C code. This matches the actual function
name (io_uring_queue_init_mem), following the standard HAVE_<FUNCTION>
convention.

Backpatch to 18, where the macro was introduced.

Bug: #19368
Reported-by: Evan Si <evsi@amazon.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/19368-016d79a7f3a1c599@postgresql.org
Backpatch-through: 18

meson.build
src/backend/storage/aio/method_io_uring.c

index ca753859c3c8b8c25d4924af3f06d7165243f280..f4e5708372eb023e0828f82d3ac3938b8d405192 100644 (file)
@@ -1001,7 +1001,7 @@ if liburing.found()
 
   if cc.has_function('io_uring_queue_init_mem',
       dependencies: liburing, args: test_c_args)
-    cdata.set('HAVE_LIBURING_QUEUE_INIT_MEM', 1)
+    cdata.set('HAVE_IO_URING_QUEUE_INIT_MEM', 1)
   endif
 
 endif
index bb06da63a8e02a753b74e11fb6be6c98423264c3..a5681e22a995ff4c437ae22dd4dc408e495c83d0 100644 (file)
@@ -156,7 +156,7 @@ pgaio_uring_check_capabilities(void)
         * also has a secondary benefit: We can determine precisely how much
         * memory we need for each io_uring instance.
         */
-#if defined(HAVE_LIBURING_QUEUE_INIT_MEM) && defined(IORING_SETUP_NO_MMAP)
+#if defined(HAVE_IO_URING_QUEUE_INIT_MEM) && defined(IORING_SETUP_NO_MMAP)
        {
                struct io_uring test_ring;
                size_t          ring_size;
@@ -341,7 +341,7 @@ pgaio_uring_shmem_init(bool first_time)
                 * with its data in shared memory. Otherwise fall back io_uring
                 * creating a memory mapping for each ring.
                 */
-#if defined(HAVE_LIBURING_QUEUE_INIT_MEM) && defined(IORING_SETUP_NO_MMAP)
+#if defined(HAVE_IO_URING_QUEUE_INIT_MEM) && defined(IORING_SETUP_NO_MMAP)
                if (pgaio_uring_caps.mem_init_size > 0)
                {
                        struct io_uring_params p = {0};