diff options
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r-- | kernel/sysctl.c | 193 |
1 files changed, 124 insertions, 69 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 98e02328c67d..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,6 +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 | ||
95 | extern int blk_iopoll_enabled; | ||
96 | #endif | ||
94 | 97 | ||
95 | /* Constants used for minimum and maximum */ | 98 | /* Constants used for minimum and maximum */ |
96 | #ifdef CONFIG_DETECT_SOFTLOCKUP | 99 | #ifdef CONFIG_DETECT_SOFTLOCKUP |
@@ -103,6 +106,9 @@ static int __maybe_unused one = 1; | |||
103 | static int __maybe_unused two = 2; | 106 | static int __maybe_unused two = 2; |
104 | static unsigned long one_ul = 1; | 107 | static unsigned long one_ul = 1; |
105 | static int one_hundred = 100; | 108 | static int one_hundred = 100; |
109 | #ifdef CONFIG_PRINTK | ||
110 | static int ten_thousand = 10000; | ||
111 | #endif | ||
106 | 112 | ||
107 | /* 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 */ |
108 | static unsigned long dirty_bytes_min = 2 * PAGE_SIZE; | 114 | static unsigned long dirty_bytes_min = 2 * PAGE_SIZE; |
@@ -157,9 +163,9 @@ extern int max_lock_depth; | |||
157 | #endif | 163 | #endif |
158 | 164 | ||
159 | #ifdef CONFIG_PROC_SYSCTL | 165 | #ifdef CONFIG_PROC_SYSCTL |
160 | 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, |
161 | void __user *buffer, size_t *lenp, loff_t *ppos); | 167 | void __user *buffer, size_t *lenp, loff_t *ppos); |
162 | static int proc_taint(struct ctl_table *table, int write, struct file *filp, | 168 | static int proc_taint(struct ctl_table *table, int write, |
163 | void __user *buffer, size_t *lenp, loff_t *ppos); | 169 | void __user *buffer, size_t *lenp, loff_t *ppos); |
164 | #endif | 170 | #endif |
165 | 171 | ||
@@ -245,6 +251,14 @@ static int max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */ | |||
245 | #endif | 251 | #endif |
246 | 252 | ||
247 | 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 | }, | ||
248 | #ifdef CONFIG_SCHED_DEBUG | 262 | #ifdef CONFIG_SCHED_DEBUG |
249 | { | 263 | { |
250 | .ctl_name = CTL_UNNUMBERED, | 264 | .ctl_name = CTL_UNNUMBERED, |
@@ -299,14 +313,6 @@ static struct ctl_table kern_table[] = { | |||
299 | }, | 313 | }, |
300 | { | 314 | { |
301 | .ctl_name = CTL_UNNUMBERED, | 315 | .ctl_name = CTL_UNNUMBERED, |
302 | .procname = "sched_child_runs_first", | ||
303 | .data = &sysctl_sched_child_runs_first, | ||
304 | .maxlen = sizeof(unsigned int), | ||
305 | .mode = 0644, | ||
306 | .proc_handler = &proc_dointvec, | ||
307 | }, | ||
308 | { | ||
309 | .ctl_name = CTL_UNNUMBERED, | ||
310 | .procname = "sched_features", | 316 | .procname = "sched_features", |
311 | .data = &sysctl_sched_features, | 317 | .data = &sysctl_sched_features, |
312 | .maxlen = sizeof(unsigned int), | 318 | .maxlen = sizeof(unsigned int), |
@@ -331,6 +337,14 @@ static struct ctl_table kern_table[] = { | |||
331 | }, | 337 | }, |
332 | { | 338 | { |
333 | .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, | ||
334 | .procname = "timer_migration", | 348 | .procname = "timer_migration", |
335 | .data = &sysctl_timer_migration, | 349 | .data = &sysctl_timer_migration, |
336 | .maxlen = sizeof(unsigned int), | 350 | .maxlen = sizeof(unsigned int), |
@@ -410,6 +424,14 @@ static struct ctl_table kern_table[] = { | |||
410 | .proc_handler = &proc_dostring, | 424 | .proc_handler = &proc_dostring, |
411 | .strategy = &sysctl_string, | 425 | .strategy = &sysctl_string, |
412 | }, | 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 | }, | ||
413 | #ifdef CONFIG_PROC_SYSCTL | 435 | #ifdef CONFIG_PROC_SYSCTL |
414 | { | 436 | { |
415 | .procname = "tainted", | 437 | .procname = "tainted", |
@@ -711,6 +733,17 @@ static struct ctl_table kern_table[] = { | |||
711 | .mode = 0644, | 733 | .mode = 0644, |
712 | .proc_handler = &proc_dointvec, | 734 | .proc_handler = &proc_dointvec, |
713 | }, | 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 | }, | ||
714 | #endif | 747 | #endif |
715 | { | 748 | { |
716 | .ctl_name = KERN_NGROUPS_MAX, | 749 | .ctl_name = KERN_NGROUPS_MAX, |
@@ -953,28 +986,28 @@ static struct ctl_table kern_table[] = { | |||
953 | .child = slow_work_sysctls, | 986 | .child = slow_work_sysctls, |
954 | }, | 987 | }, |
955 | #endif | 988 | #endif |
956 | #ifdef CONFIG_PERF_COUNTERS | 989 | #ifdef CONFIG_PERF_EVENTS |
957 | { | 990 | { |
958 | .ctl_name = CTL_UNNUMBERED, | 991 | .ctl_name = CTL_UNNUMBERED, |
959 | .procname = "perf_counter_paranoid", | 992 | .procname = "perf_event_paranoid", |
960 | .data = &sysctl_perf_counter_paranoid, | 993 | .data = &sysctl_perf_event_paranoid, |
961 | .maxlen = sizeof(sysctl_perf_counter_paranoid), | 994 | .maxlen = sizeof(sysctl_perf_event_paranoid), |
962 | .mode = 0644, | 995 | .mode = 0644, |
963 | .proc_handler = &proc_dointvec, | 996 | .proc_handler = &proc_dointvec, |
964 | }, | 997 | }, |
965 | { | 998 | { |
966 | .ctl_name = CTL_UNNUMBERED, | 999 | .ctl_name = CTL_UNNUMBERED, |
967 | .procname = "perf_counter_mlock_kb", | 1000 | .procname = "perf_event_mlock_kb", |
968 | .data = &sysctl_perf_counter_mlock, | 1001 | .data = &sysctl_perf_event_mlock, |
969 | .maxlen = sizeof(sysctl_perf_counter_mlock), | 1002 | .maxlen = sizeof(sysctl_perf_event_mlock), |
970 | .mode = 0644, | 1003 | .mode = 0644, |
971 | .proc_handler = &proc_dointvec, | 1004 | .proc_handler = &proc_dointvec, |
972 | }, | 1005 | }, |
973 | { | 1006 | { |
974 | .ctl_name = CTL_UNNUMBERED, | 1007 | .ctl_name = CTL_UNNUMBERED, |
975 | .procname = "perf_counter_max_sample_rate", | 1008 | .procname = "perf_event_max_sample_rate", |
976 | .data = &sysctl_perf_counter_sample_rate, | 1009 | .data = &sysctl_perf_event_sample_rate, |
977 | .maxlen = sizeof(sysctl_perf_counter_sample_rate), | 1010 | .maxlen = sizeof(sysctl_perf_event_sample_rate), |
978 | .mode = 0644, | 1011 | .mode = 0644, |
979 | .proc_handler = &proc_dointvec, | 1012 | .proc_handler = &proc_dointvec, |
980 | }, | 1013 | }, |
@@ -989,7 +1022,16 @@ static struct ctl_table kern_table[] = { | |||
989 | .proc_handler = &proc_dointvec, | 1022 | .proc_handler = &proc_dointvec, |
990 | }, | 1023 | }, |
991 | #endif | 1024 | #endif |
992 | 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 | ||
993 | /* | 1035 | /* |
994 | * 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 |
995 | * Documentation/sysctl/ctl_unnumbered.txt | 1037 | * Documentation/sysctl/ctl_unnumbered.txt |
@@ -1306,10 +1348,10 @@ static struct ctl_table vm_table[] = { | |||
1306 | { | 1348 | { |
1307 | .ctl_name = CTL_UNNUMBERED, | 1349 | .ctl_name = CTL_UNNUMBERED, |
1308 | .procname = "mmap_min_addr", | 1350 | .procname = "mmap_min_addr", |
1309 | .data = &mmap_min_addr, | 1351 | .data = &dac_mmap_min_addr, |
1310 | .maxlen = sizeof(unsigned long), | 1352 | .maxlen = sizeof(unsigned long), |
1311 | .mode = 0644, | 1353 | .mode = 0644, |
1312 | .proc_handler = &proc_doulongvec_minmax, | 1354 | .proc_handler = &mmap_min_addr_handler, |
1313 | }, | 1355 | }, |
1314 | #ifdef CONFIG_NUMA | 1356 | #ifdef CONFIG_NUMA |
1315 | { | 1357 | { |
@@ -1356,6 +1398,31 @@ static struct ctl_table vm_table[] = { | |||
1356 | .mode = 0644, | 1398 | .mode = 0644, |
1357 | .proc_handler = &scan_unevictable_handler, | 1399 | .proc_handler = &scan_unevictable_handler, |
1358 | }, | 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 | |||
1359 | /* | 1426 | /* |
1360 | * 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 |
1361 | * Documentation/sysctl/ctl_unnumbered.txt | 1428 | * Documentation/sysctl/ctl_unnumbered.txt |
@@ -2184,7 +2251,7 @@ void sysctl_head_put(struct ctl_table_header *head) | |||
2184 | #ifdef CONFIG_PROC_SYSCTL | 2251 | #ifdef CONFIG_PROC_SYSCTL |
2185 | 2252 | ||
2186 | static int _proc_do_string(void* data, int maxlen, int write, | 2253 | static int _proc_do_string(void* data, int maxlen, int write, |
2187 | struct file *filp, void __user *buffer, | 2254 | void __user *buffer, |
2188 | size_t *lenp, loff_t *ppos) | 2255 | size_t *lenp, loff_t *ppos) |
2189 | { | 2256 | { |
2190 | size_t len; | 2257 | size_t len; |
@@ -2245,7 +2312,6 @@ static int _proc_do_string(void* data, int maxlen, int write, | |||
2245 | * proc_dostring - read a string sysctl | 2312 | * proc_dostring - read a string sysctl |
2246 | * @table: the sysctl table | 2313 | * @table: the sysctl table |
2247 | * @write: %TRUE if this is a write to the sysctl file | 2314 | * @write: %TRUE if this is a write to the sysctl file |
2248 | * @filp: the file structure | ||
2249 | * @buffer: the user buffer | 2315 | * @buffer: the user buffer |
2250 | * @lenp: the size of the user buffer | 2316 | * @lenp: the size of the user buffer |
2251 | * @ppos: file position | 2317 | * @ppos: file position |
@@ -2259,10 +2325,10 @@ static int _proc_do_string(void* data, int maxlen, int write, | |||
2259 | * | 2325 | * |
2260 | * Returns 0 on success. | 2326 | * Returns 0 on success. |
2261 | */ | 2327 | */ |
2262 | int proc_dostring(struct ctl_table *table, int write, struct file *filp, | 2328 | int proc_dostring(struct ctl_table *table, int write, |
2263 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2329 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2264 | { | 2330 | { |
2265 | return _proc_do_string(table->data, table->maxlen, write, filp, | 2331 | return _proc_do_string(table->data, table->maxlen, write, |
2266 | buffer, lenp, ppos); | 2332 | buffer, lenp, ppos); |
2267 | } | 2333 | } |
2268 | 2334 | ||
@@ -2287,7 +2353,7 @@ static int do_proc_dointvec_conv(int *negp, unsigned long *lvalp, | |||
2287 | } | 2353 | } |
2288 | 2354 | ||
2289 | 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, |
2290 | int write, struct file *filp, void __user *buffer, | 2356 | int write, void __user *buffer, |
2291 | size_t *lenp, loff_t *ppos, | 2357 | size_t *lenp, loff_t *ppos, |
2292 | int (*conv)(int *negp, unsigned long *lvalp, int *valp, | 2358 | int (*conv)(int *negp, unsigned long *lvalp, int *valp, |
2293 | int write, void *data), | 2359 | int write, void *data), |
@@ -2394,13 +2460,13 @@ static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table, | |||
2394 | #undef TMPBUFLEN | 2460 | #undef TMPBUFLEN |
2395 | } | 2461 | } |
2396 | 2462 | ||
2397 | 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, |
2398 | void __user *buffer, size_t *lenp, loff_t *ppos, | 2464 | void __user *buffer, size_t *lenp, loff_t *ppos, |
2399 | int (*conv)(int *negp, unsigned long *lvalp, int *valp, | 2465 | int (*conv)(int *negp, unsigned long *lvalp, int *valp, |
2400 | int write, void *data), | 2466 | int write, void *data), |
2401 | void *data) | 2467 | void *data) |
2402 | { | 2468 | { |
2403 | return __do_proc_dointvec(table->data, table, write, filp, | 2469 | return __do_proc_dointvec(table->data, table, write, |
2404 | buffer, lenp, ppos, conv, data); | 2470 | buffer, lenp, ppos, conv, data); |
2405 | } | 2471 | } |
2406 | 2472 | ||
@@ -2408,7 +2474,6 @@ static int do_proc_dointvec(struct ctl_table *table, int write, struct file *fil | |||
2408 | * proc_dointvec - read a vector of integers | 2474 | * proc_dointvec - read a vector of integers |
2409 | * @table: the sysctl table | 2475 | * @table: the sysctl table |
2410 | * @write: %TRUE if this is a write to the sysctl file | 2476 | * @write: %TRUE if this is a write to the sysctl file |
2411 | * @filp: the file structure | ||
2412 | * @buffer: the user buffer | 2477 | * @buffer: the user buffer |
2413 | * @lenp: the size of the user buffer | 2478 | * @lenp: the size of the user buffer |
2414 | * @ppos: file position | 2479 | * @ppos: file position |
@@ -2418,10 +2483,10 @@ static int do_proc_dointvec(struct ctl_table *table, int write, struct file *fil | |||
2418 | * | 2483 | * |
2419 | * Returns 0 on success. | 2484 | * Returns 0 on success. |
2420 | */ | 2485 | */ |
2421 | int proc_dointvec(struct ctl_table *table, int write, struct file *filp, | 2486 | int proc_dointvec(struct ctl_table *table, int write, |
2422 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2487 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2423 | { | 2488 | { |
2424 | return do_proc_dointvec(table,write,filp,buffer,lenp,ppos, | 2489 | return do_proc_dointvec(table,write,buffer,lenp,ppos, |
2425 | NULL,NULL); | 2490 | NULL,NULL); |
2426 | } | 2491 | } |
2427 | 2492 | ||
@@ -2429,7 +2494,7 @@ int proc_dointvec(struct ctl_table *table, int write, struct file *filp, | |||
2429 | * Taint values can only be increased | 2494 | * Taint values can only be increased |
2430 | * This means we can safely use a temporary. | 2495 | * This means we can safely use a temporary. |
2431 | */ | 2496 | */ |
2432 | static int proc_taint(struct ctl_table *table, int write, struct file *filp, | 2497 | static int proc_taint(struct ctl_table *table, int write, |
2433 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2498 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2434 | { | 2499 | { |
2435 | struct ctl_table t; | 2500 | struct ctl_table t; |
@@ -2441,7 +2506,7 @@ static int proc_taint(struct ctl_table *table, int write, struct file *filp, | |||
2441 | 2506 | ||
2442 | t = *table; | 2507 | t = *table; |
2443 | t.data = &tmptaint; | 2508 | t.data = &tmptaint; |
2444 | err = proc_doulongvec_minmax(&t, write, filp, buffer, lenp, ppos); | 2509 | err = proc_doulongvec_minmax(&t, write, buffer, lenp, ppos); |
2445 | if (err < 0) | 2510 | if (err < 0) |
2446 | return err; | 2511 | return err; |
2447 | 2512 | ||
@@ -2493,7 +2558,6 @@ static int do_proc_dointvec_minmax_conv(int *negp, unsigned long *lvalp, | |||
2493 | * 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 |
2494 | * @table: the sysctl table | 2559 | * @table: the sysctl table |
2495 | * @write: %TRUE if this is a write to the sysctl file | 2560 | * @write: %TRUE if this is a write to the sysctl file |
2496 | * @filp: the file structure | ||
2497 | * @buffer: the user buffer | 2561 | * @buffer: the user buffer |
2498 | * @lenp: the size of the user buffer | 2562 | * @lenp: the size of the user buffer |
2499 | * @ppos: file position | 2563 | * @ppos: file position |
@@ -2506,19 +2570,18 @@ static int do_proc_dointvec_minmax_conv(int *negp, unsigned long *lvalp, | |||
2506 | * | 2570 | * |
2507 | * Returns 0 on success. | 2571 | * Returns 0 on success. |
2508 | */ | 2572 | */ |
2509 | int proc_dointvec_minmax(struct ctl_table *table, int write, struct file *filp, | 2573 | int proc_dointvec_minmax(struct ctl_table *table, int write, |
2510 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2574 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2511 | { | 2575 | { |
2512 | struct do_proc_dointvec_minmax_conv_param param = { | 2576 | struct do_proc_dointvec_minmax_conv_param param = { |
2513 | .min = (int *) table->extra1, | 2577 | .min = (int *) table->extra1, |
2514 | .max = (int *) table->extra2, | 2578 | .max = (int *) table->extra2, |
2515 | }; | 2579 | }; |
2516 | return do_proc_dointvec(table, write, filp, buffer, lenp, ppos, | 2580 | return do_proc_dointvec(table, write, buffer, lenp, ppos, |
2517 | do_proc_dointvec_minmax_conv, ¶m); | 2581 | do_proc_dointvec_minmax_conv, ¶m); |
2518 | } | 2582 | } |
2519 | 2583 | ||
2520 | 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, |
2521 | struct file *filp, | ||
2522 | void __user *buffer, | 2585 | void __user *buffer, |
2523 | size_t *lenp, loff_t *ppos, | 2586 | size_t *lenp, loff_t *ppos, |
2524 | unsigned long convmul, | 2587 | unsigned long convmul, |
@@ -2623,21 +2686,19 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int | |||
2623 | } | 2686 | } |
2624 | 2687 | ||
2625 | 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, |
2626 | struct file *filp, | ||
2627 | void __user *buffer, | 2689 | void __user *buffer, |
2628 | size_t *lenp, loff_t *ppos, | 2690 | size_t *lenp, loff_t *ppos, |
2629 | unsigned long convmul, | 2691 | unsigned long convmul, |
2630 | unsigned long convdiv) | 2692 | unsigned long convdiv) |
2631 | { | 2693 | { |
2632 | return __do_proc_doulongvec_minmax(table->data, table, write, | 2694 | return __do_proc_doulongvec_minmax(table->data, table, write, |
2633 | filp, buffer, lenp, ppos, convmul, convdiv); | 2695 | buffer, lenp, ppos, convmul, convdiv); |
2634 | } | 2696 | } |
2635 | 2697 | ||
2636 | /** | 2698 | /** |
2637 | * 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 |
2638 | * @table: the sysctl table | 2700 | * @table: the sysctl table |
2639 | * @write: %TRUE if this is a write to the sysctl file | 2701 | * @write: %TRUE if this is a write to the sysctl file |
2640 | * @filp: the file structure | ||
2641 | * @buffer: the user buffer | 2702 | * @buffer: the user buffer |
2642 | * @lenp: the size of the user buffer | 2703 | * @lenp: the size of the user buffer |
2643 | * @ppos: file position | 2704 | * @ppos: file position |
@@ -2650,17 +2711,16 @@ static int do_proc_doulongvec_minmax(struct ctl_table *table, int write, | |||
2650 | * | 2711 | * |
2651 | * Returns 0 on success. | 2712 | * Returns 0 on success. |
2652 | */ | 2713 | */ |
2653 | int proc_doulongvec_minmax(struct ctl_table *table, int write, struct file *filp, | 2714 | int proc_doulongvec_minmax(struct ctl_table *table, int write, |
2654 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2715 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2655 | { | 2716 | { |
2656 | 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); |
2657 | } | 2718 | } |
2658 | 2719 | ||
2659 | /** | 2720 | /** |
2660 | * 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 |
2661 | * @table: the sysctl table | 2722 | * @table: the sysctl table |
2662 | * @write: %TRUE if this is a write to the sysctl file | 2723 | * @write: %TRUE if this is a write to the sysctl file |
2663 | * @filp: the file structure | ||
2664 | * @buffer: the user buffer | 2724 | * @buffer: the user buffer |
2665 | * @lenp: the size of the user buffer | 2725 | * @lenp: the size of the user buffer |
2666 | * @ppos: file position | 2726 | * @ppos: file position |
@@ -2675,11 +2735,10 @@ int proc_doulongvec_minmax(struct ctl_table *table, int write, struct file *filp | |||
2675 | * Returns 0 on success. | 2735 | * Returns 0 on success. |
2676 | */ | 2736 | */ |
2677 | 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, |
2678 | struct file *filp, | ||
2679 | void __user *buffer, | 2738 | void __user *buffer, |
2680 | size_t *lenp, loff_t *ppos) | 2739 | size_t *lenp, loff_t *ppos) |
2681 | { | 2740 | { |
2682 | return do_proc_doulongvec_minmax(table, write, filp, buffer, | 2741 | return do_proc_doulongvec_minmax(table, write, buffer, |
2683 | lenp, ppos, HZ, 1000l); | 2742 | lenp, ppos, HZ, 1000l); |
2684 | } | 2743 | } |
2685 | 2744 | ||
@@ -2755,7 +2814,6 @@ static int do_proc_dointvec_ms_jiffies_conv(int *negp, unsigned long *lvalp, | |||
2755 | * proc_dointvec_jiffies - read a vector of integers as seconds | 2814 | * proc_dointvec_jiffies - read a vector of integers as seconds |
2756 | * @table: the sysctl table | 2815 | * @table: the sysctl table |
2757 | * @write: %TRUE if this is a write to the sysctl file | 2816 | * @write: %TRUE if this is a write to the sysctl file |
2758 | * @filp: the file structure | ||
2759 | * @buffer: the user buffer | 2817 | * @buffer: the user buffer |
2760 | * @lenp: the size of the user buffer | 2818 | * @lenp: the size of the user buffer |
2761 | * @ppos: file position | 2819 | * @ppos: file position |
@@ -2767,10 +2825,10 @@ static int do_proc_dointvec_ms_jiffies_conv(int *negp, unsigned long *lvalp, | |||
2767 | * | 2825 | * |
2768 | * Returns 0 on success. | 2826 | * Returns 0 on success. |
2769 | */ | 2827 | */ |
2770 | int proc_dointvec_jiffies(struct ctl_table *table, int write, struct file *filp, | 2828 | int proc_dointvec_jiffies(struct ctl_table *table, int write, |
2771 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2829 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2772 | { | 2830 | { |
2773 | return do_proc_dointvec(table,write,filp,buffer,lenp,ppos, | 2831 | return do_proc_dointvec(table,write,buffer,lenp,ppos, |
2774 | do_proc_dointvec_jiffies_conv,NULL); | 2832 | do_proc_dointvec_jiffies_conv,NULL); |
2775 | } | 2833 | } |
2776 | 2834 | ||
@@ -2778,7 +2836,6 @@ int proc_dointvec_jiffies(struct ctl_table *table, int write, struct file *filp, | |||
2778 | * 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 |
2779 | * @table: the sysctl table | 2837 | * @table: the sysctl table |
2780 | * @write: %TRUE if this is a write to the sysctl file | 2838 | * @write: %TRUE if this is a write to the sysctl file |
2781 | * @filp: the file structure | ||
2782 | * @buffer: the user buffer | 2839 | * @buffer: the user buffer |
2783 | * @lenp: the size of the user buffer | 2840 | * @lenp: the size of the user buffer |
2784 | * @ppos: pointer to the file position | 2841 | * @ppos: pointer to the file position |
@@ -2790,10 +2847,10 @@ int proc_dointvec_jiffies(struct ctl_table *table, int write, struct file *filp, | |||
2790 | * | 2847 | * |
2791 | * Returns 0 on success. | 2848 | * Returns 0 on success. |
2792 | */ | 2849 | */ |
2793 | 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, |
2794 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2851 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2795 | { | 2852 | { |
2796 | return do_proc_dointvec(table,write,filp,buffer,lenp,ppos, | 2853 | return do_proc_dointvec(table,write,buffer,lenp,ppos, |
2797 | do_proc_dointvec_userhz_jiffies_conv,NULL); | 2854 | do_proc_dointvec_userhz_jiffies_conv,NULL); |
2798 | } | 2855 | } |
2799 | 2856 | ||
@@ -2801,7 +2858,6 @@ int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write, struct file | |||
2801 | * 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 |
2802 | * @table: the sysctl table | 2859 | * @table: the sysctl table |
2803 | * @write: %TRUE if this is a write to the sysctl file | 2860 | * @write: %TRUE if this is a write to the sysctl file |
2804 | * @filp: the file structure | ||
2805 | * @buffer: the user buffer | 2861 | * @buffer: the user buffer |
2806 | * @lenp: the size of the user buffer | 2862 | * @lenp: the size of the user buffer |
2807 | * @ppos: file position | 2863 | * @ppos: file position |
@@ -2814,14 +2870,14 @@ int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write, struct file | |||
2814 | * | 2870 | * |
2815 | * Returns 0 on success. | 2871 | * Returns 0 on success. |
2816 | */ | 2872 | */ |
2817 | 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, |
2818 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2874 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2819 | { | 2875 | { |
2820 | return do_proc_dointvec(table, write, filp, buffer, lenp, ppos, | 2876 | return do_proc_dointvec(table, write, buffer, lenp, ppos, |
2821 | do_proc_dointvec_ms_jiffies_conv, NULL); | 2877 | do_proc_dointvec_ms_jiffies_conv, NULL); |
2822 | } | 2878 | } |
2823 | 2879 | ||
2824 | 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, |
2825 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2881 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2826 | { | 2882 | { |
2827 | struct pid *new_pid; | 2883 | struct pid *new_pid; |
@@ -2830,7 +2886,7 @@ static int proc_do_cad_pid(struct ctl_table *table, int write, struct file *filp | |||
2830 | 2886 | ||
2831 | tmp = pid_vnr(cad_pid); | 2887 | tmp = pid_vnr(cad_pid); |
2832 | 2888 | ||
2833 | r = __do_proc_dointvec(&tmp, table, write, filp, buffer, | 2889 | r = __do_proc_dointvec(&tmp, table, write, buffer, |
2834 | lenp, ppos, NULL, NULL); | 2890 | lenp, ppos, NULL, NULL); |
2835 | if (r || !write) | 2891 | if (r || !write) |
2836 | return r; | 2892 | return r; |
@@ -2845,50 +2901,49 @@ static int proc_do_cad_pid(struct ctl_table *table, int write, struct file *filp | |||
2845 | 2901 | ||
2846 | #else /* CONFIG_PROC_FS */ | 2902 | #else /* CONFIG_PROC_FS */ |
2847 | 2903 | ||
2848 | int proc_dostring(struct ctl_table *table, int write, struct file *filp, | 2904 | int proc_dostring(struct ctl_table *table, int write, |
2849 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2905 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2850 | { | 2906 | { |
2851 | return -ENOSYS; | 2907 | return -ENOSYS; |
2852 | } | 2908 | } |
2853 | 2909 | ||
2854 | int proc_dointvec(struct ctl_table *table, int write, struct file *filp, | 2910 | int proc_dointvec(struct ctl_table *table, int write, |
2855 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2911 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2856 | { | 2912 | { |
2857 | return -ENOSYS; | 2913 | return -ENOSYS; |
2858 | } | 2914 | } |
2859 | 2915 | ||
2860 | int proc_dointvec_minmax(struct ctl_table *table, int write, struct file *filp, | 2916 | int proc_dointvec_minmax(struct ctl_table *table, int write, |
2861 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2917 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2862 | { | 2918 | { |
2863 | return -ENOSYS; | 2919 | return -ENOSYS; |
2864 | } | 2920 | } |
2865 | 2921 | ||
2866 | int proc_dointvec_jiffies(struct ctl_table *table, int write, struct file *filp, | 2922 | int proc_dointvec_jiffies(struct ctl_table *table, int write, |
2867 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2923 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2868 | { | 2924 | { |
2869 | return -ENOSYS; | 2925 | return -ENOSYS; |
2870 | } | 2926 | } |
2871 | 2927 | ||
2872 | 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, |
2873 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2929 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2874 | { | 2930 | { |
2875 | return -ENOSYS; | 2931 | return -ENOSYS; |
2876 | } | 2932 | } |
2877 | 2933 | ||
2878 | 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, |
2879 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2935 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2880 | { | 2936 | { |
2881 | return -ENOSYS; | 2937 | return -ENOSYS; |
2882 | } | 2938 | } |
2883 | 2939 | ||
2884 | int proc_doulongvec_minmax(struct ctl_table *table, int write, struct file *filp, | 2940 | int proc_doulongvec_minmax(struct ctl_table *table, int write, |
2885 | void __user *buffer, size_t *lenp, loff_t *ppos) | 2941 | void __user *buffer, size_t *lenp, loff_t *ppos) |
2886 | { | 2942 | { |
2887 | return -ENOSYS; | 2943 | return -ENOSYS; |
2888 | } | 2944 | } |
2889 | 2945 | ||
2890 | 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, |
2891 | struct file *filp, | ||
2892 | void __user *buffer, | 2947 | void __user *buffer, |
2893 | size_t *lenp, loff_t *ppos) | 2948 | size_t *lenp, loff_t *ppos) |
2894 | { | 2949 | { |