diff options
Diffstat (limited to 'kernel/sysctl.c')
| -rw-r--r-- | kernel/sysctl.c | 188 |
1 files changed, 121 insertions, 67 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 58be76017fd0..0d949c517412 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
| @@ -26,7 +26,6 @@ | |||
| 26 | #include <linux/proc_fs.h> | 26 | #include <linux/proc_fs.h> |
| 27 | #include <linux/security.h> | 27 | #include <linux/security.h> |
| 28 | #include <linux/ctype.h> | 28 | #include <linux/ctype.h> |
| 29 | #include <linux/utsname.h> | ||
| 30 | #include <linux/kmemcheck.h> | 29 | #include <linux/kmemcheck.h> |
| 31 | #include <linux/smp_lock.h> | 30 | #include <linux/smp_lock.h> |
| 32 | #include <linux/fs.h> | 31 | #include <linux/fs.h> |
| @@ -49,9 +48,8 @@ | |||
| 49 | #include <linux/acpi.h> | 48 | #include <linux/acpi.h> |
| 50 | #include <linux/reboot.h> | 49 | #include <linux/reboot.h> |
| 51 | #include <linux/ftrace.h> | 50 | #include <linux/ftrace.h> |
| 52 | #include <linux/security.h> | ||
| 53 | #include <linux/slow-work.h> | 51 | #include <linux/slow-work.h> |
| 54 | #include <linux/perf_counter.h> | 52 | #include <linux/perf_event.h> |
| 55 | 53 | ||
| 56 | #include <asm/uaccess.h> | 54 | #include <asm/uaccess.h> |
| 57 | #include <asm/processor.h> | 55 | #include <asm/processor.h> |
| @@ -78,6 +76,7 @@ extern int max_threads; | |||
| 78 | extern int core_uses_pid; | 76 | extern int core_uses_pid; |
| 79 | extern int suid_dumpable; | 77 | extern int suid_dumpable; |
| 80 | extern char core_pattern[]; | 78 | extern char core_pattern[]; |
| 79 | extern unsigned int core_pipe_limit; | ||
| 81 | extern int pid_max; | 80 | extern int pid_max; |
| 82 | extern int min_free_kbytes; | 81 | extern int min_free_kbytes; |
| 83 | extern int pid_max_min, pid_max_max; | 82 | extern int pid_max_min, pid_max_max; |
| @@ -92,6 +91,9 @@ extern int sysctl_nr_trim_pages; | |||
| 92 | #ifdef CONFIG_RCU_TORTURE_TEST | 91 | #ifdef CONFIG_RCU_TORTURE_TEST |
| 93 | extern int rcutorture_runnable; | 92 | extern int rcutorture_runnable; |
| 94 | #endif /* #ifdef CONFIG_RCU_TORTURE_TEST */ | 93 | #endif /* #ifdef CONFIG_RCU_TORTURE_TEST */ |
| 94 | #ifdef CONFIG_BLOCK | ||
| 95 | extern int blk_iopoll_enabled; | ||
| 96 | #endif | ||
| 95 | 97 | ||
| 96 | /* Constants used for minimum and maximum */ | 98 | /* Constants used for minimum and maximum */ |
| 97 | #ifdef CONFIG_DETECT_SOFTLOCKUP | 99 | #ifdef CONFIG_DETECT_SOFTLOCKUP |
| @@ -104,6 +106,9 @@ static int __maybe_unused one = 1; | |||
| 104 | static int __maybe_unused two = 2; | 106 | static int __maybe_unused two = 2; |
| 105 | static unsigned long one_ul = 1; | 107 | static unsigned long one_ul = 1; |
| 106 | static int one_hundred = 100; | 108 | static int one_hundred = 100; |
| 109 | #ifdef CONFIG_PRINTK | ||
| 110 | static int ten_thousand = 10000; | ||
| 111 | #endif | ||
| 107 | 112 | ||
| 108 | /* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */ | 113 | /* this is needed for the proc_doulongvec_minmax of vm_dirty_bytes */ |
| 109 | static unsigned long dirty_bytes_min = 2 * PAGE_SIZE; | 114 | static unsigned long dirty_bytes_min = 2 * PAGE_SIZE; |
| @@ -158,9 +163,9 @@ extern int max_lock_depth; | |||
| 158 | #endif | 163 | #endif |
| 159 | 164 | ||
| 160 | #ifdef CONFIG_PROC_SYSCTL | 165 | #ifdef CONFIG_PROC_SYSCTL |
| 161 | static int proc_do_cad_pid(struct ctl_table *table, int write, struct file *filp, | 166 | static int proc_do_cad_pid(struct ctl_table *table, int write, |
| 162 | void __user *buffer, size_t *lenp, loff_t *ppos); | 167 | void __user *buffer, size_t *lenp, loff_t *ppos); |
| 163 | static int proc_taint(struct ctl_table *table, int write, struct file *filp, | 168 | static int proc_taint(struct ctl_table *table, int write, |
| 164 | void __user *buffer, size_t *lenp, loff_t *ppos); | 169 | void __user *buffer, size_t *lenp, loff_t *ppos); |
| 165 | #endif | 170 | #endif |
| 166 | 171 | ||
| @@ -246,6 +251,14 @@ static int max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */ | |||
| 246 | #endif | 251 | #endif |
| 247 | 252 | ||
| 248 | static struct ctl_table kern_table[] = { | 253 | static struct ctl_table kern_table[] = { |
| 254 | { | ||
| 255 | .ctl_name = CTL_UNNUMBERED, | ||
| 256 | .procname = "sched_child_runs_first", | ||
| 257 | .data = &sysctl_sched_child_runs_first, | ||
| 258 | .maxlen = sizeof(unsigned int), | ||
| 259 | .mode = 0644, | ||
| 260 | .proc_handler = &proc_dointvec, | ||
| 261 | }, | ||
| 249 | #ifdef CONFIG_SCHED_DEBUG | 262 | #ifdef CONFIG_SCHED_DEBUG |
| 250 | { | 263 | { |
| 251 | .ctl_name = CTL_UNNUMBERED, | 264 | .ctl_name = CTL_UNNUMBERED, |
| @@ -300,14 +313,6 @@ static struct ctl_table kern_table[] = { | |||
| 300 | }, | 313 | }, |
| 301 | { | 314 | { |
| 302 | .ctl_name = CTL_UNNUMBERED, | 315 | .ctl_name = CTL_UNNUMBERED, |
| 303 | .procname = "sched_child_runs_first", | ||
| 304 | .data = &sysctl_sched_child_runs_first, | ||
| 305 | .maxlen = sizeof(unsigned int), | ||
| 306 | .mode = 0644, | ||
| 307 | .proc_handler = &proc_dointvec, | ||
| 308 | }, | ||
| 309 | { | ||
| 310 | .ctl_name = CTL_UNNUMBERED, | ||
| 311 | .procname = "sched_features", | 316 | .procname = "sched_features", |
| 312 | .data = &sysctl_sched_features, | 317 | .data = &sysctl_sched_features, |
| 313 | .maxlen = sizeof(unsigned int), | 318 | .maxlen = sizeof(unsigned int), |
| @@ -332,6 +337,14 @@ static struct ctl_table kern_table[] = { | |||
| 332 | }, | 337 | }, |
| 333 | { | 338 | { |
| 334 | .ctl_name = CTL_UNNUMBERED, | 339 | .ctl_name = CTL_UNNUMBERED, |
| 340 | .procname = "sched_time_avg", | ||
| 341 | .data = &sysctl_sched_time_avg, | ||
| 342 | .maxlen = sizeof(unsigned int), | ||
| 343 | .mode = 0644, | ||
| 344 | .proc_handler = &proc_dointvec, | ||
| 345 | }, | ||
| 346 | { | ||
| 347 | .ctl_name = CTL_UNNUMBERED, | ||
| 335 | .procname = "timer_migration", | 348 | .procname = "timer_migration", |
| 336 | .data = &sysctl_timer_migration, | 349 | .data = &sysctl_timer_migration, |
| 337 | .maxlen = sizeof(unsigned int), | 350 | .maxlen = sizeof(unsigned int), |
| @@ -411,6 +424,14 @@ static struct ctl_table kern_table[] = { | |||
| 411 | .proc_handler = &proc_dostring, | 424 | .proc_handler = &proc_dostring, |
| 412 | .strategy = &sysctl_string, | 425 | .strategy = &sysctl_string, |
| 413 | }, | 426 | }, |
| 427 | { | ||
| 428 | .ctl_name = CTL_UNNUMBERED, | ||
| 429 | .procname = "core_pipe_limit", | ||
| 430 | .data = &core_pipe_limit, | ||
| 431 | .maxlen = sizeof(unsigned int), | ||
| 432 | .mode = 0644, | ||
| 433 | .proc_handler = &proc_dointvec, | ||
| 434 | }, | ||
| 414 | #ifdef CONFIG_PROC_SYSCTL | 435 | #ifdef CONFIG_PROC_SYSCTL |
| 415 | { | 436 | { |
| 416 | .procname = "tainted", | 437 | .procname = "tainted", |
| @@ -712,6 +733,17 @@ static struct ctl_table kern_table[] = { | |||
| 712 | .mode = 0644, | 733 | .mode = 0644, |
| 713 | .proc_handler = &proc_dointvec, | 734 | .proc_handler = &proc_dointvec, |
| 714 | }, | 735 | }, |
| 736 | { | ||
| 737 | .ctl_name = CTL_UNNUMBERED, | ||
| 738 | .procname = "printk_delay", | ||
| 739 | .data = &printk_delay_msec, | ||
| 740 | .maxlen = sizeof(int), | ||
| 741 | .mode = 0644, | ||
| 742 | .proc_handler = &proc_dointvec_minmax, | ||
| 743 | .strategy = &sysctl_intvec, | ||
| 744 | .extra1 = &zero, | ||
| 745 | .extra2 = &ten_thousand, | ||
| 746 | }, | ||
| 715 | #endif | 747 | #endif |
| 716 | { | 748 | { |
| 717 | .ctl_name = KERN_NGROUPS_MAX, | 749 | .ctl_name = KERN_NGROUPS_MAX, |
| @@ -954,28 +986,28 @@ static struct ctl_table kern_table[] = { | |||
| 954 | .child = slow_work_sysctls, | 986 | .child = slow_work_sysctls, |
| 955 | }, | 987 | }, |
| 956 | #endif | 988 | #endif |
| 957 | #ifdef CONFIG_PERF_COUNTERS | 989 | #ifdef CONFIG_PERF_EVENTS |
| 958 | { | 990 | { |
| 959 | .ctl_name = CTL_UNNUMBERED, | 991 | .ctl_name = CTL_UNNUMBERED, |
| 960 | .procname = "perf_counter_paranoid", | 992 | .procname = "perf_event_paranoid", |
| 961 | .data = &sysctl_perf_counter_paranoid, | 993 | .data = &sysctl_perf_event_paranoid, |
| 962 | .maxlen = sizeof(sysctl_perf_counter_paranoid), | 994 | .maxlen = sizeof(sysctl_perf_event_paranoid), |
| 963 | .mode = 0644, | 995 | .mode = 0644, |
| 964 | .proc_handler = &proc_dointvec, | 996 | .proc_handler = &proc_dointvec, |
| 965 | }, | 997 | }, |
| 966 | { | 998 | { |
| 967 | .ctl_name = CTL_UNNUMBERED, | 999 | .ctl_name = CTL_UNNUMBERED, |
| 968 | .procname = "perf_counter_mlock_kb", | 1000 | .procname = "perf_event_mlock_kb", |
| 969 | .data = &sysctl_perf_counter_mlock, | 1001 | .data = &sysctl_perf_event_mlock, |
| 970 | .maxlen = sizeof(sysctl_perf_counter_mlock), | 1002 | .maxlen = sizeof(sysctl_perf_event_mlock), |
| 971 | .mode = 0644, | 1003 | .mode = 0644, |
| 972 | .proc_handler = &proc_dointvec, | 1004 | .proc_handler = &proc_dointvec, |
| 973 | }, | 1005 | }, |
| 974 | { | 1006 | { |
| 975 | .ctl_name = CTL_UNNUMBERED, | 1007 | .ctl_name = CTL_UNNUMBERED, |
| 976 | .procname = "perf_counter_max_sample_rate", | 1008 | .procname = "perf_event_max_sample_rate", |
| 977 | .data = &sysctl_perf_counter_sample_rate, | 1009 | .data = &sysctl_perf_event_sample_rate, |
| 978 | .maxlen = sizeof(sysctl_perf_counter_sample_rate), | 1010 | .maxlen = sizeof(sysctl_perf_event_sample_rate), |
| 979 | .mode = 0644, | 1011 | .mode = 0644, |
| 980 | .proc_handler = &proc_dointvec, | 1012 | .proc_handler = &proc_dointvec, |
| 981 | }, | 1013 | }, |
| @@ -990,7 +1022,16 @@ static struct ctl_table kern_table[] = { | |||
| 990 | .proc_handler = &proc_dointvec, | 1022 | .proc_handler = &proc_dointvec, |
| 991 | }, | 1023 | }, |
| 992 | #endif | 1024 | #endif |
| 993 | 1025 | #ifdef CONFIG_BLOCK | |
| 1026 | { | ||
| 1027 | .ctl_name = CTL_UNNUMBERED, | ||
| 1028 | .procname = "blk_iopoll", | ||
| 1029 | .data = &blk_iopoll_enabled, | ||
| 1030 | .maxlen = sizeof(int), | ||
| 1031 | .mode = 0644, | ||
| 1032 | .proc_handler = &proc_dointvec, | ||
| 1033 | }, | ||
| 1034 | #endif | ||
| 994 | /* | 1035 | /* |
| 995 | * NOTE: do not add new entries to this table unless you have read | 1036 | * NOTE: do not add new entries to this table unless you have read |
| 996 | * Documentation/sysctl/ctl_unnumbered.txt | 1037 | * Documentation/sysctl/ctl_unnumbered.txt |
| @@ -1357,6 +1398,31 @@ static struct ctl_table vm_table[] = { | |||
| 1357 | .mode = 0644, | 1398 | .mode = 0644, |
| 1358 | .proc_handler = &scan_unevictable_handler, | 1399 | .proc_handler = &scan_unevictable_handler, |
| 1359 | }, | 1400 | }, |
| 1401 | #ifdef CONFIG_MEMORY_FAILURE | ||
| 1402 | { | ||
| 1403 | .ctl_name = CTL_UNNUMBERED, | ||
| 1404 | .procname = "memory_failure_early_kill", | ||
| 1405 | .data = &sysctl_memory_failure_early_kill, | ||
| 1406 | .maxlen = sizeof(sysctl_memory_failure_early_kill), | ||
| 1407 | .mode = 0644, | ||
| 1408 | .proc_handler = &proc_dointvec_minmax, | ||
| 1409 | .strategy = &sysctl_intvec, | ||
| 1410 | .extra1 = &zero, | ||
| 1411 | .extra2 = &one, | ||
| 1412 | }, | ||
| 1413 | { | ||
| 1414 | .ctl_name = CTL_UNNUMBERED, | ||
| 1415 | .procname = "memory_failure_recovery", | ||
| 1416 | .data = &sysctl_memory_failure_recovery, | ||
| 1417 | .maxlen = sizeof(sysctl_memory_failure_recovery), | ||
| 1418 | .mode = 0644, | ||
| 1419 | .proc_handler = &proc_dointvec_minmax, | ||
| 1420 | .strategy = &sysctl_intvec, | ||
| 1421 | .extra1 = &zero, | ||
| 1422 | .extra2 = &one, | ||
| 1423 | }, | ||
| 1424 | #endif | ||
| 1425 | |||
| 1360 | /* | 1426 | /* |
| 1361 | * NOTE: do not add new entries to this table unless you have read | 1427 | * NOTE: do not add new entries to this table unless you have read |
| 1362 | * Documentation/sysctl/ctl_unnumbered.txt | 1428 | * Documentation/sysctl/ctl_unnumbered.txt |
| @@ -2185,7 +2251,7 @@ void sysctl_head_put(struct ctl_table_header *head) | |||
| 2185 | #ifdef CONFIG_PROC_SYSCTL | 2251 | #ifdef CONFIG_PROC_SYSCTL |
| 2186 | 2252 | ||
| 2187 | static int _proc_do_string(void* data, int maxlen, int write, | 2253 | static int _proc_do_string(void* data, int maxlen, int write, |
| 2188 | struct file *filp, void __user *buffer, | 2254 | void __user *buffer, |
| 2189 | size_t *lenp, loff_t *ppos) | 2255 | size_t *lenp, loff_t *ppos) |
| 2190 | { | 2256 | { |
| 2191 | size_t len; | 2257 | size_t len; |
| @@ -2246,7 +2312,6 @@ static int _proc_do_string(void* data, int maxlen, int write, | |||
| 2246 | * proc_dostring - read a string sysctl | 2312 | * proc_dostring - read a string sysctl |
| 2247 | * @table: the sysctl table | 2313 | * @table: the sysctl table |
| 2248 | * @write: %TRUE if this is a write to the sysctl file | 2314 | * @write: %TRUE if this is a write to the sysctl file |
| 2249 | * @filp: the file structure | ||
| 2250 | * @buffer: the user buffer | 2315 | * @buffer: the user buffer |
| 2251 | * @lenp: the size of the user buffer | 2316 | * @lenp: the size of the user buffer |
| 2252 | * @ppos: file position | 2317 | * @ppos: file position |
| @@ -2260,10 +2325,10 @@ static int _proc_do_string(void* data, int maxlen, int write, | |||
| 2260 | * | 2325 | * |
| 2261 | * Returns 0 on success. | 2326 | * Returns 0 on success. |
| 2262 | */ | 2327 | */ |
| 2263 | int proc_dostring(struct ctl_table *table, int write, struct file *filp, | 2328 | int proc_dostring(struct ctl_table *table, int write, |
| 2264 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2329 | void __user *buffer, size_t *lenp, loff_t *ppos) |
| 2265 | { | 2330 | { |
| 2266 | return _proc_do_string(table->data, table->maxlen, write, filp, | 2331 | return _proc_do_string(table->data, table->maxlen, write, |
| 2267 | buffer, lenp, ppos); | 2332 | buffer, lenp, ppos); |
| 2268 | } | 2333 | } |
| 2269 | 2334 | ||
| @@ -2288,7 +2353,7 @@ static int do_proc_dointvec_conv(int *negp, unsigned long *lvalp, | |||
| 2288 | } | 2353 | } |
| 2289 | 2354 | ||
| 2290 | static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table, | 2355 | static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table, |
| 2291 | int write, struct file *filp, void __user *buffer, | 2356 | int write, void __user *buffer, |
| 2292 | size_t *lenp, loff_t *ppos, | 2357 | size_t *lenp, loff_t *ppos, |
| 2293 | int (*conv)(int *negp, unsigned long *lvalp, int *valp, | 2358 | int (*conv)(int *negp, unsigned long *lvalp, int *valp, |
| 2294 | int write, void *data), | 2359 | int write, void *data), |
| @@ -2395,13 +2460,13 @@ static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table, | |||
| 2395 | #undef TMPBUFLEN | 2460 | #undef TMPBUFLEN |
| 2396 | } | 2461 | } |
| 2397 | 2462 | ||
| 2398 | static int do_proc_dointvec(struct ctl_table *table, int write, struct file *filp, | 2463 | static int do_proc_dointvec(struct ctl_table *table, int write, |
| 2399 | void __user *buffer, size_t *lenp, loff_t *ppos, | 2464 | void __user *buffer, size_t *lenp, loff_t *ppos, |
| 2400 | int (*conv)(int *negp, unsigned long *lvalp, int *valp, | 2465 | int (*conv)(int *negp, unsigned long *lvalp, int *valp, |
| 2401 | int write, void *data), | 2466 | int write, void *data), |
| 2402 | void *data) | 2467 | void *data) |
| 2403 | { | 2468 | { |
| 2404 | return __do_proc_dointvec(table->data, table, write, filp, | 2469 | return __do_proc_dointvec(table->data, table, write, |
| 2405 | buffer, lenp, ppos, conv, data); | 2470 | buffer, lenp, ppos, conv, data); |
| 2406 | } | 2471 | } |
| 2407 | 2472 | ||
| @@ -2409,7 +2474,6 @@ static int do_proc_dointvec(struct ctl_table *table, int write, struct file *fil | |||
| 2409 | * proc_dointvec - read a vector of integers | 2474 | * proc_dointvec - read a vector of integers |
| 2410 | * @table: the sysctl table | 2475 | * @table: the sysctl table |
| 2411 | * @write: %TRUE if this is a write to the sysctl file | 2476 | * @write: %TRUE if this is a write to the sysctl file |
| 2412 | * @filp: the file structure | ||
| 2413 | * @buffer: the user buffer | 2477 | * @buffer: the user buffer |
| 2414 | * @lenp: the size of the user buffer | 2478 | * @lenp: the size of the user buffer |
| 2415 | * @ppos: file position | 2479 | * @ppos: file position |
| @@ -2419,10 +2483,10 @@ static int do_proc_dointvec(struct ctl_table *table, int write, struct file *fil | |||
| 2419 | * | 2483 | * |
| 2420 | * Returns 0 on success. | 2484 | * Returns 0 on success. |
| 2421 | */ | 2485 | */ |
| 2422 | int proc_dointvec(struct ctl_table *table, int write, struct file *filp, | 2486 | int proc_dointvec(struct ctl_table *table, int write, |
| 2423 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2487 | void __user *buffer, size_t *lenp, loff_t *ppos) |
| 2424 | { | 2488 | { |
| 2425 | return do_proc_dointvec(table,write,filp,buffer,lenp,ppos, | 2489 | return do_proc_dointvec(table,write,buffer,lenp,ppos, |
| 2426 | NULL,NULL); | 2490 | NULL,NULL); |
| 2427 | } | 2491 | } |
| 2428 | 2492 | ||
| @@ -2430,7 +2494,7 @@ int proc_dointvec(struct ctl_table *table, int write, struct file *filp, | |||
| 2430 | * Taint values can only be increased | 2494 | * Taint values can only be increased |
| 2431 | * This means we can safely use a temporary. | 2495 | * This means we can safely use a temporary. |
| 2432 | */ | 2496 | */ |
| 2433 | static int proc_taint(struct ctl_table *table, int write, struct file *filp, | 2497 | static int proc_taint(struct ctl_table *table, int write, |
| 2434 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2498 | void __user *buffer, size_t *lenp, loff_t *ppos) |
| 2435 | { | 2499 | { |
| 2436 | struct ctl_table t; | 2500 | struct ctl_table t; |
| @@ -2442,7 +2506,7 @@ static int proc_taint(struct ctl_table *table, int write, struct file *filp, | |||
| 2442 | 2506 | ||
| 2443 | t = *table; | 2507 | t = *table; |
| 2444 | t.data = &tmptaint; | 2508 | t.data = &tmptaint; |
| 2445 | err = proc_doulongvec_minmax(&t, write, filp, buffer, lenp, ppos); | 2509 | err = proc_doulongvec_minmax(&t, write, buffer, lenp, ppos); |
| 2446 | if (err < 0) | 2510 | if (err < 0) |
| 2447 | return err; | 2511 | return err; |
| 2448 | 2512 | ||
| @@ -2494,7 +2558,6 @@ static int do_proc_dointvec_minmax_conv(int *negp, unsigned long *lvalp, | |||
| 2494 | * proc_dointvec_minmax - read a vector of integers with min/max values | 2558 | * proc_dointvec_minmax - read a vector of integers with min/max values |
| 2495 | * @table: the sysctl table | 2559 | * @table: the sysctl table |
| 2496 | * @write: %TRUE if this is a write to the sysctl file | 2560 | * @write: %TRUE if this is a write to the sysctl file |
| 2497 | * @filp: the file structure | ||
| 2498 | * @buffer: the user buffer | 2561 | * @buffer: the user buffer |
| 2499 | * @lenp: the size of the user buffer | 2562 | * @lenp: the size of the user buffer |
| 2500 | * @ppos: file position | 2563 | * @ppos: file position |
| @@ -2507,19 +2570,18 @@ static int do_proc_dointvec_minmax_conv(int *negp, unsigned long *lvalp, | |||
| 2507 | * | 2570 | * |
| 2508 | * Returns 0 on success. | 2571 | * Returns 0 on success. |
| 2509 | */ | 2572 | */ |
| 2510 | int proc_dointvec_minmax(struct ctl_table *table, int write, struct file *filp, | 2573 | int proc_dointvec_minmax(struct ctl_table *table, int write, |
| 2511 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2574 | void __user *buffer, size_t *lenp, loff_t *ppos) |
| 2512 | { | 2575 | { |
| 2513 | struct do_proc_dointvec_minmax_conv_param param = { | 2576 | struct do_proc_dointvec_minmax_conv_param param = { |
| 2514 | .min = (int *) table->extra1, | 2577 | .min = (int *) table->extra1, |
| 2515 | .max = (int *) table->extra2, | 2578 | .max = (int *) table->extra2, |
| 2516 | }; | 2579 | }; |
| 2517 | return do_proc_dointvec(table, write, filp, buffer, lenp, ppos, | 2580 | return do_proc_dointvec(table, write, buffer, lenp, ppos, |
| 2518 | do_proc_dointvec_minmax_conv, ¶m); | 2581 | do_proc_dointvec_minmax_conv, ¶m); |
| 2519 | } | 2582 | } |
| 2520 | 2583 | ||
| 2521 | static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int write, | 2584 | static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int write, |
| 2522 | struct file *filp, | ||
| 2523 | void __user *buffer, | 2585 | void __user *buffer, |
| 2524 | size_t *lenp, loff_t *ppos, | 2586 | size_t *lenp, loff_t *ppos, |
| 2525 | unsigned long convmul, | 2587 | unsigned long convmul, |
| @@ -2624,21 +2686,19 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int | |||
| 2624 | } | 2686 | } |
| 2625 | 2687 | ||
| 2626 | static int do_proc_doulongvec_minmax(struct ctl_table *table, int write, | 2688 | static int do_proc_doulongvec_minmax(struct ctl_table *table, int write, |
| 2627 | struct file *filp, | ||
| 2628 | void __user *buffer, | 2689 | void __user *buffer, |
| 2629 | size_t *lenp, loff_t *ppos, | 2690 | size_t *lenp, loff_t *ppos, |
| 2630 | unsigned long convmul, | 2691 | unsigned long convmul, |
| 2631 | unsigned long convdiv) | 2692 | unsigned long convdiv) |
| 2632 | { | 2693 | { |
| 2633 | return __do_proc_doulongvec_minmax(table->data, table, write, | 2694 | return __do_proc_doulongvec_minmax(table->data, table, write, |
| 2634 | filp, buffer, lenp, ppos, convmul, convdiv); | 2695 | buffer, lenp, ppos, convmul, convdiv); |
| 2635 | } | 2696 | } |
| 2636 | 2697 | ||
| 2637 | /** | 2698 | /** |
| 2638 | * proc_doulongvec_minmax - read a vector of long integers with min/max values | 2699 | * proc_doulongvec_minmax - read a vector of long integers with min/max values |
| 2639 | * @table: the sysctl table | 2700 | * @table: the sysctl table |
| 2640 | * @write: %TRUE if this is a write to the sysctl file | 2701 | * @write: %TRUE if this is a write to the sysctl file |
| 2641 | * @filp: the file structure | ||
| 2642 | * @buffer: the user buffer | 2702 | * @buffer: the user buffer |
| 2643 | * @lenp: the size of the user buffer | 2703 | * @lenp: the size of the user buffer |
| 2644 | * @ppos: file position | 2704 | * @ppos: file position |
| @@ -2651,17 +2711,16 @@ static int do_proc_doulongvec_minmax(struct ctl_table *table, int write, | |||
| 2651 | * | 2711 | * |
| 2652 | * Returns 0 on success. | 2712 | * Returns 0 on success. |
| 2653 | */ | 2713 | */ |
| 2654 | int proc_doulongvec_minmax(struct ctl_table *table, int write, struct file *filp, | 2714 | int proc_doulongvec_minmax(struct ctl_table *table, int write, |
| 2655 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2715 | void __user *buffer, size_t *lenp, loff_t *ppos) |
| 2656 | { | 2716 | { |
| 2657 | return do_proc_doulongvec_minmax(table, write, filp, buffer, lenp, ppos, 1l, 1l); | 2717 | return do_proc_doulongvec_minmax(table, write, buffer, lenp, ppos, 1l, 1l); |
| 2658 | } | 2718 | } |
| 2659 | 2719 | ||
| 2660 | /** | 2720 | /** |
| 2661 | * proc_doulongvec_ms_jiffies_minmax - read a vector of millisecond values with min/max values | 2721 | * proc_doulongvec_ms_jiffies_minmax - read a vector of millisecond values with min/max values |
| 2662 | * @table: the sysctl table | 2722 | * @table: the sysctl table |
| 2663 | * @write: %TRUE if this is a write to the sysctl file | 2723 | * @write: %TRUE if this is a write to the sysctl file |
| 2664 | * @filp: the file structure | ||
| 2665 | * @buffer: the user buffer | 2724 | * @buffer: the user buffer |
| 2666 | * @lenp: the size of the user buffer | 2725 | * @lenp: the size of the user buffer |
| 2667 | * @ppos: file position | 2726 | * @ppos: file position |
| @@ -2676,11 +2735,10 @@ int proc_doulongvec_minmax(struct ctl_table *table, int write, struct file *filp | |||
| 2676 | * Returns 0 on success. | 2735 | * Returns 0 on success. |
| 2677 | */ | 2736 | */ |
| 2678 | int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write, | 2737 | int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write, |
| 2679 | struct file *filp, | ||
| 2680 | void __user *buffer, | 2738 | void __user *buffer, |
| 2681 | size_t *lenp, loff_t *ppos) | 2739 | size_t *lenp, loff_t *ppos) |
| 2682 | { | 2740 | { |
| 2683 | return do_proc_doulongvec_minmax(table, write, filp, buffer, | 2741 | return do_proc_doulongvec_minmax(table, write, buffer, |
| 2684 | lenp, ppos, HZ, 1000l); | 2742 | lenp, ppos, HZ, 1000l); |
| 2685 | } | 2743 | } |
| 2686 | 2744 | ||
| @@ -2756,7 +2814,6 @@ static int do_proc_dointvec_ms_jiffies_conv(int *negp, unsigned long *lvalp, | |||
| 2756 | * proc_dointvec_jiffies - read a vector of integers as seconds | 2814 | * proc_dointvec_jiffies - read a vector of integers as seconds |
| 2757 | * @table: the sysctl table | 2815 | * @table: the sysctl table |
| 2758 | * @write: %TRUE if this is a write to the sysctl file | 2816 | * @write: %TRUE if this is a write to the sysctl file |
| 2759 | * @filp: the file structure | ||
| 2760 | * @buffer: the user buffer | 2817 | * @buffer: the user buffer |
| 2761 | * @lenp: the size of the user buffer | 2818 | * @lenp: the size of the user buffer |
| 2762 | * @ppos: file position | 2819 | * @ppos: file position |
| @@ -2768,10 +2825,10 @@ static int do_proc_dointvec_ms_jiffies_conv(int *negp, unsigned long *lvalp, | |||
| 2768 | * | 2825 | * |
| 2769 | * Returns 0 on success. | 2826 | * Returns 0 on success. |
| 2770 | */ | 2827 | */ |
| 2771 | int proc_dointvec_jiffies(struct ctl_table *table, int write, struct file *filp, | 2828 | int proc_dointvec_jiffies(struct ctl_table *table, int write, |
| 2772 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2829 | void __user *buffer, size_t *lenp, loff_t *ppos) |
| 2773 | { | 2830 | { |
| 2774 | return do_proc_dointvec(table,write,filp,buffer,lenp,ppos, | 2831 | return do_proc_dointvec(table,write,buffer,lenp,ppos, |
| 2775 | do_proc_dointvec_jiffies_conv,NULL); | 2832 | do_proc_dointvec_jiffies_conv,NULL); |
| 2776 | } | 2833 | } |
| 2777 | 2834 | ||
| @@ -2779,7 +2836,6 @@ int proc_dointvec_jiffies(struct ctl_table *table, int write, struct file *filp, | |||
| 2779 | * proc_dointvec_userhz_jiffies - read a vector of integers as 1/USER_HZ seconds | 2836 | * proc_dointvec_userhz_jiffies - read a vector of integers as 1/USER_HZ seconds |
| 2780 | * @table: the sysctl table | 2837 | * @table: the sysctl table |
| 2781 | * @write: %TRUE if this is a write to the sysctl file | 2838 | * @write: %TRUE if this is a write to the sysctl file |
| 2782 | * @filp: the file structure | ||
| 2783 | * @buffer: the user buffer | 2839 | * @buffer: the user buffer |
| 2784 | * @lenp: the size of the user buffer | 2840 | * @lenp: the size of the user buffer |
| 2785 | * @ppos: pointer to the file position | 2841 | * @ppos: pointer to the file position |
| @@ -2791,10 +2847,10 @@ int proc_dointvec_jiffies(struct ctl_table *table, int write, struct file *filp, | |||
| 2791 | * | 2847 | * |
| 2792 | * Returns 0 on success. | 2848 | * Returns 0 on success. |
| 2793 | */ | 2849 | */ |
| 2794 | int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write, struct file *filp, | 2850 | int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write, |
| 2795 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2851 | void __user *buffer, size_t *lenp, loff_t *ppos) |
| 2796 | { | 2852 | { |
| 2797 | return do_proc_dointvec(table,write,filp,buffer,lenp,ppos, | 2853 | return do_proc_dointvec(table,write,buffer,lenp,ppos, |
| 2798 | do_proc_dointvec_userhz_jiffies_conv,NULL); | 2854 | do_proc_dointvec_userhz_jiffies_conv,NULL); |
| 2799 | } | 2855 | } |
| 2800 | 2856 | ||
| @@ -2802,7 +2858,6 @@ int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write, struct file | |||
| 2802 | * proc_dointvec_ms_jiffies - read a vector of integers as 1 milliseconds | 2858 | * proc_dointvec_ms_jiffies - read a vector of integers as 1 milliseconds |
| 2803 | * @table: the sysctl table | 2859 | * @table: the sysctl table |
| 2804 | * @write: %TRUE if this is a write to the sysctl file | 2860 | * @write: %TRUE if this is a write to the sysctl file |
| 2805 | * @filp: the file structure | ||
| 2806 | * @buffer: the user buffer | 2861 | * @buffer: the user buffer |
| 2807 | * @lenp: the size of the user buffer | 2862 | * @lenp: the size of the user buffer |
| 2808 | * @ppos: file position | 2863 | * @ppos: file position |
| @@ -2815,14 +2870,14 @@ int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write, struct file | |||
| 2815 | * | 2870 | * |
| 2816 | * Returns 0 on success. | 2871 | * Returns 0 on success. |
| 2817 | */ | 2872 | */ |
| 2818 | int proc_dointvec_ms_jiffies(struct ctl_table *table, int write, struct file *filp, | 2873 | int proc_dointvec_ms_jiffies(struct ctl_table *table, int write, |
| 2819 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2874 | void __user *buffer, size_t *lenp, loff_t *ppos) |
| 2820 | { | 2875 | { |
| 2821 | return do_proc_dointvec(table, write, filp, buffer, lenp, ppos, | 2876 | return do_proc_dointvec(table, write, buffer, lenp, ppos, |
| 2822 | do_proc_dointvec_ms_jiffies_conv, NULL); | 2877 | do_proc_dointvec_ms_jiffies_conv, NULL); |
| 2823 | } | 2878 | } |
| 2824 | 2879 | ||
| 2825 | static int proc_do_cad_pid(struct ctl_table *table, int write, struct file *filp, | 2880 | static int proc_do_cad_pid(struct ctl_table *table, int write, |
| 2826 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2881 | void __user *buffer, size_t *lenp, loff_t *ppos) |
| 2827 | { | 2882 | { |
| 2828 | struct pid *new_pid; | 2883 | struct pid *new_pid; |
| @@ -2831,7 +2886,7 @@ static int proc_do_cad_pid(struct ctl_table *table, int write, struct file *filp | |||
| 2831 | 2886 | ||
| 2832 | tmp = pid_vnr(cad_pid); | 2887 | tmp = pid_vnr(cad_pid); |
| 2833 | 2888 | ||
| 2834 | r = __do_proc_dointvec(&tmp, table, write, filp, buffer, | 2889 | r = __do_proc_dointvec(&tmp, table, write, buffer, |
| 2835 | lenp, ppos, NULL, NULL); | 2890 | lenp, ppos, NULL, NULL); |
| 2836 | if (r || !write) | 2891 | if (r || !write) |
| 2837 | return r; | 2892 | return r; |
| @@ -2846,50 +2901,49 @@ static int proc_do_cad_pid(struct ctl_table *table, int write, struct file *filp | |||
| 2846 | 2901 | ||
| 2847 | #else /* CONFIG_PROC_FS */ | 2902 | #else /* CONFIG_PROC_FS */ |
| 2848 | 2903 | ||
| 2849 | int proc_dostring(struct ctl_table *table, int write, struct file *filp, | 2904 | int proc_dostring(struct ctl_table *table, int write, |
| 2850 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2905 | void __user *buffer, size_t *lenp, loff_t *ppos) |
| 2851 | { | 2906 | { |
| 2852 | return -ENOSYS; | 2907 | return -ENOSYS; |
| 2853 | } | 2908 | } |
| 2854 | 2909 | ||
| 2855 | int proc_dointvec(struct ctl_table *table, int write, struct file *filp, | 2910 | int proc_dointvec(struct ctl_table *table, int write, |
| 2856 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2911 | void __user *buffer, size_t *lenp, loff_t *ppos) |
| 2857 | { | 2912 | { |
| 2858 | return -ENOSYS; | 2913 | return -ENOSYS; |
| 2859 | } | 2914 | } |
| 2860 | 2915 | ||
| 2861 | int proc_dointvec_minmax(struct ctl_table *table, int write, struct file *filp, | 2916 | int proc_dointvec_minmax(struct ctl_table *table, int write, |
| 2862 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2917 | void __user *buffer, size_t *lenp, loff_t *ppos) |
| 2863 | { | 2918 | { |
| 2864 | return -ENOSYS; | 2919 | return -ENOSYS; |
| 2865 | } | 2920 | } |
| 2866 | 2921 | ||
| 2867 | int proc_dointvec_jiffies(struct ctl_table *table, int write, struct file *filp, | 2922 | int proc_dointvec_jiffies(struct ctl_table *table, int write, |
| 2868 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2923 | void __user *buffer, size_t *lenp, loff_t *ppos) |
| 2869 | { | 2924 | { |
| 2870 | return -ENOSYS; | 2925 | return -ENOSYS; |
| 2871 | } | 2926 | } |
| 2872 | 2927 | ||
| 2873 | int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write, struct file *filp, | 2928 | int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write, |
| 2874 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2929 | void __user *buffer, size_t *lenp, loff_t *ppos) |
| 2875 | { | 2930 | { |
| 2876 | return -ENOSYS; | 2931 | return -ENOSYS; |
| 2877 | } | 2932 | } |
| 2878 | 2933 | ||
| 2879 | int proc_dointvec_ms_jiffies(struct ctl_table *table, int write, struct file *filp, | 2934 | int proc_dointvec_ms_jiffies(struct ctl_table *table, int write, |
| 2880 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2935 | void __user *buffer, size_t *lenp, loff_t *ppos) |
| 2881 | { | 2936 | { |
| 2882 | return -ENOSYS; | 2937 | return -ENOSYS; |
| 2883 | } | 2938 | } |
| 2884 | 2939 | ||
| 2885 | int proc_doulongvec_minmax(struct ctl_table *table, int write, struct file *filp, | 2940 | int proc_doulongvec_minmax(struct ctl_table *table, int write, |
| 2886 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2941 | void __user *buffer, size_t *lenp, loff_t *ppos) |
| 2887 | { | 2942 | { |
| 2888 | return -ENOSYS; | 2943 | return -ENOSYS; |
| 2889 | } | 2944 | } |
| 2890 | 2945 | ||
| 2891 | int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write, | 2946 | int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write, |
| 2892 | struct file *filp, | ||
| 2893 | void __user *buffer, | 2947 | void __user *buffer, |
| 2894 | size_t *lenp, loff_t *ppos) | 2948 | size_t *lenp, loff_t *ppos) |
| 2895 | { | 2949 | { |
