]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - mm/vmstat.c
proc: move /proc/vmstat boilerplate to mm/vmstat.c
[linux-2.6-omap-h63xx.git] / mm / vmstat.c
index d624d251946dd01d3e68e2d3b764198cb53ca784..7e1854b81868cbf6f7f88e43a99abe4ed8f39986 100644 (file)
@@ -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;
 }