|
100 | 100 | #include "advise.h"
|
101 | 101 | #include "openclose.h"
|
102 | 102 | #include "uring_cmd.h"
|
| 103 | +#include "epoll.h" |
103 | 104 |
|
104 | 105 | #define IORING_MAX_ENTRIES 32768
|
105 | 106 | #define IORING_MAX_CQ_ENTRIES (2 * IORING_MAX_ENTRIES)
|
@@ -374,14 +375,6 @@ struct io_rsrc_update {
|
374 | 375 | u32 offset;
|
375 | 376 | };
|
376 | 377 |
|
377 |
| -struct io_epoll { |
378 |
| - struct file *file; |
379 |
| - int epfd; |
380 |
| - int op; |
381 |
| - int fd; |
382 |
| - struct epoll_event event; |
383 |
| -}; |
384 |
| - |
385 | 378 | struct io_provide_buf {
|
386 | 379 | struct file *file;
|
387 | 380 | __u64 addr;
|
@@ -4040,47 +4033,6 @@ static __maybe_unused int io_eopnotsupp_prep(struct io_kiocb *kiocb,
|
4040 | 4033 | return -EOPNOTSUPP;
|
4041 | 4034 | }
|
4042 | 4035 |
|
4043 |
| -#if defined(CONFIG_EPOLL) |
4044 |
| -static int io_epoll_ctl_prep(struct io_kiocb *req, |
4045 |
| - const struct io_uring_sqe *sqe) |
4046 |
| -{ |
4047 |
| - struct io_epoll *epoll = io_kiocb_to_cmd(req); |
4048 |
| - |
4049 |
| - if (sqe->buf_index || sqe->splice_fd_in) |
4050 |
| - return -EINVAL; |
4051 |
| - |
4052 |
| - epoll->epfd = READ_ONCE(sqe->fd); |
4053 |
| - epoll->op = READ_ONCE(sqe->len); |
4054 |
| - epoll->fd = READ_ONCE(sqe->off); |
4055 |
| - |
4056 |
| - if (ep_op_has_event(epoll->op)) { |
4057 |
| - struct epoll_event __user *ev; |
4058 |
| - |
4059 |
| - ev = u64_to_user_ptr(READ_ONCE(sqe->addr)); |
4060 |
| - if (copy_from_user(&epoll->event, ev, sizeof(*ev))) |
4061 |
| - return -EFAULT; |
4062 |
| - } |
4063 |
| - |
4064 |
| - return 0; |
4065 |
| -} |
4066 |
| - |
4067 |
| -static int io_epoll_ctl(struct io_kiocb *req, unsigned int issue_flags) |
4068 |
| -{ |
4069 |
| - struct io_epoll *ie = io_kiocb_to_cmd(req); |
4070 |
| - int ret; |
4071 |
| - bool force_nonblock = issue_flags & IO_URING_F_NONBLOCK; |
4072 |
| - |
4073 |
| - ret = do_epoll_ctl(ie->epfd, ie->op, ie->fd, &ie->event, force_nonblock); |
4074 |
| - if (force_nonblock && ret == -EAGAIN) |
4075 |
| - return -EAGAIN; |
4076 |
| - |
4077 |
| - if (ret < 0) |
4078 |
| - req_set_fail(req); |
4079 |
| - io_req_set_res(req, ret, 0); |
4080 |
| - return IOU_OK; |
4081 |
| -} |
4082 |
| -#endif |
4083 |
| - |
4084 | 4036 | static int io_statx_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
|
4085 | 4037 | {
|
4086 | 4038 | struct io_statx *sx = io_kiocb_to_cmd(req);
|
|
0 commit comments