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.c31
1 files changed, 4 insertions, 27 deletions
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index 29e20c6b1f7f..59ea42e1ef03 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -45,7 +45,6 @@
45#include <linux/blkdev.h> 45#include <linux/blkdev.h>
46#include <linux/hugetlb.h> 46#include <linux/hugetlb.h>
47#include <linux/jiffies.h> 47#include <linux/jiffies.h>
48#include <linux/sysrq.h>
49#include <linux/vmalloc.h> 48#include <linux/vmalloc.h>
50#include <linux/crash_dump.h> 49#include <linux/crash_dump.h>
51#include <linux/pid_namespace.h> 50#include <linux/pid_namespace.h>
@@ -68,7 +67,6 @@
68extern int get_hardware_list(char *); 67extern int get_hardware_list(char *);
69extern int get_stram_list(char *); 68extern int get_stram_list(char *);
70extern int get_exec_domain_list(char *); 69extern int get_exec_domain_list(char *);
71extern int get_dma_list(char *);
72 70
73static int proc_calc_metrics(char *page, char **start, off_t off, 71static int proc_calc_metrics(char *page, char **start, off_t off,
74 int count, int *eof, int len) 72 int count, int *eof, int len)
@@ -684,6 +682,7 @@ static int cmdline_read_proc(char *page, char **start, off_t off,
684 return proc_calc_metrics(page, start, off, count, eof, len); 682 return proc_calc_metrics(page, start, off, count, eof, len);
685} 683}
686 684
685#ifdef CONFIG_FILE_LOCKING
687static int locks_open(struct inode *inode, struct file *filp) 686static int locks_open(struct inode *inode, struct file *filp)
688{ 687{
689 return seq_open(filp, &locks_seq_operations); 688 return seq_open(filp, &locks_seq_operations);
@@ -695,6 +694,7 @@ static const struct file_operations proc_locks_operations = {
695 .llseek = seq_lseek, 694 .llseek = seq_lseek,
696 .release = seq_release, 695 .release = seq_release,
697}; 696};
697#endif /* CONFIG_FILE_LOCKING */
698 698
699static int execdomains_read_proc(char *page, char **start, off_t off, 699static int execdomains_read_proc(char *page, char **start, off_t off,
700 int count, int *eof, void *data) 700 int count, int *eof, void *data)
@@ -703,28 +703,6 @@ static int execdomains_read_proc(char *page, char **start, off_t off,
703 return proc_calc_metrics(page, start, off, count, eof, len); 703 return proc_calc_metrics(page, start, off, count, eof, len);
704} 704}
705 705
706#ifdef CONFIG_MAGIC_SYSRQ
707/*
708 * writing 'C' to /proc/sysrq-trigger is like sysrq-C
709 */
710static ssize_t write_sysrq_trigger(struct file *file, const char __user *buf,
711 size_t count, loff_t *ppos)
712{
713 if (count) {
714 char c;
715
716 if (get_user(c, buf))
717 return -EFAULT;
718 __handle_sysrq(c, NULL, 0);
719 }
720 return count;
721}
722
723static const struct file_operations proc_sysrq_trigger_operations = {
724 .write = write_sysrq_trigger,
725};
726#endif
727
728#ifdef CONFIG_PROC_PAGE_MONITOR 706#ifdef CONFIG_PROC_PAGE_MONITOR
729#define KPMSIZE sizeof(u64) 707#define KPMSIZE sizeof(u64)
730#define KPMMASK (KPMSIZE - 1) 708#define KPMMASK (KPMSIZE - 1)
@@ -888,7 +866,9 @@ void __init proc_misc_init(void)
888#ifdef CONFIG_PRINTK 866#ifdef CONFIG_PRINTK
889 proc_create("kmsg", S_IRUSR, NULL, &proc_kmsg_operations); 867 proc_create("kmsg", S_IRUSR, NULL, &proc_kmsg_operations);
890#endif 868#endif
869#ifdef CONFIG_FILE_LOCKING
891 proc_create("locks", 0, NULL, &proc_locks_operations); 870 proc_create("locks", 0, NULL, &proc_locks_operations);
871#endif
892 proc_create("devices", 0, NULL, &proc_devinfo_operations); 872 proc_create("devices", 0, NULL, &proc_devinfo_operations);
893 proc_create("cpuinfo", 0, NULL, &proc_cpuinfo_operations); 873 proc_create("cpuinfo", 0, NULL, &proc_cpuinfo_operations);
894#ifdef CONFIG_BLOCK 874#ifdef CONFIG_BLOCK
@@ -931,7 +911,4 @@ void __init proc_misc_init(void)
931#ifdef CONFIG_PROC_VMCORE 911#ifdef CONFIG_PROC_VMCORE
932 proc_vmcore = proc_create("vmcore", S_IRUSR, NULL, &proc_vmcore_operations); 912 proc_vmcore = proc_create("vmcore", S_IRUSR, NULL, &proc_vmcore_operations);
933#endif 913#endif
934#ifdef CONFIG_MAGIC_SYSRQ
935 proc_create("sysrq-trigger", S_IWUSR, NULL, &proc_sysrq_trigger_operations);
936#endif
937} 914}