summaryrefslogtreecommitdiff
path: root/mm/vmstat.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2008-10-06 04:17:48 +0400
committerAlexey Dobriyan <adobriyan@gmail.com>2008-10-23 17:12:51 +0400
commitb6aa44ab698c7df9d951d3eb45c4fcb8ba68fb25 (patch)
tree3ddf82053cc10e4811e77918fb00aad1c09c94c1 /mm/vmstat.c
parent74e2e8e8ce7b3c0f878a349f9fa6cf2831548eef (diff)
proc: move /proc/vmstat boilerplate to mm/vmstat.c
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Acked-by: Christoph Lameter <cl@linux-foundation.org>
Diffstat (limited to 'mm/vmstat.c')
-rw-r--r--mm/vmstat.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/mm/vmstat.c b/mm/vmstat.c
index d624d251946..7e1854b8186 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -858,13 +858,24 @@ static void vmstat_stop(struct seq_file *m, void *arg)
m->private = NULL;
}
-const struct seq_operations vmstat_op = {
+static const struct seq_operations vmstat_op = {
.start = vmstat_start,
.next = vmstat_next,
.stop = vmstat_stop,
.show = vmstat_show,
};
+static int vmstat_open(struct inode *inode, struct file *file)
+{
+ return seq_open(file, &vmstat_op);
+}
+
+static const struct file_operations proc_vmstat_file_operations = {
+ .open = vmstat_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = seq_release,
+};
#endif /* CONFIG_PROC_FS */
#ifdef CONFIG_SMP
@@ -938,6 +949,7 @@ static int __init setup_vmstat(void)
#ifdef CONFIG_PROC_FS
proc_create("buddyinfo", S_IRUGO, NULL, &fragmentation_file_operations);
proc_create("pagetypeinfo", S_IRUGO, NULL, &pagetypeinfo_file_ops);
+ proc_create("vmstat", S_IRUGO, NULL, &proc_vmstat_file_operations);
#endif
return 0;
}