diff options
Diffstat (limited to 'fs/proc/proc_misc.c')
| -rw-r--r-- | fs/proc/proc_misc.c | 66 |
1 files changed, 22 insertions, 44 deletions
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c index 441a32f0e5f2..48bcf20cec2f 100644 --- a/fs/proc/proc_misc.c +++ b/fs/proc/proc_misc.c | |||
| @@ -826,14 +826,6 @@ static struct file_operations proc_kpageflags_operations = { | |||
| 826 | 826 | ||
| 827 | struct proc_dir_entry *proc_root_kcore; | 827 | struct proc_dir_entry *proc_root_kcore; |
| 828 | 828 | ||
| 829 | void create_seq_entry(char *name, mode_t mode, const struct file_operations *f) | ||
| 830 | { | ||
| 831 | struct proc_dir_entry *entry; | ||
| 832 | entry = create_proc_entry(name, mode, NULL); | ||
| 833 | if (entry) | ||
| 834 | entry->proc_fops = f; | ||
| 835 | } | ||
| 836 | |||
| 837 | void __init proc_misc_init(void) | 829 | void __init proc_misc_init(void) |
| 838 | { | 830 | { |
| 839 | static struct { | 831 | static struct { |
| @@ -862,66 +854,52 @@ void __init proc_misc_init(void) | |||
| 862 | 854 | ||
| 863 | /* And now for trickier ones */ | 855 | /* And now for trickier ones */ |
| 864 | #ifdef CONFIG_PRINTK | 856 | #ifdef CONFIG_PRINTK |
| 865 | { | 857 | proc_create("kmsg", S_IRUSR, NULL, &proc_kmsg_operations); |
| 866 | struct proc_dir_entry *entry; | ||
| 867 | entry = create_proc_entry("kmsg", S_IRUSR, &proc_root); | ||
| 868 | if (entry) | ||
| 869 | entry->proc_fops = &proc_kmsg_operations; | ||
| 870 | } | ||
| 871 | #endif | 858 | #endif |
| 872 | create_seq_entry("locks", 0, &proc_locks_operations); | 859 | proc_create("locks", 0, NULL, &proc_locks_operations); |
| 873 | create_seq_entry("devices", 0, &proc_devinfo_operations); | 860 | proc_create("devices", 0, NULL, &proc_devinfo_operations); |
| 874 | create_seq_entry("cpuinfo", 0, &proc_cpuinfo_operations); | 861 | proc_create("cpuinfo", 0, NULL, &proc_cpuinfo_operations); |
| 875 | #ifdef CONFIG_BLOCK | 862 | #ifdef CONFIG_BLOCK |
| 876 | create_seq_entry("partitions", 0, &proc_partitions_operations); | 863 | proc_create("partitions", 0, NULL, &proc_partitions_operations); |
| 877 | #endif | 864 | #endif |
| 878 | create_seq_entry("stat", 0, &proc_stat_operations); | 865 | proc_create("stat", 0, NULL, &proc_stat_operations); |
| 879 | create_seq_entry("interrupts", 0, &proc_interrupts_operations); | 866 | proc_create("interrupts", 0, NULL, &proc_interrupts_operations); |
| 880 | #ifdef CONFIG_SLABINFO | 867 | #ifdef CONFIG_SLABINFO |
| 881 | create_seq_entry("slabinfo",S_IWUSR|S_IRUGO,&proc_slabinfo_operations); | 868 | proc_create("slabinfo",S_IWUSR|S_IRUGO,NULL,&proc_slabinfo_operations); |
| 882 | #ifdef CONFIG_DEBUG_SLAB_LEAK | 869 | #ifdef CONFIG_DEBUG_SLAB_LEAK |
| 883 | create_seq_entry("slab_allocators", 0 ,&proc_slabstats_operations); | 870 | proc_create("slab_allocators", 0, NULL, &proc_slabstats_operations); |
| 884 | #endif | 871 | #endif |
| 885 | #endif | 872 | #endif |
| 886 | #ifdef CONFIG_MMU | 873 | #ifdef CONFIG_MMU |
| 887 | proc_create("vmallocinfo", S_IRUSR, NULL, &proc_vmalloc_operations); | 874 | proc_create("vmallocinfo", S_IRUSR, NULL, &proc_vmalloc_operations); |
| 888 | #endif | 875 | #endif |
| 889 | create_seq_entry("buddyinfo",S_IRUGO, &fragmentation_file_operations); | 876 | proc_create("buddyinfo", S_IRUGO, NULL, &fragmentation_file_operations); |
| 890 | create_seq_entry("pagetypeinfo", S_IRUGO, &pagetypeinfo_file_ops); | 877 | proc_create("pagetypeinfo", S_IRUGO, NULL, &pagetypeinfo_file_ops); |
| 891 | create_seq_entry("vmstat",S_IRUGO, &proc_vmstat_file_operations); | 878 | proc_create("vmstat", S_IRUGO, NULL, &proc_vmstat_file_operations); |
| 892 | create_seq_entry("zoneinfo",S_IRUGO, &proc_zoneinfo_file_operations); | 879 | proc_create("zoneinfo", S_IRUGO, NULL, &proc_zoneinfo_file_operations); |
| 893 | #ifdef CONFIG_BLOCK | 880 | #ifdef CONFIG_BLOCK |
| 894 | create_seq_entry("diskstats", 0, &proc_diskstats_operations); | 881 | proc_create("diskstats", 0, NULL, &proc_diskstats_operations); |
| 895 | #endif | 882 | #endif |
| 896 | #ifdef CONFIG_MODULES | 883 | #ifdef CONFIG_MODULES |
| 897 | create_seq_entry("modules", 0, &proc_modules_operations); | 884 | proc_create("modules", 0, NULL, &proc_modules_operations); |
| 898 | #endif | 885 | #endif |
| 899 | #ifdef CONFIG_SCHEDSTATS | 886 | #ifdef CONFIG_SCHEDSTATS |
| 900 | create_seq_entry("schedstat", 0, &proc_schedstat_operations); | 887 | proc_create("schedstat", 0, NULL, &proc_schedstat_operations); |
| 901 | #endif | 888 | #endif |
| 902 | #ifdef CONFIG_PROC_KCORE | 889 | #ifdef CONFIG_PROC_KCORE |
| 903 | proc_root_kcore = create_proc_entry("kcore", S_IRUSR, NULL); | 890 | proc_root_kcore = proc_create("kcore", S_IRUSR, NULL, &proc_kcore_operations); |
| 904 | if (proc_root_kcore) { | 891 | if (proc_root_kcore) |
| 905 | proc_root_kcore->proc_fops = &proc_kcore_operations; | ||
| 906 | proc_root_kcore->size = | 892 | proc_root_kcore->size = |
| 907 | (size_t)high_memory - PAGE_OFFSET + PAGE_SIZE; | 893 | (size_t)high_memory - PAGE_OFFSET + PAGE_SIZE; |
| 908 | } | ||
| 909 | #endif | 894 | #endif |
| 910 | #ifdef CONFIG_PROC_PAGE_MONITOR | 895 | #ifdef CONFIG_PROC_PAGE_MONITOR |
| 911 | create_seq_entry("kpagecount", S_IRUSR, &proc_kpagecount_operations); | 896 | proc_create("kpagecount", S_IRUSR, NULL, &proc_kpagecount_operations); |
| 912 | create_seq_entry("kpageflags", S_IRUSR, &proc_kpageflags_operations); | 897 | proc_create("kpageflags", S_IRUSR, NULL, &proc_kpageflags_operations); |
| 913 | #endif | 898 | #endif |
| 914 | #ifdef CONFIG_PROC_VMCORE | 899 | #ifdef CONFIG_PROC_VMCORE |
| 915 | proc_vmcore = create_proc_entry("vmcore", S_IRUSR, NULL); | 900 | proc_vmcore = proc_create("vmcore", S_IRUSR, NULL, &proc_vmcore_operations); |
| 916 | if (proc_vmcore) | ||
| 917 | proc_vmcore->proc_fops = &proc_vmcore_operations; | ||
| 918 | #endif | 901 | #endif |
| 919 | #ifdef CONFIG_MAGIC_SYSRQ | 902 | #ifdef CONFIG_MAGIC_SYSRQ |
| 920 | { | 903 | proc_create("sysrq-trigger", S_IWUSR, NULL, &proc_sysrq_trigger_operations); |
| 921 | struct proc_dir_entry *entry; | ||
| 922 | entry = create_proc_entry("sysrq-trigger", S_IWUSR, NULL); | ||
| 923 | if (entry) | ||
| 924 | entry->proc_fops = &proc_sysrq_trigger_operations; | ||
| 925 | } | ||
| 926 | #endif | 904 | #endif |
| 927 | } | 905 | } |
