mirror of
https://github.com/torvalds/linux
synced 2024-10-03 01:43:05 +00:00
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>
This commit is contained in:
parent
d285da7dbd
commit
8c9a6f549e
|
@ -11,7 +11,6 @@ void __io_uring_cancel(bool cancel_all);
|
||||||
void __io_uring_free(struct task_struct *tsk);
|
void __io_uring_free(struct task_struct *tsk);
|
||||||
void io_uring_unreg_ringfd(void);
|
void io_uring_unreg_ringfd(void);
|
||||||
const char *io_uring_get_opcode(u8 opcode);
|
const char *io_uring_get_opcode(u8 opcode);
|
||||||
int io_uring_cmd_sock(struct io_uring_cmd *cmd, unsigned int issue_flags);
|
|
||||||
bool io_is_uring_fops(struct file *file);
|
bool io_is_uring_fops(struct file *file);
|
||||||
|
|
||||||
static inline void io_uring_files_cancel(void)
|
static inline void io_uring_files_cancel(void)
|
||||||
|
@ -45,11 +44,6 @@ static inline const char *io_uring_get_opcode(u8 opcode)
|
||||||
{
|
{
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
static inline int io_uring_cmd_sock(struct io_uring_cmd *cmd,
|
|
||||||
unsigned int issue_flags)
|
|
||||||
{
|
|
||||||
return -EOPNOTSUPP;
|
|
||||||
}
|
|
||||||
static inline bool io_is_uring_fops(struct file *file)
|
static inline bool io_is_uring_fops(struct file *file)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|
18
include/linux/io_uring/net.h
Normal file
18
include/linux/io_uring/net.h
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||||
|
#ifndef _LINUX_IO_URING_NET_H
|
||||||
|
#define _LINUX_IO_URING_NET_H
|
||||||
|
|
||||||
|
struct io_uring_cmd;
|
||||||
|
|
||||||
|
#if defined(CONFIG_IO_URING)
|
||||||
|
int io_uring_cmd_sock(struct io_uring_cmd *cmd, unsigned int issue_flags);
|
||||||
|
|
||||||
|
#else
|
||||||
|
static inline int io_uring_cmd_sock(struct io_uring_cmd *cmd,
|
||||||
|
unsigned int issue_flags)
|
||||||
|
{
|
||||||
|
return -EOPNOTSUPP;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
|
@ -3,6 +3,7 @@
|
||||||
#include <linux/errno.h>
|
#include <linux/errno.h>
|
||||||
#include <linux/file.h>
|
#include <linux/file.h>
|
||||||
#include <linux/io_uring/cmd.h>
|
#include <linux/io_uring/cmd.h>
|
||||||
|
#include <linux/io_uring/net.h>
|
||||||
#include <linux/security.h>
|
#include <linux/security.h>
|
||||||
#include <linux/nospec.h>
|
#include <linux/nospec.h>
|
||||||
#include <net/sock.h>
|
#include <net/sock.h>
|
||||||
|
|
|
@ -88,7 +88,7 @@
|
||||||
#include <linux/xattr.h>
|
#include <linux/xattr.h>
|
||||||
#include <linux/nospec.h>
|
#include <linux/nospec.h>
|
||||||
#include <linux/indirect_call_wrapper.h>
|
#include <linux/indirect_call_wrapper.h>
|
||||||
#include <linux/io_uring.h>
|
#include <linux/io_uring/net.h>
|
||||||
|
|
||||||
#include <linux/uaccess.h>
|
#include <linux/uaccess.h>
|
||||||
#include <asm/unistd.h>
|
#include <asm/unistd.h>
|
||||||
|
|
Loading…
Reference in a new issue