aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/proc/proc_misc.c14
-rw-r--r--include/linux/vmstat.h1
-rw-r--r--mm/vmstat.c25
3 files changed, 21 insertions, 19 deletions
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index fd41a032456b..a35e50659b8d 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -57,19 +57,6 @@
57#include <asm/div64.h> 57#include <asm/div64.h>
58#include "internal.h" 58#include "internal.h"
59 59
60static int fragmentation_open(struct inode *inode, struct file *file)
61{
62 (void)inode;
63 return seq_open(file, &fragmentation_op);
64}
65
66static const struct file_operations fragmentation_file_operations = {
67 .open = fragmentation_open,
68 .read = seq_read,
69 .llseek = seq_lseek,
70 .release = seq_release,
71};
72
73static int pagetypeinfo_open(struct inode *inode, struct file *file) 60static int pagetypeinfo_open(struct inode *inode, struct file *file)
74{ 61{
75 return seq_open(file, &pagetypeinfo_op); 62 return seq_open(file, &pagetypeinfo_op);
@@ -270,7 +257,6 @@ void __init proc_misc_init(void)
270 proc_symlink("mounts", NULL, "self/mounts"); 257 proc_symlink("mounts", NULL, "self/mounts");
271 258
272 /* And now for trickier ones */ 259 /* And now for trickier ones */
273 proc_create("buddyinfo", S_IRUGO, NULL, &fragmentation_file_operations);
274 proc_create("pagetypeinfo", S_IRUGO, NULL, &pagetypeinfo_file_ops); 260 proc_create("pagetypeinfo", S_IRUGO, NULL, &pagetypeinfo_file_ops);
275 proc_create("vmstat", S_IRUGO, NULL, &proc_vmstat_file_operations); 261 proc_create("vmstat", S_IRUGO, NULL, &proc_vmstat_file_operations);
276 proc_create("zoneinfo", S_IRUGO, NULL, &proc_zoneinfo_file_operations); 262 proc_create("zoneinfo", S_IRUGO, NULL, &proc_zoneinfo_file_operations);
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index 9cd3ab0f554d..d4551f206409 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -54,7 +54,6 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
54 NR_VM_EVENT_ITEMS 54 NR_VM_EVENT_ITEMS
55}; 55};
56 56
57extern const struct seq_operations fragmentation_op;
58extern const struct seq_operations pagetypeinfo_op; 57extern const struct seq_operations pagetypeinfo_op;
59extern const struct seq_operations zoneinfo_op; 58extern const struct seq_operations zoneinfo_op;
60extern const struct seq_operations vmstat_op; 59extern const struct seq_operations vmstat_op;
diff --git a/mm/vmstat.c b/mm/vmstat.c
index 9343227c5c60..f45d7245a282 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -8,7 +8,7 @@
8 * Copyright (C) 2006 Silicon Graphics, Inc., 8 * Copyright (C) 2006 Silicon Graphics, Inc.,
9 * Christoph Lameter <christoph@lameter.com> 9 * Christoph Lameter <christoph@lameter.com>
10 */ 10 */
11 11#include <linux/fs.h>
12#include <linux/mm.h> 12#include <linux/mm.h>
13#include <linux/err.h> 13#include <linux/err.h>
14#include <linux/module.h> 14#include <linux/module.h>
@@ -384,7 +384,7 @@ void zone_statistics(struct zone *preferred_zone, struct zone *z)
384#endif 384#endif
385 385
386#ifdef CONFIG_PROC_FS 386#ifdef CONFIG_PROC_FS
387 387#include <linux/proc_fs.h>
388#include <linux/seq_file.h> 388#include <linux/seq_file.h>
389 389
390static char * const migratetype_names[MIGRATE_TYPES] = { 390static char * const migratetype_names[MIGRATE_TYPES] = {
@@ -581,13 +581,25 @@ static int pagetypeinfo_show(struct seq_file *m, void *arg)
581 return 0; 581 return 0;
582} 582}
583 583
584const struct seq_operations fragmentation_op = { 584static const struct seq_operations fragmentation_op = {
585 .start = frag_start, 585 .start = frag_start,
586 .next = frag_next, 586 .next = frag_next,
587 .stop = frag_stop, 587 .stop = frag_stop,
588 .show = frag_show, 588 .show = frag_show,
589}; 589};
590 590
591static int fragmentation_open(struct inode *inode, struct file *file)
592{
593 return seq_open(file, &fragmentation_op);
594}
595
596static const struct file_operations fragmentation_file_operations = {
597 .open = fragmentation_open,
598 .read = seq_read,
599 .llseek = seq_lseek,
600 .release = seq_release,
601};
602
591const struct seq_operations pagetypeinfo_op = { 603const struct seq_operations pagetypeinfo_op = {
592 .start = frag_start, 604 .start = frag_start,
593 .next = frag_next, 605 .next = frag_next,
@@ -898,9 +910,11 @@ static int __cpuinit vmstat_cpuup_callback(struct notifier_block *nfb,
898 910
899static struct notifier_block __cpuinitdata vmstat_notifier = 911static struct notifier_block __cpuinitdata vmstat_notifier =
900 { &vmstat_cpuup_callback, NULL, 0 }; 912 { &vmstat_cpuup_callback, NULL, 0 };
913#endif
901 914
902static int __init setup_vmstat(void) 915static int __init setup_vmstat(void)
903{ 916{
917#ifdef CONFIG_SMP
904 int cpu; 918 int cpu;
905 919
906 refresh_zone_stat_thresholds(); 920 refresh_zone_stat_thresholds();
@@ -908,7 +922,10 @@ static int __init setup_vmstat(void)
908 922
909 for_each_online_cpu(cpu) 923 for_each_online_cpu(cpu)
910 start_cpu_timer(cpu); 924 start_cpu_timer(cpu);
925#endif
926#ifdef CONFIG_PROC_FS
927 proc_create("buddyinfo", S_IRUGO, NULL, &fragmentation_file_operations);
928#endif
911 return 0; 929 return 0;
912} 930}
913module_init(setup_vmstat) 931module_init(setup_vmstat)
914#endif