]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
io_uring/epoll: switch to using do_epoll_ctl_file() interface
authorJens Axboe <axboe@kernel.dk>
Thu, 23 Apr 2026 11:10:15 +0000 (05:10 -0600)
committerJens Axboe <axboe@kernel.dk>
Fri, 15 May 2026 15:57:37 +0000 (09:57 -0600)
No functional changes in this patch.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/epoll.c

index 8d4610246ba0aaa352315daa046c4933eccd39d9..b9db8bde27ec8c708a3e0b5e7b176e4201599a84 100644 (file)
@@ -51,10 +51,21 @@ int io_epoll_ctl_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
 int io_epoll_ctl(struct io_kiocb *req, unsigned int issue_flags)
 {
        struct io_epoll *ie = io_kiocb_to_cmd(req, struct io_epoll);
-       int ret;
        bool force_nonblock = issue_flags & IO_URING_F_NONBLOCK;
+       struct epoll_key key;
+       int ret;
+
+       CLASS(fd, f)(ie->epfd);
+       if (fd_empty(f))
+               return -EBADF;
+
+       CLASS(fd, tf)(ie->fd);
+       if (fd_empty(tf))
+               return -EBADF;
 
-       ret = do_epoll_ctl(ie->epfd, ie->op, ie->fd, &ie->event, force_nonblock);
+       key.file = fd_file(tf);
+       key.fd = ie->fd;
+       ret = do_epoll_ctl_file(fd_file(f), ie->op, &key, &ie->event, force_nonblock);
        if (force_nonblock && ret == -EAGAIN)
                return -EAGAIN;