diff options
Diffstat (limited to 'fs/proc/proc_misc.c')
-rw-r--r-- | fs/proc/proc_misc.c | 68 |
1 files changed, 24 insertions, 44 deletions
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c index 441a32f0e5f2..74a323d2b850 100644 --- a/fs/proc/proc_misc.c +++ b/fs/proc/proc_misc.c | |||
@@ -179,6 +179,7 @@ static int meminfo_read_proc(char *page, char **start, off_t off, | |||
179 | "PageTables: %8lu kB\n" | 179 | "PageTables: %8lu kB\n" |
180 | "NFS_Unstable: %8lu kB\n" | 180 | "NFS_Unstable: %8lu kB\n" |
181 | "Bounce: %8lu kB\n" | 181 | "Bounce: %8lu kB\n" |
182 | "WritebackTmp: %8lu kB\n" | ||
182 | "CommitLimit: %8lu kB\n" | 183 | "CommitLimit: %8lu kB\n" |
183 | "Committed_AS: %8lu kB\n" | 184 | "Committed_AS: %8lu kB\n" |
184 | "VmallocTotal: %8lu kB\n" | 185 | "VmallocTotal: %8lu kB\n" |
@@ -210,6 +211,7 @@ static int meminfo_read_proc(char *page, char **start, off_t off, | |||
210 | K(global_page_state(NR_PAGETABLE)), | 211 | K(global_page_state(NR_PAGETABLE)), |
211 | K(global_page_state(NR_UNSTABLE_NFS)), | 212 | K(global_page_state(NR_UNSTABLE_NFS)), |
212 | K(global_page_state(NR_BOUNCE)), | 213 | K(global_page_state(NR_BOUNCE)), |
214 | K(global_page_state(NR_WRITEBACK_TEMP)), | ||
213 | K(allowed), | 215 | K(allowed), |
214 | K(committed), | 216 | K(committed), |
215 | (unsigned long)VMALLOC_TOTAL >> 10, | 217 | (unsigned long)VMALLOC_TOTAL >> 10, |
@@ -826,14 +828,6 @@ static struct file_operations proc_kpageflags_operations = { | |||
826 | 828 | ||
827 | struct proc_dir_entry *proc_root_kcore; | 829 | struct proc_dir_entry *proc_root_kcore; |
828 | 830 | ||
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) | 831 | void __init proc_misc_init(void) |
838 | { | 832 | { |
839 | static struct { | 833 | static struct { |
@@ -862,66 +856,52 @@ void __init proc_misc_init(void) | |||
862 | 856 | ||
863 | /* And now for trickier ones */ | 857 | /* And now for trickier ones */ |
864 | #ifdef CONFIG_PRINTK | 858 | #ifdef CONFIG_PRINTK |
865 | { | 859 | 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 | 860 | #endif |
872 | create_seq_entry("locks", 0, &proc_locks_operations); | 861 | proc_create("locks", 0, NULL, &proc_locks_operations); |
873 | create_seq_entry("devices", 0, &proc_devinfo_operations); | 862 | proc_create("devices", 0, NULL, &proc_devinfo_operations); |
874 | create_seq_entry("cpuinfo", 0, &proc_cpuinfo_operations); | 863 | proc_create("cpuinfo", 0, NULL, &proc_cpuinfo_operations); |
875 | #ifdef CONFIG_BLOCK | 864 | #ifdef CONFIG_BLOCK |
876 | create_seq_entry("partitions", 0, &proc_partitions_operations); | 865 | proc_create("partitions", 0, NULL, &proc_partitions_operations); |
877 | #endif | 866 | #endif |
878 | create_seq_entry("stat", 0, &proc_stat_operations); | 867 | proc_create("stat", 0, NULL, &proc_stat_operations); |
879 | create_seq_entry("interrupts", 0, &proc_interrupts_operations); | 868 | proc_create("interrupts", 0, NULL, &proc_interrupts_operations); |
880 | #ifdef CONFIG_SLABINFO | 869 | #ifdef CONFIG_SLABINFO |
881 | create_seq_entry("slabinfo",S_IWUSR|S_IRUGO,&proc_slabinfo_operations); | 870 | proc_create("slabinfo",S_IWUSR|S_IRUGO,NULL,&proc_slabinfo_operations); |
882 | #ifdef CONFIG_DEBUG_SLAB_LEAK | 871 | #ifdef CONFIG_DEBUG_SLAB_LEAK |
883 | create_seq_entry("slab_allocators", 0 ,&proc_slabstats_operations); | 872 | proc_create("slab_allocators", 0, NULL, &proc_slabstats_operations); |
884 | #endif | 873 | #endif |
885 | #endif | 874 | #endif |
886 | #ifdef CONFIG_MMU | 875 | #ifdef CONFIG_MMU |
887 | proc_create("vmallocinfo", S_IRUSR, NULL, &proc_vmalloc_operations); | 876 | proc_create("vmallocinfo", S_IRUSR, NULL, &proc_vmalloc_operations); |
888 | #endif | 877 | #endif |
889 | create_seq_entry("buddyinfo",S_IRUGO, &fragmentation_file_operations); | 878 | proc_create("buddyinfo", S_IRUGO, NULL, &fragmentation_file_operations); |
890 | create_seq_entry("pagetypeinfo", S_IRUGO, &pagetypeinfo_file_ops); | 879 | proc_create("pagetypeinfo", S_IRUGO, NULL, &pagetypeinfo_file_ops); |
891 | create_seq_entry("vmstat",S_IRUGO, &proc_vmstat_file_operations); | 880 | proc_create("vmstat", S_IRUGO, NULL, &proc_vmstat_file_operations); |
892 | create_seq_entry("zoneinfo",S_IRUGO, &proc_zoneinfo_file_operations); | 881 | proc_create("zoneinfo", S_IRUGO, NULL, &proc_zoneinfo_file_operations); |
893 | #ifdef CONFIG_BLOCK | 882 | #ifdef CONFIG_BLOCK |
894 | create_seq_entry("diskstats", 0, &proc_diskstats_operations); | 883 | proc_create("diskstats", 0, NULL, &proc_diskstats_operations); |
895 | #endif | 884 | #endif |
896 | #ifdef CONFIG_MODULES | 885 | #ifdef CONFIG_MODULES |
897 | create_seq_entry("modules", 0, &proc_modules_operations); | 886 | proc_create("modules", 0, NULL, &proc_modules_operations); |
898 | #endif | 887 | #endif |
899 | #ifdef CONFIG_SCHEDSTATS | 888 | #ifdef CONFIG_SCHEDSTATS |
900 | create_seq_entry("schedstat", 0, &proc_schedstat_operations); | 889 | proc_create("schedstat", 0, NULL, &proc_schedstat_operations); |
901 | #endif | 890 | #endif |
902 | #ifdef CONFIG_PROC_KCORE | 891 | #ifdef CONFIG_PROC_KCORE |
903 | proc_root_kcore = create_proc_entry("kcore", S_IRUSR, NULL); | 892 | proc_root_kcore = proc_create("kcore", S_IRUSR, NULL, &proc_kcore_operations); |
904 | if (proc_root_kcore) { | 893 | if (proc_root_kcore) |
905 | proc_root_kcore->proc_fops = &proc_kcore_operations; | ||
906 | proc_root_kcore->size = | 894 | proc_root_kcore->size = |
907 | (size_t)high_memory - PAGE_OFFSET + PAGE_SIZE; | 895 | (size_t)high_memory - PAGE_OFFSET + PAGE_SIZE; |
908 | } | ||
909 | #endif | 896 | #endif |
910 | #ifdef CONFIG_PROC_PAGE_MONITOR | 897 | #ifdef CONFIG_PROC_PAGE_MONITOR |
911 | create_seq_entry("kpagecount", S_IRUSR, &proc_kpagecount_operations); | 898 | proc_create("kpagecount", S_IRUSR, NULL, &proc_kpagecount_operations); |
912 | create_seq_entry("kpageflags", S_IRUSR, &proc_kpageflags_operations); | 899 | proc_create("kpageflags", S_IRUSR, NULL, &proc_kpageflags_operations); |
913 | #endif | 900 | #endif |
914 | #ifdef CONFIG_PROC_VMCORE | 901 | #ifdef CONFIG_PROC_VMCORE |
915 | proc_vmcore = create_proc_entry("vmcore", S_IRUSR, NULL); | 902 | 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 | 903 | #endif |
919 | #ifdef CONFIG_MAGIC_SYSRQ | 904 | #ifdef CONFIG_MAGIC_SYSRQ |
920 | { | 905 | 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 | 906 | #endif |
927 | } | 907 | } |