]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
io-uring: move `struct io_br_sel` into io_uring_types.h
authorMing Lei <ming.lei@redhat.com>
Thu, 21 Aug 2025 04:02:06 +0000 (12:02 +0800)
committerJens Axboe <axboe@kernel.dk>
Sun, 24 Aug 2025 17:41:12 +0000 (11:41 -0600)
Move `struct io_br_sel` into io_uring_types.h and prepare for supporting
provided buffer on uring_cmd.

Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20250821040210.1152145-2-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/io_uring_types.h
io_uring/kbuf.h

index 1d33984611bc9546de6721e0962964766e839ffc..9c6c548f43f59081577242b2e4fd58eed39378dc 100644 (file)
@@ -85,6 +85,25 @@ struct io_mapped_region {
        unsigned                flags;
 };
 
+/*
+ * Return value from io_buffer_list selection, to avoid stashing it in
+ * struct io_kiocb. For legacy/classic provided buffers, keeping a reference
+ * across execution contexts are fine. But for ring provided buffers, the
+ * list may go away as soon as ->uring_lock is dropped. As the io_kiocb
+ * persists, it's better to just keep the buffer local for those cases.
+ */
+struct io_br_sel {
+       struct io_buffer_list *buf_list;
+       /*
+        * Some selection parts return the user address, others return an error.
+        */
+       union {
+               void __user *addr;
+               ssize_t val;
+       };
+};
+
+
 /*
  * Arbitrary limit, can be raised if need be
  */
index 32f73adbe1e9ec957c9b4eab0cd4450480b9e542..ada382ff38d7e33f4af4a5d2e98d40f5e7712b15 100644 (file)
@@ -62,24 +62,6 @@ struct buf_sel_arg {
        unsigned short partial_map;
 };
 
-/*
- * Return value from io_buffer_list selection, to avoid stashing it in
- * struct io_kiocb. For legacy/classic provided buffers, keeping a reference
- * across execution contexts are fine. But for ring provided buffers, the
- * list may go away as soon as ->uring_lock is dropped. As the io_kiocb
- * persists, it's better to just keep the buffer local for those cases.
- */
-struct io_br_sel {
-       struct io_buffer_list *buf_list;
-       /*
-        * Some selection parts return the user address, others return an error.
-        */
-       union {
-               void __user *addr;
-               ssize_t val;
-       };
-};
-
 struct io_br_sel io_buffer_select(struct io_kiocb *req, size_t *len,
                                  unsigned buf_group, unsigned int issue_flags);
 int io_buffers_select(struct io_kiocb *req, struct buf_sel_arg *arg,