From: Jens Axboe <axboe@kernel.dk>
To: io-uring@vger.kernel.org
Cc: linux-fsdevel@vger.kernel.org, brauner@kernel.org,
Jens Axboe <axboe@kernel.dk>
Subject: [PATCH 5/6] io_uring/epoll: switch to using do_epoll_ctl_file() interface
Date: Thu, 14 May 2026 08:07:21 -0600 [thread overview]
Message-ID: <20260514140817.623026-6-axboe@kernel.dk> (raw)
In-Reply-To: <20260514140817.623026-1-axboe@kernel.dk>
No functional changes in this patch.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
io_uring/epoll.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/io_uring/epoll.c b/io_uring/epoll.c
index 8d4610246ba0..b9db8bde27ec 100644
--- a/io_uring/epoll.c
+++ b/io_uring/epoll.c
@@ -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;
--
2.53.0
next prev parent reply other threads:[~2026-05-14 14:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-14 14:07 [PATCHSET v2 0/6] io_uring related epoll cleanups Jens Axboe
2026-05-14 14:07 ` [PATCH 1/6] eventpoll: pass struct epoll_filefd through ep_find() and ep_insert() Jens Axboe
2026-05-14 14:07 ` [PATCH 2/6] eventpoll: export is_file_epoll() Jens Axboe
2026-05-14 14:07 ` [PATCH 3/6] eventpoll: add file based control interface Jens Axboe
2026-05-14 14:07 ` [PATCH 4/6] eventpoll: rename struct epoll_filefd to epoll_key Jens Axboe
2026-05-14 14:07 ` Jens Axboe [this message]
2026-05-14 14:07 ` [PATCH 6/6] io_uring/epoll: disallow adding an epoll file to an epoll context Jens Axboe
2026-05-15 15:08 ` (subset) [PATCHSET v2 0/6] io_uring related epoll cleanups Christian Brauner
2026-05-15 15:25 ` Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260514140817.623026-6-axboe@kernel.dk \
--to=axboe@kernel.dk \
--cc=brauner@kernel.org \
--cc=io-uring@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.