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: add a dummy -EOPNOTSUPP prep handler

Add it and use it for the epoll handling, if epoll isn't configured.

Signed-off-by: Jens Axboe <axboe@kernel.dk>

+14 -9
+14 -9
io_uring/io_uring.c
··· 4034 4034 return IOU_ISSUE_SKIP_COMPLETE; 4035 4035 } 4036 4036 4037 + static __maybe_unused int io_eopnotsupp_prep(struct io_kiocb *kiocb, 4038 + const struct io_uring_sqe *sqe) 4039 + { 4040 + return -EOPNOTSUPP; 4041 + } 4042 + 4043 + #if defined(CONFIG_EPOLL) 4037 4044 static int io_epoll_ctl_prep(struct io_kiocb *req, 4038 4045 const struct io_uring_sqe *sqe) 4039 4046 { 4040 - #if defined(CONFIG_EPOLL) 4041 4047 struct io_epoll *epoll = io_kiocb_to_cmd(req); 4042 4048 4043 4049 if (sqe->buf_index || sqe->splice_fd_in) ··· 4062 4056 } 4063 4057 4064 4058 return 0; 4065 - #else 4066 - return -EOPNOTSUPP; 4067 - #endif 4068 4059 } 4069 4060 4070 4061 static int io_epoll_ctl(struct io_kiocb *req, unsigned int issue_flags) 4071 4062 { 4072 - #if defined(CONFIG_EPOLL) 4073 4063 struct io_epoll *ie = io_kiocb_to_cmd(req); 4074 4064 int ret; 4075 4065 bool force_nonblock = issue_flags & IO_URING_F_NONBLOCK; ··· 4078 4076 req_set_fail(req); 4079 4077 io_req_set_res(req, ret, 0); 4080 4078 return IOU_OK; 4081 - #else 4082 - return -EOPNOTSUPP; 4083 - #endif 4084 4079 } 4080 + #endif 4085 4081 4086 4082 static int io_statx_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe) 4087 4083 { ··· 11246 11246 [IORING_OP_EPOLL_CTL] = { 11247 11247 .unbound_nonreg_file = 1, 11248 11248 .audit_skip = 1, 11249 + #if defined(CONFIG_EPOLL) 11249 11250 .prep = io_epoll_ctl_prep, 11250 11251 .issue = io_epoll_ctl, 11252 + #else 11253 + .prep = io_eopnotsupp_prep, 11254 + #endif 11251 11255 }, 11252 11256 [IORING_OP_SPLICE] = { 11253 11257 .needs_file = 1, ··· 11422 11418 11423 11419 for (i = 0; i < ARRAY_SIZE(io_op_defs); i++) { 11424 11420 BUG_ON(!io_op_defs[i].prep); 11425 - BUG_ON(!io_op_defs[i].issue); 11421 + if (io_op_defs[i].prep != io_eopnotsupp_prep) 11422 + BUG_ON(!io_op_defs[i].issue); 11426 11423 } 11427 11424 11428 11425 req_cachep = KMEM_CACHE(io_kiocb, SLAB_HWCACHE_ALIGN | SLAB_PANIC |