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.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index a60a3b3d8a7b..a3453555a94e 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -44,6 +44,7 @@
44#include <linux/jiffies.h> 44#include <linux/jiffies.h>
45#include <linux/sysrq.h> 45#include <linux/sysrq.h>
46#include <linux/vmalloc.h> 46#include <linux/vmalloc.h>
47#include <linux/crash_dump.h>
47#include <asm/uaccess.h> 48#include <asm/uaccess.h>
48#include <asm/pgtable.h> 49#include <asm/pgtable.h>
49#include <asm/io.h> 50#include <asm/io.h>
@@ -219,6 +220,19 @@ static struct file_operations fragmentation_file_operations = {
219 .release = seq_release, 220 .release = seq_release,
220}; 221};
221 222
223extern struct seq_operations zoneinfo_op;
224static int zoneinfo_open(struct inode *inode, struct file *file)
225{
226 return seq_open(file, &zoneinfo_op);
227}
228
229static struct file_operations proc_zoneinfo_file_operations = {
230 .open = zoneinfo_open,
231 .read = seq_read,
232 .llseek = seq_lseek,
233 .release = seq_release,
234};
235
222static int version_read_proc(char *page, char **start, off_t off, 236static int version_read_proc(char *page, char **start, off_t off,
223 int count, int *eof, void *data) 237 int count, int *eof, void *data)
224{ 238{
@@ -438,7 +452,7 @@ static int devices_read_proc(char *page, char **start, off_t off,
438 int count, int *eof, void *data) 452 int count, int *eof, void *data)
439{ 453{
440 int len = get_chrdev_list(page); 454 int len = get_chrdev_list(page);
441 len += get_blkdev_list(page+len); 455 len += get_blkdev_list(page+len, len);
442 return proc_calc_metrics(page, start, off, count, eof, len); 456 return proc_calc_metrics(page, start, off, count, eof, len);
443} 457}
444 458
@@ -589,6 +603,7 @@ void __init proc_misc_init(void)
589 create_seq_entry("slabinfo",S_IWUSR|S_IRUGO,&proc_slabinfo_operations); 603 create_seq_entry("slabinfo",S_IWUSR|S_IRUGO,&proc_slabinfo_operations);
590 create_seq_entry("buddyinfo",S_IRUGO, &fragmentation_file_operations); 604 create_seq_entry("buddyinfo",S_IRUGO, &fragmentation_file_operations);
591 create_seq_entry("vmstat",S_IRUGO, &proc_vmstat_file_operations); 605 create_seq_entry("vmstat",S_IRUGO, &proc_vmstat_file_operations);
606 create_seq_entry("zoneinfo",S_IRUGO, &proc_zoneinfo_file_operations);
592 create_seq_entry("diskstats", 0, &proc_diskstats_operations); 607 create_seq_entry("diskstats", 0, &proc_diskstats_operations);
593#ifdef CONFIG_MODULES 608#ifdef CONFIG_MODULES
594 create_seq_entry("modules", 0, &proc_modules_operations); 609 create_seq_entry("modules", 0, &proc_modules_operations);
@@ -604,6 +619,11 @@ void __init proc_misc_init(void)
604 (size_t)high_memory - PAGE_OFFSET + PAGE_SIZE; 619 (size_t)high_memory - PAGE_OFFSET + PAGE_SIZE;
605 } 620 }
606#endif 621#endif
622#ifdef CONFIG_PROC_VMCORE
623 proc_vmcore = create_proc_entry("vmcore", S_IRUSR, NULL);
624 if (proc_vmcore)
625 proc_vmcore->proc_fops = &proc_vmcore_operations;
626#endif
607#ifdef CONFIG_MAGIC_SYSRQ 627#ifdef CONFIG_MAGIC_SYSRQ
608 entry = create_proc_entry("sysrq-trigger", S_IWUSR, NULL); 628 entry = create_proc_entry("sysrq-trigger", S_IWUSR, NULL);
609 if (entry) 629 if (entry)