summaryrefslogtreecommitdiff
path: root/fs/fscache/proc.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2020-02-10 10:00:22 +0000
committerDavid Howells <dhowells@redhat.com>2021-08-27 13:34:02 +0100
commit884a76881fc5f5c9c04de1b640bed2c340929842 (patch)
tree4db8f93ddc6ee3a82e02e3cb3b7c6aafda5646c1 /fs/fscache/proc.c
parent2908f5e101e3fb1d478cff1c556966e1af816641 (diff)
fscache: Procfile to display cookies
Add /proc/fs/fscache/cookies to display active cookies. Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: Jeff Layton <jlayton@redhat.com> cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/158861211871.340223.7223853943667440807.stgit@warthog.procyon.org.uk/ # rfc Link: https://lore.kernel.org/r/159465771021.1376105.6933857529128238020.stgit@warthog.procyon.org.uk/ Link: https://lore.kernel.org/r/160588460994.3465195.16963417803501149328.stgit@warthog.procyon.org.uk/ # rfc Link: https://lore.kernel.org/r/162431194785.2908479.786917990782538164.stgit@warthog.procyon.org.uk/
Diffstat (limited to 'fs/fscache/proc.c')
-rw-r--r--fs/fscache/proc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/fscache/proc.c b/fs/fscache/proc.c
index 90a7bc22f7e1..da51fdfc8641 100644
--- a/fs/fscache/proc.c
+++ b/fs/fscache/proc.c
@@ -21,6 +21,10 @@ int __init fscache_proc_init(void)
if (!proc_mkdir("fs/fscache", NULL))
goto error_dir;
+ if (!proc_create_seq("fs/fscache/cookies", S_IFREG | 0444, NULL,
+ &fscache_cookies_seq_ops))
+ goto error_cookies;
+
#ifdef CONFIG_FSCACHE_STATS
if (!proc_create_single("fs/fscache/stats", S_IFREG | 0444, NULL,
fscache_stats_show))
@@ -53,6 +57,8 @@ error_histogram:
remove_proc_entry("fs/fscache/stats", NULL);
error_stats:
#endif
+ remove_proc_entry("fs/fscache/cookies", NULL);
+error_cookies:
remove_proc_entry("fs/fscache", NULL);
error_dir:
_leave(" = -ENOMEM");
@@ -73,5 +79,6 @@ void fscache_proc_cleanup(void)
#ifdef CONFIG_FSCACHE_STATS
remove_proc_entry("fs/fscache/stats", NULL);
#endif
+ remove_proc_entry("fs/fscache/cookies", NULL);
remove_proc_entry("fs/fscache", NULL);
}