diff mbox series

[RFC,1/6] proc: proc_readfd() -> proc_fd_iterate_shared()

Message ID 20240806-work-procfs-v1-1-fb04e1d09f0c@kernel.org (mailing list archive)
State New
Headers show
Series proc: restrict overmounting of ephemeral entities | expand

Commit Message

Christian Brauner Aug. 6, 2024, 4:02 p.m. UTC
Give the method to iterate through the fd directory a better name.

Signed-off-by: Christian Brauner <brauner@kernel.org>
---
 fs/proc/fd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Linus Torvalds Aug. 6, 2024, 5:06 p.m. UTC | #1
On Tue, 6 Aug 2024 at 09:02, Christian Brauner <brauner@kernel.org> wrote:
>
> -static int proc_readfd(struct file *file, struct dir_context *ctx)
> +static int proc_fd_iterate_shared(struct file *file, struct dir_context *ctx)

I think the "proc_fd_iterate" part is great.

The "shared" part I'm not super-excited about, simply because we
finally got rid of the non-shared 'iterate' function entirely last
year, and so the "_shared" part is pure historical naming.

In fact, I was hoping we'd do an automated rename at some point. Maybe
not to "iterate" (too generic a name), but something like
"iterate_dir" or something would avoid the now pointless "shared"
thing.

                 Linus
diff mbox series

Patch

diff --git a/fs/proc/fd.c b/fs/proc/fd.c
index 586bbc84ca04..41bc75d5060c 100644
--- a/fs/proc/fd.c
+++ b/fs/proc/fd.c
@@ -312,14 +312,14 @@  static int proc_readfd_count(struct inode *inode, loff_t *count)
 	return 0;
 }
 
-static int proc_readfd(struct file *file, struct dir_context *ctx)
+static int proc_fd_iterate_shared(struct file *file, struct dir_context *ctx)
 {
 	return proc_readfd_common(file, ctx, proc_fd_instantiate);
 }
 
 const struct file_operations proc_fd_operations = {
 	.read		= generic_read_dir,
-	.iterate_shared	= proc_readfd,
+	.iterate_shared	= proc_fd_iterate_shared,
 	.llseek		= generic_file_llseek,
 };