aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/proc_misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc/proc_misc.c')
-rw-r--r--fs/proc/proc_misc.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index b37ce33f67ea..5e2d4359c292 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -121,16 +121,11 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
121{ 121{
122 struct sysinfo i; 122 struct sysinfo i;
123 int len; 123 int len;
124 unsigned long inactive;
125 unsigned long active;
126 unsigned long free;
127 unsigned long committed; 124 unsigned long committed;
128 unsigned long allowed; 125 unsigned long allowed;
129 struct vmalloc_info vmi; 126 struct vmalloc_info vmi;
130 long cached; 127 long cached;
131 128
132 get_zone_counts(&active, &inactive, &free);
133
134/* 129/*
135 * display in kilobytes. 130 * display in kilobytes.
136 */ 131 */
@@ -187,8 +182,8 @@ static int meminfo_read_proc(char *page, char **start, off_t off,
187 K(i.bufferram), 182 K(i.bufferram),
188 K(cached), 183 K(cached),
189 K(total_swapcache_pages), 184 K(total_swapcache_pages),
190 K(active), 185 K(global_page_state(NR_ACTIVE)),
191 K(inactive), 186 K(global_page_state(NR_INACTIVE)),
192#ifdef CONFIG_HIGHMEM 187#ifdef CONFIG_HIGHMEM
193 K(i.totalhigh), 188 K(i.totalhigh),
194 K(i.freehigh), 189 K(i.freehigh),
@@ -672,7 +667,6 @@ void create_seq_entry(char *name, mode_t mode, const struct file_operations *f)
672 667
673void __init proc_misc_init(void) 668void __init proc_misc_init(void)
674{ 669{
675 struct proc_dir_entry *entry;
676 static struct { 670 static struct {
677 char *name; 671 char *name;
678 int (*read_proc)(char*,char**,off_t,int,int*,void*); 672 int (*read_proc)(char*,char**,off_t,int,int*,void*);
@@ -700,9 +694,12 @@ void __init proc_misc_init(void)
700 694
701 /* And now for trickier ones */ 695 /* And now for trickier ones */
702#ifdef CONFIG_PRINTK 696#ifdef CONFIG_PRINTK
703 entry = create_proc_entry("kmsg", S_IRUSR, &proc_root); 697 {
704 if (entry) 698 struct proc_dir_entry *entry;
705 entry->proc_fops = &proc_kmsg_operations; 699 entry = create_proc_entry("kmsg", S_IRUSR, &proc_root);
700 if (entry)
701 entry->proc_fops = &proc_kmsg_operations;
702 }
706#endif 703#endif
707 create_seq_entry("devices", 0, &proc_devinfo_operations); 704 create_seq_entry("devices", 0, &proc_devinfo_operations);
708 create_seq_entry("cpuinfo", 0, &proc_cpuinfo_operations); 705 create_seq_entry("cpuinfo", 0, &proc_cpuinfo_operations);
@@ -743,8 +740,11 @@ void __init proc_misc_init(void)
743 proc_vmcore->proc_fops = &proc_vmcore_operations; 740 proc_vmcore->proc_fops = &proc_vmcore_operations;
744#endif 741#endif
745#ifdef CONFIG_MAGIC_SYSRQ 742#ifdef CONFIG_MAGIC_SYSRQ
746 entry = create_proc_entry("sysrq-trigger", S_IWUSR, NULL); 743 {
747 if (entry) 744 struct proc_dir_entry *entry;
748 entry->proc_fops = &proc_sysrq_trigger_operations; 745 entry = create_proc_entry("sysrq-trigger", S_IWUSR, NULL);
746 if (entry)
747 entry->proc_fops = &proc_sysrq_trigger_operations;
748 }
749#endif 749#endif
750} 750}