Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring: separate header for exported net bits

We're exporting some io_uring bits to networking, e.g. for implementing
a net callback for io_uring cmds, but we don't want to expose more than
needed. Add a separate header for networking.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: David Wei <dw@davidwei.uk>
Link: https://lore.kernel.org/r/20240409210554.1878789-1-dw@davidwei.uk
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Pavel Begunkov and committed by
Jens Axboe
8c9a6f54 d285da7d

+20 -7
-6
include/linux/io_uring.h
··· 11 11 void __io_uring_free(struct task_struct *tsk); 12 12 void io_uring_unreg_ringfd(void); 13 13 const char *io_uring_get_opcode(u8 opcode); 14 - int io_uring_cmd_sock(struct io_uring_cmd *cmd, unsigned int issue_flags); 15 14 bool io_is_uring_fops(struct file *file); 16 15 17 16 static inline void io_uring_files_cancel(void) ··· 43 44 static inline const char *io_uring_get_opcode(u8 opcode) 44 45 { 45 46 return ""; 46 - } 47 - static inline int io_uring_cmd_sock(struct io_uring_cmd *cmd, 48 - unsigned int issue_flags) 49 - { 50 - return -EOPNOTSUPP; 51 47 } 52 48 static inline bool io_is_uring_fops(struct file *file) 53 49 {
+18
include/linux/io_uring/net.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 + #ifndef _LINUX_IO_URING_NET_H 3 + #define _LINUX_IO_URING_NET_H 4 + 5 + struct io_uring_cmd; 6 + 7 + #if defined(CONFIG_IO_URING) 8 + int io_uring_cmd_sock(struct io_uring_cmd *cmd, unsigned int issue_flags); 9 + 10 + #else 11 + static inline int io_uring_cmd_sock(struct io_uring_cmd *cmd, 12 + unsigned int issue_flags) 13 + { 14 + return -EOPNOTSUPP; 15 + } 16 + #endif 17 + 18 + #endif
+1
io_uring/uring_cmd.c
··· 3 3 #include <linux/errno.h> 4 4 #include <linux/file.h> 5 5 #include <linux/io_uring/cmd.h> 6 + #include <linux/io_uring/net.h> 6 7 #include <linux/security.h> 7 8 #include <linux/nospec.h> 8 9 #include <net/sock.h>
+1 -1
net/socket.c
··· 88 88 #include <linux/xattr.h> 89 89 #include <linux/nospec.h> 90 90 #include <linux/indirect_call_wrapper.h> 91 - #include <linux/io_uring.h> 91 + #include <linux/io_uring/net.h> 92 92 93 93 #include <linux/uaccess.h> 94 94 #include <asm/unistd.h>