diff options
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r-- | kernel/sysctl.c | 153 |
1 files changed, 96 insertions, 57 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 6bb59f707402..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> |
@@ -50,7 +49,7 @@ | |||
50 | #include <linux/reboot.h> | 49 | #include <linux/reboot.h> |
51 | #include <linux/ftrace.h> | 50 | #include <linux/ftrace.h> |
52 | #include <linux/slow-work.h> | 51 | #include <linux/slow-work.h> |
53 | #include <linux/perf_counter.h> | 52 | #include <linux/perf_event.h> |
54 | 53 | ||
55 | #include <asm/uaccess.h> | 54 | #include <asm/uaccess.h> |
56 | #include <asm/processor.h> | 55 | #include <asm/processor.h> |
@@ -77,6 +76,7 @@ extern int max_threads; | |||
77 | extern int core_uses_pid; | 76 | extern int core_uses_pid; |
78 | extern int suid_dumpable; | 77 | extern int suid_dumpable; |
79 | extern char core_pattern[]; | 78 | extern char core_pattern[]; |
79 | extern unsigned int core_pipe_limit; | ||
80 | extern int pid_max; | 80 | extern int pid_max; |
81 | extern int min_free_kbytes; | 81 | extern int min_free_kbytes; |
82 | extern int pid_max_min, pid_max_max; | 82 | extern int pid_max_min, pid_max_max; |
@@ -91,7 +91,9 @@ extern int sysctl_nr_trim_pages; | |||
91 | #ifdef CONFIG_RCU_TORTURE_TEST | 91 | #ifdef CONFIG_RCU_TORTURE_TEST |
92 | extern int rcutorture_runnable; | 92 | extern int rcutorture_runnable; |
93 | #endif /* #ifdef CONFIG_RCU_TORTURE_TEST */ | 93 | #endif /* #ifdef CONFIG_RCU_TORTURE_TEST */ |
94 | #ifdef CONFIG_BLOCK | ||
94 | extern int blk_iopoll_enabled; | 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 | ||
@@ -419,6 +424,14 @@ static struct ctl_table kern_table[] = { | |||
419 | .proc_handler = &proc_dostring, | 424 | .proc_handler = &proc_dostring, |
420 | .strategy = &sysctl_string, | 425 | .strategy = &sysctl_string, |
421 | }, | 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 | }, | ||
422 | #ifdef CONFIG_PROC_SYSCTL | 435 | #ifdef CONFIG_PROC_SYSCTL |
423 | { | 436 | { |
424 | .procname = "tainted", | 437 | .procname = "tainted", |
@@ -720,6 +733,17 @@ static struct ctl_table kern_table[] = { | |||
720 | .mode = 0644, | 733 | .mode = 0644, |
721 | .proc_handler = &proc_dointvec, | 734 | .proc_handler = &proc_dointvec, |
722 | }, | 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 | }, | ||
723 | #endif | 747 | #endif |
724 | { | 748 | { |
725 | .ctl_name = KERN_NGROUPS_MAX, | 749 | .ctl_name = KERN_NGROUPS_MAX, |
@@ -962,28 +986,28 @@ static struct ctl_table kern_table[] = { | |||
962 | .child = slow_work_sysctls, | 986 | .child = slow_work_sysctls, |
963 | }, | 987 | }, |
964 | #endif | 988 | #endif |
965 | #ifdef CONFIG_PERF_COUNTERS | 989 | #ifdef CONFIG_PERF_EVENTS |
966 | { | 990 | { |
967 | .ctl_name = CTL_UNNUMBERED, | 991 | .ctl_name = CTL_UNNUMBERED, |
968 | .procname = "perf_counter_paranoid", | 992 | .procname = "perf_event_paranoid", |
969 | .data = &sysctl_perf_counter_paranoid, | 993 | .data = &sysctl_perf_event_paranoid, |
970 | .maxlen = sizeof(sysctl_perf_counter_paranoid), | 994 | .maxlen = sizeof(sysctl_perf_event_paranoid), |
971 | .mode = 0644, | 995 | .mode = 0644, |
972 | .proc_handler = &proc_dointvec, | 996 | .proc_handler = &proc_dointvec, |
973 | }, | 997 | }, |
974 | { | 998 | { |
975 | .ctl_name = CTL_UNNUMBERED, | 999 | .ctl_name = CTL_UNNUMBERED, |
976 | .procname = "perf_counter_mlock_kb", | 1000 | .procname = "perf_event_mlock_kb", |
977 | .data = &sysctl_perf_counter_mlock, | 1001 | .data = &sysctl_perf_event_mlock, |
978 | .maxlen = sizeof(sysctl_perf_counter_mlock), | 1002 | .maxlen = sizeof(sysctl_perf_event_mlock), |
979 | .mode = 0644, | 1003 | .mode = 0644, |
980 | .proc_handler = &proc_dointvec, | 1004 | .proc_handler = &proc_dointvec, |
981 | }, | 1005 | }, |
982 | { | 1006 | { |
983 | .ctl_name = CTL_UNNUMBERED, | 1007 | .ctl_name = CTL_UNNUMBERED, |
984 | .procname = "perf_counter_max_sample_rate", | 1008 | .procname = "perf_event_max_sample_rate", |
985 | .data = &sysctl_perf_counter_sample_rate, | 1009 | .data = &sysctl_perf_event_sample_rate, |
986 | .maxlen = sizeof(sysctl_perf_counter_sample_rate), | 1010 | .maxlen = sizeof(sysctl_perf_event_sample_rate), |
987 | .mode = 0644, | 1011 | .mode = 0644, |
988 | .proc_handler = &proc_dointvec, | 1012 | .proc_handler = &proc_dointvec, |
989 | }, | 1013 | }, |
@@ -998,6 +1022,7 @@ static struct ctl_table kern_table[] = { | |||
998 | .proc_handler = &proc_dointvec, | 1022 | .proc_handler = &proc_dointvec, |
999 | }, | 1023 | }, |
1000 | #endif | 1024 | #endif |
1025 | #ifdef CONFIG_BLOCK | ||
1001 | { | 1026 | { |
1002 | .ctl_name = CTL_UNNUMBERED, | 1027 | .ctl_name = CTL_UNNUMBERED, |
1003 | .procname = "blk_iopoll", | 1028 | .procname = "blk_iopoll", |
@@ -1006,6 +1031,7 @@ static struct ctl_table kern_table[] = { | |||
1006 | .mode = 0644, | 1031 | .mode = 0644, |
1007 | .proc_handler = &proc_dointvec, | 1032 | .proc_handler = &proc_dointvec, |
1008 | }, | 1033 | }, |
1034 | #endif | ||
1009 | /* | 1035 | /* |
1010 | * 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 |
1011 | * Documentation/sysctl/ctl_unnumbered.txt | 1037 | * Documentation/sysctl/ctl_unnumbered.txt |
@@ -1372,6 +1398,31 @@ static struct ctl_table vm_table[] = { | |||
1372 | .mode = 0644, | 1398 | .mode = 0644, |
1373 | .proc_handler = &scan_unevictable_handler, | 1399 | .proc_handler = &scan_unevictable_handler, |
1374 | }, | 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 | |||
1375 | /* | 1426 | /* |
1376 | * 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 |
1377 | * Documentation/sysctl/ctl_unnumbered.txt | 1428 | * Documentation/sysctl/ctl_unnumbered.txt |
@@ -2200,7 +2251,7 @@ void sysctl_head_put(struct ctl_table_header *head) | |||
2200 | #ifdef CONFIG_PROC_SYSCTL | 2251 | #ifdef CONFIG_PROC_SYSCTL |
2201 | 2252 | ||
2202 | static int _proc_do_string(void* data, int maxlen, int write, | 2253 | static int _proc_do_string(void* data, int maxlen, int write, |
2203 | struct file *filp, void __user *buffer, | 2254 | void __user *buffer, |
2204 | size_t *lenp, loff_t *ppos) | 2255 | size_t *lenp, loff_t *ppos) |
2205 | { | 2256 | { |
2206 | size_t len; | 2257 | size_t len; |
@@ -2261,7 +2312,6 @@ static int _proc_do_string(void* data, int maxlen, int write, | |||
2261 | * proc_dostring - read a string sysctl | 2312 | * proc_dostring - read a string sysctl |
2262 | * @table: the sysctl table | 2313 | * @table: the sysctl table |
2263 | * @write: %TRUE if this is a write to the sysctl file | 2314 | * @write: %TRUE if this is a write to the sysctl file |
2264 | * @filp: the file structure | ||
2265 | * @buffer: the user buffer | 2315 | * @buffer: the user buffer |
2266 | * @lenp: the size of the user buffer | 2316 | * @lenp: the size of the user buffer |
2267 | * @ppos: file position | 2317 | * @ppos: file position |
@@ -2275,10 +2325,10 @@ static int _proc_do_string(void* data, int maxlen, int write, | |||
2275 | * | 2325 | * |
2276 | * Returns 0 on success. | 2326 | * Returns 0 on success. |
2277 | */ | 2327 | */ |
2278 | int proc_dostring(struct ctl_table *table, int write, struct file *filp, | 2328 | int proc_dostring(struct ctl_table *table, int write, |
2279 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2329 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2280 | { | 2330 | { |
2281 | return _proc_do_string(table->data, table->maxlen, write, filp, | 2331 | return _proc_do_string(table->data, table->maxlen, write, |
2282 | buffer, lenp, ppos); | 2332 | buffer, lenp, ppos); |
2283 | } | 2333 | } |
2284 | 2334 | ||
@@ -2303,7 +2353,7 @@ static int do_proc_dointvec_conv(int *negp, unsigned long *lvalp, | |||
2303 | } | 2353 | } |
2304 | 2354 | ||
2305 | 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, |
2306 | int write, struct file *filp, void __user *buffer, | 2356 | int write, void __user *buffer, |
2307 | size_t *lenp, loff_t *ppos, | 2357 | size_t *lenp, loff_t *ppos, |
2308 | int (*conv)(int *negp, unsigned long *lvalp, int *valp, | 2358 | int (*conv)(int *negp, unsigned long *lvalp, int *valp, |
2309 | int write, void *data), | 2359 | int write, void *data), |
@@ -2410,13 +2460,13 @@ static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table, | |||
2410 | #undef TMPBUFLEN | 2460 | #undef TMPBUFLEN |
2411 | } | 2461 | } |
2412 | 2462 | ||
2413 | 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, |
2414 | void __user *buffer, size_t *lenp, loff_t *ppos, | 2464 | void __user *buffer, size_t *lenp, loff_t *ppos, |
2415 | int (*conv)(int *negp, unsigned long *lvalp, int *valp, | 2465 | int (*conv)(int *negp, unsigned long *lvalp, int *valp, |
2416 | int write, void *data), | 2466 | int write, void *data), |
2417 | void *data) | 2467 | void *data) |
2418 | { | 2468 | { |
2419 | return __do_proc_dointvec(table->data, table, write, filp, | 2469 | return __do_proc_dointvec(table->data, table, write, |
2420 | buffer, lenp, ppos, conv, data); | 2470 | buffer, lenp, ppos, conv, data); |
2421 | } | 2471 | } |
2422 | 2472 | ||
@@ -2424,7 +2474,6 @@ static int do_proc_dointvec(struct ctl_table *table, int write, struct file *fil | |||
2424 | * proc_dointvec - read a vector of integers | 2474 | * proc_dointvec - read a vector of integers |
2425 | * @table: the sysctl table | 2475 | * @table: the sysctl table |
2426 | * @write: %TRUE if this is a write to the sysctl file | 2476 | * @write: %TRUE if this is a write to the sysctl file |
2427 | * @filp: the file structure | ||
2428 | * @buffer: the user buffer | 2477 | * @buffer: the user buffer |
2429 | * @lenp: the size of the user buffer | 2478 | * @lenp: the size of the user buffer |
2430 | * @ppos: file position | 2479 | * @ppos: file position |
@@ -2434,10 +2483,10 @@ static int do_proc_dointvec(struct ctl_table *table, int write, struct file *fil | |||
2434 | * | 2483 | * |
2435 | * Returns 0 on success. | 2484 | * Returns 0 on success. |
2436 | */ | 2485 | */ |
2437 | int proc_dointvec(struct ctl_table *table, int write, struct file *filp, | 2486 | int proc_dointvec(struct ctl_table *table, int write, |
2438 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2487 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2439 | { | 2488 | { |
2440 | return do_proc_dointvec(table,write,filp,buffer,lenp,ppos, | 2489 | return do_proc_dointvec(table,write,buffer,lenp,ppos, |
2441 | NULL,NULL); | 2490 | NULL,NULL); |
2442 | } | 2491 | } |
2443 | 2492 | ||
@@ -2445,7 +2494,7 @@ int proc_dointvec(struct ctl_table *table, int write, struct file *filp, | |||
2445 | * Taint values can only be increased | 2494 | * Taint values can only be increased |
2446 | * This means we can safely use a temporary. | 2495 | * This means we can safely use a temporary. |
2447 | */ | 2496 | */ |
2448 | static int proc_taint(struct ctl_table *table, int write, struct file *filp, | 2497 | static int proc_taint(struct ctl_table *table, int write, |
2449 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2498 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2450 | { | 2499 | { |
2451 | struct ctl_table t; | 2500 | struct ctl_table t; |
@@ -2457,7 +2506,7 @@ static int proc_taint(struct ctl_table *table, int write, struct file *filp, | |||
2457 | 2506 | ||
2458 | t = *table; | 2507 | t = *table; |
2459 | t.data = &tmptaint; | 2508 | t.data = &tmptaint; |
2460 | err = proc_doulongvec_minmax(&t, write, filp, buffer, lenp, ppos); | 2509 | err = proc_doulongvec_minmax(&t, write, buffer, lenp, ppos); |
2461 | if (err < 0) | 2510 | if (err < 0) |
2462 | return err; | 2511 | return err; |
2463 | 2512 | ||
@@ -2509,7 +2558,6 @@ static int do_proc_dointvec_minmax_conv(int *negp, unsigned long *lvalp, | |||
2509 | * 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 |
2510 | * @table: the sysctl table | 2559 | * @table: the sysctl table |
2511 | * @write: %TRUE if this is a write to the sysctl file | 2560 | * @write: %TRUE if this is a write to the sysctl file |
2512 | * @filp: the file structure | ||
2513 | * @buffer: the user buffer | 2561 | * @buffer: the user buffer |
2514 | * @lenp: the size of the user buffer | 2562 | * @lenp: the size of the user buffer |
2515 | * @ppos: file position | 2563 | * @ppos: file position |
@@ -2522,19 +2570,18 @@ static int do_proc_dointvec_minmax_conv(int *negp, unsigned long *lvalp, | |||
2522 | * | 2570 | * |
2523 | * Returns 0 on success. | 2571 | * Returns 0 on success. |
2524 | */ | 2572 | */ |
2525 | int proc_dointvec_minmax(struct ctl_table *table, int write, struct file *filp, | 2573 | int proc_dointvec_minmax(struct ctl_table *table, int write, |
2526 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2574 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2527 | { | 2575 | { |
2528 | struct do_proc_dointvec_minmax_conv_param param = { | 2576 | struct do_proc_dointvec_minmax_conv_param param = { |
2529 | .min = (int *) table->extra1, | 2577 | .min = (int *) table->extra1, |
2530 | .max = (int *) table->extra2, | 2578 | .max = (int *) table->extra2, |
2531 | }; | 2579 | }; |
2532 | return do_proc_dointvec(table, write, filp, buffer, lenp, ppos, | 2580 | return do_proc_dointvec(table, write, buffer, lenp, ppos, |
2533 | do_proc_dointvec_minmax_conv, ¶m); | 2581 | do_proc_dointvec_minmax_conv, ¶m); |
2534 | } | 2582 | } |
2535 | 2583 | ||
2536 | 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, |
2537 | struct file *filp, | ||
2538 | void __user *buffer, | 2585 | void __user *buffer, |
2539 | size_t *lenp, loff_t *ppos, | 2586 | size_t *lenp, loff_t *ppos, |
2540 | unsigned long convmul, | 2587 | unsigned long convmul, |
@@ -2639,21 +2686,19 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int | |||
2639 | } | 2686 | } |
2640 | 2687 | ||
2641 | 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, |
2642 | struct file *filp, | ||
2643 | void __user *buffer, | 2689 | void __user *buffer, |
2644 | size_t *lenp, loff_t *ppos, | 2690 | size_t *lenp, loff_t *ppos, |
2645 | unsigned long convmul, | 2691 | unsigned long convmul, |
2646 | unsigned long convdiv) | 2692 | unsigned long convdiv) |
2647 | { | 2693 | { |
2648 | return __do_proc_doulongvec_minmax(table->data, table, write, | 2694 | return __do_proc_doulongvec_minmax(table->data, table, write, |
2649 | filp, buffer, lenp, ppos, convmul, convdiv); | 2695 | buffer, lenp, ppos, convmul, convdiv); |
2650 | } | 2696 | } |
2651 | 2697 | ||
2652 | /** | 2698 | /** |
2653 | * 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 |
2654 | * @table: the sysctl table | 2700 | * @table: the sysctl table |
2655 | * @write: %TRUE if this is a write to the sysctl file | 2701 | * @write: %TRUE if this is a write to the sysctl file |
2656 | * @filp: the file structure | ||
2657 | * @buffer: the user buffer | 2702 | * @buffer: the user buffer |
2658 | * @lenp: the size of the user buffer | 2703 | * @lenp: the size of the user buffer |
2659 | * @ppos: file position | 2704 | * @ppos: file position |
@@ -2666,17 +2711,16 @@ static int do_proc_doulongvec_minmax(struct ctl_table *table, int write, | |||
2666 | * | 2711 | * |
2667 | * Returns 0 on success. | 2712 | * Returns 0 on success. |
2668 | */ | 2713 | */ |
2669 | int proc_doulongvec_minmax(struct ctl_table *table, int write, struct file *filp, | 2714 | int proc_doulongvec_minmax(struct ctl_table *table, int write, |
2670 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2715 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2671 | { | 2716 | { |
2672 | 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); |
2673 | } | 2718 | } |
2674 | 2719 | ||
2675 | /** | 2720 | /** |
2676 | * 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 |
2677 | * @table: the sysctl table | 2722 | * @table: the sysctl table |
2678 | * @write: %TRUE if this is a write to the sysctl file | 2723 | * @write: %TRUE if this is a write to the sysctl file |
2679 | * @filp: the file structure | ||
2680 | * @buffer: the user buffer | 2724 | * @buffer: the user buffer |
2681 | * @lenp: the size of the user buffer | 2725 | * @lenp: the size of the user buffer |
2682 | * @ppos: file position | 2726 | * @ppos: file position |
@@ -2691,11 +2735,10 @@ int proc_doulongvec_minmax(struct ctl_table *table, int write, struct file *filp | |||
2691 | * Returns 0 on success. | 2735 | * Returns 0 on success. |
2692 | */ | 2736 | */ |
2693 | 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, |
2694 | struct file *filp, | ||
2695 | void __user *buffer, | 2738 | void __user *buffer, |
2696 | size_t *lenp, loff_t *ppos) | 2739 | size_t *lenp, loff_t *ppos) |
2697 | { | 2740 | { |
2698 | return do_proc_doulongvec_minmax(table, write, filp, buffer, | 2741 | return do_proc_doulongvec_minmax(table, write, buffer, |
2699 | lenp, ppos, HZ, 1000l); | 2742 | lenp, ppos, HZ, 1000l); |
2700 | } | 2743 | } |
2701 | 2744 | ||
@@ -2771,7 +2814,6 @@ static int do_proc_dointvec_ms_jiffies_conv(int *negp, unsigned long *lvalp, | |||
2771 | * proc_dointvec_jiffies - read a vector of integers as seconds | 2814 | * proc_dointvec_jiffies - read a vector of integers as seconds |
2772 | * @table: the sysctl table | 2815 | * @table: the sysctl table |
2773 | * @write: %TRUE if this is a write to the sysctl file | 2816 | * @write: %TRUE if this is a write to the sysctl file |
2774 | * @filp: the file structure | ||
2775 | * @buffer: the user buffer | 2817 | * @buffer: the user buffer |
2776 | * @lenp: the size of the user buffer | 2818 | * @lenp: the size of the user buffer |
2777 | * @ppos: file position | 2819 | * @ppos: file position |
@@ -2783,10 +2825,10 @@ static int do_proc_dointvec_ms_jiffies_conv(int *negp, unsigned long *lvalp, | |||
2783 | * | 2825 | * |
2784 | * Returns 0 on success. | 2826 | * Returns 0 on success. |
2785 | */ | 2827 | */ |
2786 | int proc_dointvec_jiffies(struct ctl_table *table, int write, struct file *filp, | 2828 | int proc_dointvec_jiffies(struct ctl_table *table, int write, |
2787 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2829 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2788 | { | 2830 | { |
2789 | return do_proc_dointvec(table,write,filp,buffer,lenp,ppos, | 2831 | return do_proc_dointvec(table,write,buffer,lenp,ppos, |
2790 | do_proc_dointvec_jiffies_conv,NULL); | 2832 | do_proc_dointvec_jiffies_conv,NULL); |
2791 | } | 2833 | } |
2792 | 2834 | ||
@@ -2794,7 +2836,6 @@ int proc_dointvec_jiffies(struct ctl_table *table, int write, struct file *filp, | |||
2794 | * 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 |
2795 | * @table: the sysctl table | 2837 | * @table: the sysctl table |
2796 | * @write: %TRUE if this is a write to the sysctl file | 2838 | * @write: %TRUE if this is a write to the sysctl file |
2797 | * @filp: the file structure | ||
2798 | * @buffer: the user buffer | 2839 | * @buffer: the user buffer |
2799 | * @lenp: the size of the user buffer | 2840 | * @lenp: the size of the user buffer |
2800 | * @ppos: pointer to the file position | 2841 | * @ppos: pointer to the file position |
@@ -2806,10 +2847,10 @@ int proc_dointvec_jiffies(struct ctl_table *table, int write, struct file *filp, | |||
2806 | * | 2847 | * |
2807 | * Returns 0 on success. | 2848 | * Returns 0 on success. |
2808 | */ | 2849 | */ |
2809 | 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, |
2810 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2851 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2811 | { | 2852 | { |
2812 | return do_proc_dointvec(table,write,filp,buffer,lenp,ppos, | 2853 | return do_proc_dointvec(table,write,buffer,lenp,ppos, |
2813 | do_proc_dointvec_userhz_jiffies_conv,NULL); | 2854 | do_proc_dointvec_userhz_jiffies_conv,NULL); |
2814 | } | 2855 | } |
2815 | 2856 | ||
@@ -2817,7 +2858,6 @@ int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write, struct file | |||
2817 | * 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 |
2818 | * @table: the sysctl table | 2859 | * @table: the sysctl table |
2819 | * @write: %TRUE if this is a write to the sysctl file | 2860 | * @write: %TRUE if this is a write to the sysctl file |
2820 | * @filp: the file structure | ||
2821 | * @buffer: the user buffer | 2861 | * @buffer: the user buffer |
2822 | * @lenp: the size of the user buffer | 2862 | * @lenp: the size of the user buffer |
2823 | * @ppos: file position | 2863 | * @ppos: file position |
@@ -2830,14 +2870,14 @@ int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write, struct file | |||
2830 | * | 2870 | * |
2831 | * Returns 0 on success. | 2871 | * Returns 0 on success. |
2832 | */ | 2872 | */ |
2833 | 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, |
2834 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2874 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2835 | { | 2875 | { |
2836 | return do_proc_dointvec(table, write, filp, buffer, lenp, ppos, | 2876 | return do_proc_dointvec(table, write, buffer, lenp, ppos, |
2837 | do_proc_dointvec_ms_jiffies_conv, NULL); | 2877 | do_proc_dointvec_ms_jiffies_conv, NULL); |
2838 | } | 2878 | } |
2839 | 2879 | ||
2840 | 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, |
2841 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2881 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2842 | { | 2882 | { |
2843 | struct pid *new_pid; | 2883 | struct pid *new_pid; |
@@ -2846,7 +2886,7 @@ static int proc_do_cad_pid(struct ctl_table *table, int write, struct file *filp | |||
2846 | 2886 | ||
2847 | tmp = pid_vnr(cad_pid); | 2887 | tmp = pid_vnr(cad_pid); |
2848 | 2888 | ||
2849 | r = __do_proc_dointvec(&tmp, table, write, filp, buffer, | 2889 | r = __do_proc_dointvec(&tmp, table, write, buffer, |
2850 | lenp, ppos, NULL, NULL); | 2890 | lenp, ppos, NULL, NULL); |
2851 | if (r || !write) | 2891 | if (r || !write) |
2852 | return r; | 2892 | return r; |
@@ -2861,50 +2901,49 @@ static int proc_do_cad_pid(struct ctl_table *table, int write, struct file *filp | |||
2861 | 2901 | ||
2862 | #else /* CONFIG_PROC_FS */ | 2902 | #else /* CONFIG_PROC_FS */ |
2863 | 2903 | ||
2864 | int proc_dostring(struct ctl_table *table, int write, struct file *filp, | 2904 | int proc_dostring(struct ctl_table *table, int write, |
2865 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2905 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2866 | { | 2906 | { |
2867 | return -ENOSYS; | 2907 | return -ENOSYS; |
2868 | } | 2908 | } |
2869 | 2909 | ||
2870 | int proc_dointvec(struct ctl_table *table, int write, struct file *filp, | 2910 | int proc_dointvec(struct ctl_table *table, int write, |
2871 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2911 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2872 | { | 2912 | { |
2873 | return -ENOSYS; | 2913 | return -ENOSYS; |
2874 | } | 2914 | } |
2875 | 2915 | ||
2876 | int proc_dointvec_minmax(struct ctl_table *table, int write, struct file *filp, | 2916 | int proc_dointvec_minmax(struct ctl_table *table, int write, |
2877 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2917 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2878 | { | 2918 | { |
2879 | return -ENOSYS; | 2919 | return -ENOSYS; |
2880 | } | 2920 | } |
2881 | 2921 | ||
2882 | int proc_dointvec_jiffies(struct ctl_table *table, int write, struct file *filp, | 2922 | int proc_dointvec_jiffies(struct ctl_table *table, int write, |
2883 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2923 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2884 | { | 2924 | { |
2885 | return -ENOSYS; | 2925 | return -ENOSYS; |
2886 | } | 2926 | } |
2887 | 2927 | ||
2888 | 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, |
2889 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2929 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2890 | { | 2930 | { |
2891 | return -ENOSYS; | 2931 | return -ENOSYS; |
2892 | } | 2932 | } |
2893 | 2933 | ||
2894 | 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, |
2895 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2935 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2896 | { | 2936 | { |
2897 | return -ENOSYS; | 2937 | return -ENOSYS; |
2898 | } | 2938 | } |
2899 | 2939 | ||
2900 | int proc_doulongvec_minmax(struct ctl_table *table, int write, struct file *filp, | 2940 | int proc_doulongvec_minmax(struct ctl_table *table, int write, |
2901 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2941 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2902 | { | 2942 | { |
2903 | return -ENOSYS; | 2943 | return -ENOSYS; |
2904 | } | 2944 | } |
2905 | 2945 | ||
2906 | 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, |
2907 | struct file *filp, | ||
2908 | void __user *buffer, | 2947 | void __user *buffer, |
2909 | size_t *lenp, loff_t *ppos) | 2948 | size_t *lenp, loff_t *ppos) |
2910 | { | 2949 | { |