Skip to content

Commit a3ec600

Browse files
committed
io_uring: move io_uring_get_socket() into io_uring.h
Now we have a io_uring kernel header, move this definition out of fs.h and into io_uring.h where it belongs. Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 9b82849 commit a3ec600

3 files changed

Lines changed: 6 additions & 9 deletions

File tree

‎include/linux/fs.h‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3514,15 +3514,6 @@ extern int vfs_fadvise(struct file *file, loff_t offset, loff_t len,
35143514
extern int generic_fadvise(struct file *file, loff_t offset, loff_t len,
35153515
int advice);
35163516

3517-
#if defined(CONFIG_IO_URING)
3518-
extern struct sock *io_uring_get_socket(struct file *file);
3519-
#else
3520-
static inline struct sock *io_uring_get_socket(struct file *file)
3521-
{
3522-
return NULL;
3523-
}
3524-
#endif
3525-
35263517
int vfs_ioc_setflags_prepare(struct inode *inode, unsigned int oldflags,
35273518
unsigned int flags);
35283519

‎include/linux/io_uring.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ struct io_uring_task {
1919
};
2020

2121
#if defined(CONFIG_IO_URING)
22+
struct sock *io_uring_get_socket(struct file *file);
2223
void __io_uring_task_cancel(void);
2324
void __io_uring_files_cancel(struct files_struct *files);
2425
void __io_uring_free(struct task_struct *tsk);
@@ -39,6 +40,10 @@ static inline void io_uring_free(struct task_struct *tsk)
3940
__io_uring_free(tsk);
4041
}
4142
#else
43+
static inline struct sock *io_uring_get_socket(struct file *file)
44+
{
45+
return NULL;
46+
}
4247
static inline void io_uring_task_cancel(void)
4348
{
4449
}

‎net/unix/scm.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <net/af_unix.h>
99
#include <net/scm.h>
1010
#include <linux/init.h>
11+
#include <linux/io_uring.h>
1112

1213
#include "scm.h"
1314

0 commit comments

Comments
 (0)