1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /* FS-Cache statistics viewing interface
4 * Copyright (C) 2021 Red Hat, Inc. All Rights Reserved.
5 * Written by David Howells (dhowells@redhat.com)
8 #define FSCACHE_DEBUG_LEVEL CACHE
9 #include <linux/module.h>
10 #include <linux/proc_fs.h>
11 #include <linux/seq_file.h>
15 * initialise the /proc/fs/fscache/ directory
17 int __init fscache_proc_init(void)
19 if (!proc_mkdir("fs/fscache", NULL))
22 if (!proc_create_seq("fs/fscache/caches", S_IFREG | 0444, NULL,
23 &fscache_caches_seq_ops))
26 if (!proc_create_seq("fs/fscache/volumes", S_IFREG | 0444, NULL,
27 &fscache_volumes_seq_ops))
30 if (!proc_create_seq("fs/fscache/cookies", S_IFREG | 0444, NULL,
31 &fscache_cookies_seq_ops))
34 #ifdef CONFIG_FSCACHE_STATS
35 if (!proc_create_single("fs/fscache/stats", S_IFREG | 0444, NULL,
43 remove_proc_entry("fs/fscache", NULL);
49 * clean up the /proc/fs/fscache/ directory
51 void fscache_proc_cleanup(void)
53 remove_proc_subtree("fs/fscache", NULL);