From: Gabriel Krisman Bertazi <krisman@suse.de>
To: axboe@kernel.dk
Cc: io-uring@vger.kernel.org, Gabriel Krisman Bertazi <krisman@suse.de>
Subject: [PATCH liburing 1/2] liburing: Add support to IORING_OP_MMAP
Date: Thu, 29 Jan 2026 17:12:35 -0500 [thread overview]
Message-ID: <20260129221236.898135-2-krisman@suse.de> (raw)
In-Reply-To: <20260129221236.898135-1-krisman@suse.de>
Signed-off-by: Gabriel Krisman Bertazi <krisman@suse.de>
---
src/include/liburing.h | 8 ++++++++
src/include/liburing/io_uring.h | 10 ++++++++++
src/liburing-ffi.map | 2 ++
3 files changed, 20 insertions(+)
diff --git a/src/include/liburing.h b/src/include/liburing.h
index 861e9673..903c60b7 100644
--- a/src/include/liburing.h
+++ b/src/include/liburing.h
@@ -1669,6 +1669,14 @@ IOURINGINLINE void io_uring_prep_pipe(struct io_uring_sqe *sqe, int *fds,
sqe->pipe_flags = (__u32) pipe_flags;
}
+IOURINGINLINE void io_uring_prep_mmap(struct io_uring_sqe *sqe, int fd,
+ struct io_uring_mmap_desc *descs,
+ int nr_maps, int flags)
+{
+ io_uring_prep_rw(IORING_OP_MMAP, sqe, fd, descs, nr_maps, 0);
+ sqe->mmap_flags = flags;
+}
+
/* setup pipe directly into the fixed file table */
IOURINGINLINE void io_uring_prep_pipe_direct(struct io_uring_sqe *sqe, int *fds,
int pipe_flags,
diff --git a/src/include/liburing/io_uring.h b/src/include/liburing/io_uring.h
index 3e88e796..2e1ac37d 100644
--- a/src/include/liburing/io_uring.h
+++ b/src/include/liburing/io_uring.h
@@ -74,6 +74,7 @@ struct io_uring_sqe {
__u32 install_fd_flags;
__u32 nop_flags;
__u32 pipe_flags;
+ __u32 mmap_flags;
};
__u64 user_data; /* data to be passed back at completion time */
/* pack this to avoid bogus arm OABI complaints */
@@ -311,6 +312,7 @@ enum io_uring_op {
IORING_OP_PIPE,
IORING_OP_NOP128,
IORING_OP_URING_CMD128,
+ IORING_OP_MMAP,
/* this goes last, obviously */
IORING_OP_LAST,
@@ -1069,6 +1071,14 @@ struct io_uring_zcrx_ifq_reg {
__u64 __resv[3];
};
+struct io_uring_mmap_desc {
+ void *addr;
+ unsigned long len;
+ unsigned long pgoff;
+ unsigned int prot;
+ unsigned int flags;
+};
+
#ifdef __cplusplus
}
#endif
diff --git a/src/liburing-ffi.map b/src/liburing-ffi.map
index 7202ffd0..b16de5aa 100644
--- a/src/liburing-ffi.map
+++ b/src/liburing-ffi.map
@@ -264,4 +264,6 @@ LIBURING_2.13 {
LIBURING_2.14 {
global:
io_uring_register_task_restrictions;
+ io_uring_prep_mmap;
+
} LIBURING_2.13;
--
2.52.0
next prev parent reply other threads:[~2026-01-29 22:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-29 22:12 [PATCH liburing 0/2] liburing mmap support Gabriel Krisman Bertazi
2026-01-29 22:12 ` Gabriel Krisman Bertazi [this message]
2026-01-29 22:12 ` [PATCH liburing 2/2] mmap.t: Introduce IORING_OP_MMAP test case Gabriel Krisman Bertazi
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 \
--in-reply-to=20260129221236.898135-2-krisman@suse.de \
--to=krisman@suse.de \
--cc=axboe@kernel.dk \
--cc=io-uring@vger.kernel.org \
/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