diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2008-10-06 04:19:42 +0400 |
---|---|---|
committer | Alexey Dobriyan <adobriyan@gmail.com> | 2008-10-17 21:12:34 +0400 |
commit | 484d411850a2ddc2f246945e91e72d8e4e26f116 (patch) | |
tree | 9226a1c477a3f02c6dba37b17fbdb7433203a664 /mm | |
parent | 33f05735aca0a7c95a2834398db9fbd8d0c21e28 (diff) |
proc: move /proc/zoneinfo 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')
-rw-r--r-- | mm/vmstat.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/mm/vmstat.c b/mm/vmstat.c index dc76249f24ff..68ab9b458991 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -774,7 +774,7 @@ static int zoneinfo_show(struct seq_file *m, void *arg) return 0; } -const struct seq_operations zoneinfo_op = { +static const struct seq_operations zoneinfo_op = { .start = frag_start, /* iterate over all zones. The same as in * fragmentation. */ .next = frag_next, @@ -782,6 +782,18 @@ const struct seq_operations zoneinfo_op = { .show = zoneinfo_show, }; +static int zoneinfo_open(struct inode *inode, struct file *file) +{ + return seq_open(file, &zoneinfo_op); +} + +static const struct file_operations proc_zoneinfo_file_operations = { + .open = zoneinfo_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, +}; + static void *vmstat_start(struct seq_file *m, loff_t *pos) { unsigned long *v; @@ -929,6 +941,7 @@ static int __init setup_vmstat(void) 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); + proc_create("zoneinfo", S_IRUGO, NULL, &proc_zoneinfo_file_operations); #endif return 0; } |