All of lore.kernel.org
 help / color / mirror / Atom feed
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 4/6] eventpoll: rename struct epoll_filefd to epoll_key
Date: Thu, 14 May 2026 08:07:20 -0600	[thread overview]
Message-ID: <20260514140817.623026-5-axboe@kernel.dk> (raw)
In-Reply-To: <20260514140817.623026-1-axboe@kernel.dk>

This more accurately describes what purpose this structure serves, as
a lookup key.

Suggested-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
 fs/eventpoll.c            | 13 ++++++-------
 include/linux/eventpoll.h |  4 ++--
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index 1c7001866340..7535b10f8c6a 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -141,7 +141,7 @@ struct epitem {
 	struct epitem *next;
 
 	/* The file descriptor information this item refers to */
-	struct epoll_filefd ffd;
+	struct epoll_key ffd;
 
 	/* List containing poll wait queues */
 	struct eppoll_entry *pwqlist;
@@ -335,8 +335,7 @@ int is_file_epoll(struct file *f)
 }
 
 /* Compare RB tree keys */
-static inline int ep_cmp_ffd(struct epoll_filefd *p1,
-			     struct epoll_filefd *p2)
+static inline int ep_cmp_ffd(struct epoll_key *p1, struct epoll_key *p2)
 {
 	return (p1->file > p2->file ? +1:
 	        (p1->file < p2->file ? -1 : p1->fd - p2->fd));
@@ -1160,7 +1159,7 @@ static int ep_alloc(struct eventpoll **pep)
  * are protected by the "mtx" mutex, and ep_find() must be called with
  * "mtx" held.
  */
-static struct epitem *ep_find(struct eventpoll *ep, struct epoll_filefd *tf)
+static struct epitem *ep_find(struct eventpoll *ep, struct epoll_key *tf)
 {
 	int kcmp;
 	struct rb_node *rbp;
@@ -1549,7 +1548,7 @@ static int attach_epitem(struct file *file, struct epitem *epi)
  * Must be called with "mtx" held.
  */
 static int ep_insert(struct eventpoll *ep, const struct epoll_event *event,
-		     struct epoll_filefd *tf, int full_check)
+		     struct epoll_key *tf, int full_check)
 {
 	int error, pwake = 0;
 	__poll_t revents;
@@ -2220,7 +2219,7 @@ static inline int epoll_mutex_lock(struct mutex *mutex, int depth,
 	return -EAGAIN;
 }
 
-int do_epoll_ctl_file(struct file *f, int op, struct epoll_filefd *tf,
+int do_epoll_ctl_file(struct file *f, int op, struct epoll_key *tf,
 		      struct epoll_event *epds, bool nonblock)
 {
 	int error;
@@ -2357,7 +2356,7 @@ int do_epoll_ctl_file(struct file *f, int op, struct epoll_filefd *tf,
 int do_epoll_ctl(int epfd, int op, int fd, struct epoll_event *epds,
 		 bool nonblock)
 {
-	struct epoll_filefd efd;
+	struct epoll_key efd;
 
 	CLASS(fd, f)(epfd);
 	if (fd_empty(f))
diff --git a/include/linux/eventpoll.h b/include/linux/eventpoll.h
index 4a6fe989810b..c214c374fefc 100644
--- a/include/linux/eventpoll.h
+++ b/include/linux/eventpoll.h
@@ -61,12 +61,12 @@ static inline void eventpoll_release(struct file *file)
 	eventpoll_release_file(file);
 }
 
-struct epoll_filefd {
+struct epoll_key {
 	struct file *file;
 	int fd;
 } __packed;
 
-int do_epoll_ctl_file(struct file *f, int op, struct epoll_filefd *tf,
+int do_epoll_ctl_file(struct file *f, int op, struct epoll_key *tf,
 		      struct epoll_event *epds, bool nonblock);
 int do_epoll_ctl(int epfd, int op, int fd, struct epoll_event *epds,
 		 bool nonblock);
-- 
2.53.0


  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 ` Jens Axboe [this message]
2026-05-14 14:07 ` [PATCH 5/6] io_uring/epoll: switch to using do_epoll_ctl_file() interface Jens Axboe
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-5-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.