public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] lapi/io_uring: Add fallback definitions for OP_READ(WRITE)
@ 2026-04-16 12:41 Sachin Sant
  2026-04-16 13:35 ` [LTP] " linuxtestproject.agent
  2026-04-16 16:18 ` [LTP] [PATCH] " Martin Doucha
  0 siblings, 2 replies; 3+ messages in thread
From: Sachin Sant @ 2026-04-16 12:41 UTC (permalink / raw)
  To: ltp

Add fallback definitions for IORING_OP_READ and IORING_OP_WRITE
opcodes to support building on older distributions with kernel
headers between v5.1 and v5.5.

These opcodes were introduced in kernel v5.6, but some distros
may have io_uring support from v5.1+ without these newer
operation codes.

Fixes: fcc4887e73ca (io_uring: Test IORING READ and WRITE operations)
Reported-by: Martin Doucha <mdoucha@suse.cz>
Signed-off-by: Sachin Sant <sachinp@linux.ibm.com>
---
 include/lapi/io_uring.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/include/lapi/io_uring.h b/include/lapi/io_uring.h
index c05517595..d95a4cd59 100644
--- a/include/lapi/io_uring.h
+++ b/include/lapi/io_uring.h
@@ -267,6 +267,16 @@ struct io_uring_probe {
 #define IOSQE_ASYNC		(1U << IOSQE_ASYNC_BIT)
 #endif /* IOSQE_ASYNC */
 
+#ifndef IORING_OP_READ
+/* Added in kernel v5.6 */
+#define IORING_OP_READ		22
+#endif /* IORING_OP_READ */
+
+#ifndef IORING_OP_WRITE
+/* Added in kernel v5.6 */
+#define IORING_OP_WRITE		23
+#endif /* IORING_OP_WRITE */
+
 #ifndef HAVE_IO_URING_REGISTER
 static inline int io_uring_register(int fd, unsigned int opcode, void *arg,
 	unsigned int nr_args)
-- 
2.39.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-04-16 16:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-16 12:41 [LTP] [PATCH] lapi/io_uring: Add fallback definitions for OP_READ(WRITE) Sachin Sant
2026-04-16 13:35 ` [LTP] " linuxtestproject.agent
2026-04-16 16:18 ` [LTP] [PATCH] " Martin Doucha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox