From 3a618af64de25dc2e81221be5210be730ad5202c Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Mon, 6 Oct 2008 04:17:48 +0400 Subject: [PATCH] --- yaml --- r: 117663 b: refs/heads/master c: b6aa44ab698c7df9d951d3eb45c4fcb8ba68fb25 h: refs/heads/master i: 117661: 56655a083954a1500efd60715dd7b2c820c7e12b 117659: b47faf620e37df813ade90cea7afd5fa4c77831d 117655: 9322e5bb9f5a30c6fc074e09f36826f1704850a6 117647: 3761f6967348405d821ea5b8a1d7f5dd8250203e 117631: b7ca0fcc8df06653d12c3436a53837d4f609a13f v: v3 --- [refs] | 2 +- trunk/fs/proc/proc_misc.c | 12 ------------ trunk/include/linux/vmstat.h | 1 - trunk/mm/vmstat.c | 14 +++++++++++++- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/[refs] b/[refs] index eda52ecf9184..fdceb6b5f290 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 74e2e8e8ce7b3c0f878a349f9fa6cf2831548eef +refs/heads/master: b6aa44ab698c7df9d951d3eb45c4fcb8ba68fb25 diff --git a/trunk/fs/proc/proc_misc.c b/trunk/fs/proc/proc_misc.c index 900331a634ef..e7a301d5d432 100644 --- a/trunk/fs/proc/proc_misc.c +++ b/trunk/fs/proc/proc_misc.c @@ -69,17 +69,6 @@ static const struct file_operations proc_zoneinfo_file_operations = { .release = seq_release, }; -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, -}; - #ifdef CONFIG_BLOCK static int diskstats_open(struct inode *inode, struct file *file) { @@ -245,7 +234,6 @@ void __init proc_misc_init(void) proc_symlink("mounts", NULL, "self/mounts"); /* And now for trickier ones */ - proc_create("vmstat", S_IRUGO, NULL, &proc_vmstat_file_operations); proc_create("zoneinfo", S_IRUGO, NULL, &proc_zoneinfo_file_operations); #ifdef CONFIG_BLOCK proc_create("diskstats", 0, NULL, &proc_diskstats_operations); diff --git a/trunk/include/linux/vmstat.h b/trunk/include/linux/vmstat.h index 33ffd89a88ac..7b68c4c1e19c 100644 --- a/trunk/include/linux/vmstat.h +++ b/trunk/include/linux/vmstat.h @@ -55,7 +55,6 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, }; extern const struct seq_operations zoneinfo_op; -extern const struct seq_operations vmstat_op; extern int sysctl_stat_interval; #ifdef CONFIG_VM_EVENT_COUNTERS diff --git a/trunk/mm/vmstat.c b/trunk/mm/vmstat.c index d624d251946d..7e1854b81868 100644 --- a/trunk/mm/vmstat.c +++ b/trunk/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; }