From: Mateusz Guzik <mjguzik@gmail.com>
To: brauner@kernel.org
Cc: viro@zeniv.linux.org.uk, jack@suse.cz,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
Mateusz Guzik <mjguzik@gmail.com>
Subject: [PATCH 1/2] proc: add a helper for marking files as permanent by external consumers
Date: Sat, 29 Mar 2025 20:28:20 +0100 [thread overview]
Message-ID: <20250329192821.822253-2-mjguzik@gmail.com> (raw)
In-Reply-To: <20250329192821.822253-1-mjguzik@gmail.com>
This avoids refing trips on use, added with VFS in mind but should be
helpful elsewhere as well.
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
---
fs/proc/generic.c | 6 ++++++
include/linux/proc_fs.h | 1 +
2 files changed, 7 insertions(+)
diff --git a/fs/proc/generic.c b/fs/proc/generic.c
index a3e22803cddf..ae86554bb271 100644
--- a/fs/proc/generic.c
+++ b/fs/proc/generic.c
@@ -668,6 +668,12 @@ struct proc_dir_entry *proc_create_single_data(const char *name, umode_t mode,
}
EXPORT_SYMBOL(proc_create_single_data);
+void proc_make_permanent(struct proc_dir_entry *de)
+{
+ pde_make_permanent(de);
+}
+EXPORT_SYMBOL(proc_make_permanent);
+
void proc_set_size(struct proc_dir_entry *de, loff_t size)
{
de->size = size;
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index ea62201c74c4..0b6fcef4099a 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -105,6 +105,7 @@ struct proc_dir_entry *proc_create_single_data(const char *name, umode_t mode,
int (*show)(struct seq_file *, void *), void *data);
#define proc_create_single(name, mode, parent, show) \
proc_create_single_data(name, mode, parent, show, NULL)
+void proc_make_permanent(struct proc_dir_entry *);
extern struct proc_dir_entry *proc_create_data(const char *, umode_t,
struct proc_dir_entry *,
--
2.43.0
next prev parent reply other threads:[~2025-03-29 19:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-29 19:28 [PATCH 0/2] speed up /proc/filesystems Mateusz Guzik
2025-03-29 19:28 ` Mateusz Guzik [this message]
2025-03-29 19:28 ` [PATCH 2/2] fs: cache the string generated by reading /proc/filesystems Mateusz Guzik
2025-03-29 20:53 ` Andreas Schwab
2025-04-04 8:41 ` Christoph Hellwig
2025-04-05 4:55 ` Mateusz Guzik
2025-04-05 5:26 ` Mateusz Guzik
2025-04-01 10:30 ` Christian Brauner
2025-04-01 12:12 ` Mateusz Guzik
2025-04-01 10:34 ` [PATCH 0/2] speed up /proc/filesystems Christian Brauner
-- strict thread matches above, loose matches on Subject: below --
2025-04-01 11:14 [PATCH 1/2] proc: add a helper for marking files as permanent by external consumers Alexey Dobriyan
2025-04-01 12:17 ` Mateusz Guzik
2025-04-01 12:21 ` Mateusz Guzik
2025-04-01 11:18 Alexey Dobriyan
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=20250329192821.822253-2-mjguzik@gmail.com \
--to=mjguzik@gmail.com \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox