1 /* FS-Cache statistics viewing interface
3 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
12 #define FSCACHE_DEBUG_LEVEL OPERATION
13 #include <linux/module.h>
14 #include <linux/proc_fs.h>
15 #include <linux/seq_file.h>
19 * initialise the /proc/fs/fscache/ directory
21 int __init fscache_proc_init(void)
25 if (!proc_mkdir("fs/fscache", NULL))
28 #ifdef CONFIG_FSCACHE_STATS
29 if (!proc_create("fs/fscache/stats", S_IFREG | 0444, NULL,
34 #ifdef CONFIG_FSCACHE_HISTOGRAM
35 if (!proc_create("fs/fscache/histogram", S_IFREG | 0444, NULL,
36 &fscache_histogram_fops))
43 #ifdef CONFIG_FSCACHE_HISTOGRAM
46 #ifdef CONFIG_FSCACHE_STATS
47 remove_proc_entry("fs/fscache/stats", NULL);
50 remove_proc_entry("fs/fscache", NULL);
57 * clean up the /proc/fs/fscache/ directory
59 void fscache_proc_cleanup(void)
61 #ifdef CONFIG_FSCACHE_HISTOGRAM
62 remove_proc_entry("fs/fscache/histogram", NULL);
64 #ifdef CONFIG_FSCACHE_STATS
65 remove_proc_entry("fs/fscache/stats", NULL);
67 remove_proc_entry("fs/fscache", NULL);