mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-22 02:17:36 -04:00
io_uring/epoll: switch to using do_epoll_ctl_file() interface
No functional changes in this patch. Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
@@ -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;
|
||||
|
||||
ret = do_epoll_ctl(ie->epfd, ie->op, ie->fd, &ie->event, force_nonblock);
|
||||
CLASS(fd, f)(ie->epfd);
|
||||
if (fd_empty(f))
|
||||
return -EBADF;
|
||||
|
||||
CLASS(fd, tf)(ie->fd);
|
||||
if (fd_empty(tf))
|
||||
return -EBADF;
|
||||
|
||||
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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user