aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sysctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r--kernel/sysctl.c206
1 files changed, 136 insertions, 70 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 62e4ff9968b5..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;
77extern int core_uses_pid; 76extern int core_uses_pid;
78extern int suid_dumpable; 77extern int suid_dumpable;
79extern char core_pattern[]; 78extern char core_pattern[];
79extern unsigned int core_pipe_limit;
80extern int pid_max; 80extern int pid_max;
81extern int min_free_kbytes; 81extern int min_free_kbytes;
82extern int pid_max_min, pid_max_max; 82extern 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
92extern int rcutorture_runnable; 92extern int rcutorture_runnable;
93#endif /* #ifdef CONFIG_RCU_TORTURE_TEST */ 93#endif /* #ifdef CONFIG_RCU_TORTURE_TEST */
94#ifdef CONFIG_BLOCK
95extern 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;
103static int __maybe_unused two = 2; 106static int __maybe_unused two = 2;
104static unsigned long one_ul = 1; 107static unsigned long one_ul = 1;
105static int one_hundred = 100; 108static int one_hundred = 100;
109#ifdef CONFIG_PRINTK
110static 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 */
108static unsigned long dirty_bytes_min = 2 * PAGE_SIZE; 114static 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
160static int proc_do_cad_pid(struct ctl_table *table, int write, struct file *filp, 166static 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);
162static int proc_taint(struct ctl_table *table, int write, struct file *filp, 168static 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
247static struct ctl_table kern_table[] = { 253static 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,11 +337,22 @@ 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),
337 .mode = 0644, 351 .mode = 0644,
338 .proc_handler = &proc_dointvec, 352 .proc_handler = &proc_dointvec_minmax,
353 .strategy = &sysctl_intvec,
354 .extra1 = &zero,
355 .extra2 = &one,
339 }, 356 },
340#endif 357#endif
341 { 358 {
@@ -407,6 +424,14 @@ static struct ctl_table kern_table[] = {
407 .proc_handler = &proc_dostring, 424 .proc_handler = &proc_dostring,
408 .strategy = &sysctl_string, 425 .strategy = &sysctl_string,
409 }, 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 },
410#ifdef CONFIG_PROC_SYSCTL 435#ifdef CONFIG_PROC_SYSCTL
411 { 436 {
412 .procname = "tainted", 437 .procname = "tainted",
@@ -708,6 +733,17 @@ static struct ctl_table kern_table[] = {
708 .mode = 0644, 733 .mode = 0644,
709 .proc_handler = &proc_dointvec, 734 .proc_handler = &proc_dointvec,
710 }, 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 },
711#endif 747#endif
712 { 748 {
713 .ctl_name = KERN_NGROUPS_MAX, 749 .ctl_name = KERN_NGROUPS_MAX,
@@ -744,6 +780,14 @@ static struct ctl_table kern_table[] = {
744 .proc_handler = &proc_dointvec, 780 .proc_handler = &proc_dointvec,
745 }, 781 },
746 { 782 {
783 .ctl_name = CTL_UNNUMBERED,
784 .procname = "panic_on_io_nmi",
785 .data = &panic_on_io_nmi,
786 .maxlen = sizeof(int),
787 .mode = 0644,
788 .proc_handler = &proc_dointvec,
789 },
790 {
747 .ctl_name = KERN_BOOTLOADER_TYPE, 791 .ctl_name = KERN_BOOTLOADER_TYPE,
748 .procname = "bootloader_type", 792 .procname = "bootloader_type",
749 .data = &bootloader_type, 793 .data = &bootloader_type,
@@ -942,28 +986,28 @@ static struct ctl_table kern_table[] = {
942 .child = slow_work_sysctls, 986 .child = slow_work_sysctls,
943 }, 987 },
944#endif 988#endif
945#ifdef CONFIG_PERF_COUNTERS 989#ifdef CONFIG_PERF_EVENTS
946 { 990 {
947 .ctl_name = CTL_UNNUMBERED, 991 .ctl_name = CTL_UNNUMBERED,
948 .procname = "perf_counter_paranoid", 992 .procname = "perf_event_paranoid",
949 .data = &sysctl_perf_counter_paranoid, 993 .data = &sysctl_perf_event_paranoid,
950 .maxlen = sizeof(sysctl_perf_counter_paranoid), 994 .maxlen = sizeof(sysctl_perf_event_paranoid),
951 .mode = 0644, 995 .mode = 0644,
952 .proc_handler = &proc_dointvec, 996 .proc_handler = &proc_dointvec,
953 }, 997 },
954 { 998 {
955 .ctl_name = CTL_UNNUMBERED, 999 .ctl_name = CTL_UNNUMBERED,
956 .procname = "perf_counter_mlock_kb", 1000 .procname = "perf_event_mlock_kb",
957 .data = &sysctl_perf_counter_mlock, 1001 .data = &sysctl_perf_event_mlock,
958 .maxlen = sizeof(sysctl_perf_counter_mlock), 1002 .maxlen = sizeof(sysctl_perf_event_mlock),
959 .mode = 0644, 1003 .mode = 0644,
960 .proc_handler = &proc_dointvec, 1004 .proc_handler = &proc_dointvec,
961 }, 1005 },
962 { 1006 {
963 .ctl_name = CTL_UNNUMBERED, 1007 .ctl_name = CTL_UNNUMBERED,
964 .procname = "perf_counter_max_sample_rate", 1008 .procname = "perf_event_max_sample_rate",
965 .data = &sysctl_perf_counter_sample_rate, 1009 .data = &sysctl_perf_event_sample_rate,
966 .maxlen = sizeof(sysctl_perf_counter_sample_rate), 1010 .maxlen = sizeof(sysctl_perf_event_sample_rate),
967 .mode = 0644, 1011 .mode = 0644,
968 .proc_handler = &proc_dointvec, 1012 .proc_handler = &proc_dointvec,
969 }, 1013 },
@@ -978,7 +1022,16 @@ static struct ctl_table kern_table[] = {
978 .proc_handler = &proc_dointvec, 1022 .proc_handler = &proc_dointvec,
979 }, 1023 },
980#endif 1024#endif
981 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
982/* 1035/*
983 * 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
984 * Documentation/sysctl/ctl_unnumbered.txt 1037 * Documentation/sysctl/ctl_unnumbered.txt
@@ -1295,10 +1348,10 @@ static struct ctl_table vm_table[] = {
1295 { 1348 {
1296 .ctl_name = CTL_UNNUMBERED, 1349 .ctl_name = CTL_UNNUMBERED,
1297 .procname = "mmap_min_addr", 1350 .procname = "mmap_min_addr",
1298 .data = &mmap_min_addr, 1351 .data = &dac_mmap_min_addr,
1299 .maxlen = sizeof(unsigned long), 1352 .maxlen = sizeof(unsigned long),
1300 .mode = 0644, 1353 .mode = 0644,
1301 .proc_handler = &proc_doulongvec_minmax, 1354 .proc_handler = &mmap_min_addr_handler,
1302 }, 1355 },
1303#ifdef CONFIG_NUMA 1356#ifdef CONFIG_NUMA
1304 { 1357 {
@@ -1345,6 +1398,31 @@ static struct ctl_table vm_table[] = {
1345 .mode = 0644, 1398 .mode = 0644,
1346 .proc_handler = &scan_unevictable_handler, 1399 .proc_handler = &scan_unevictable_handler,
1347 }, 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
1348/* 1426/*
1349 * 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
1350 * Documentation/sysctl/ctl_unnumbered.txt 1428 * Documentation/sysctl/ctl_unnumbered.txt
@@ -2173,7 +2251,7 @@ void sysctl_head_put(struct ctl_table_header *head)
2173#ifdef CONFIG_PROC_SYSCTL 2251#ifdef CONFIG_PROC_SYSCTL
2174 2252
2175static int _proc_do_string(void* data, int maxlen, int write, 2253static int _proc_do_string(void* data, int maxlen, int write,
2176 struct file *filp, void __user *buffer, 2254 void __user *buffer,
2177 size_t *lenp, loff_t *ppos) 2255 size_t *lenp, loff_t *ppos)
2178{ 2256{
2179 size_t len; 2257 size_t len;
@@ -2234,7 +2312,6 @@ static int _proc_do_string(void* data, int maxlen, int write,
2234 * proc_dostring - read a string sysctl 2312 * proc_dostring - read a string sysctl
2235 * @table: the sysctl table 2313 * @table: the sysctl table
2236 * @write: %TRUE if this is a write to the sysctl file 2314 * @write: %TRUE if this is a write to the sysctl file
2237 * @filp: the file structure
2238 * @buffer: the user buffer 2315 * @buffer: the user buffer
2239 * @lenp: the size of the user buffer 2316 * @lenp: the size of the user buffer
2240 * @ppos: file position 2317 * @ppos: file position
@@ -2248,10 +2325,10 @@ static int _proc_do_string(void* data, int maxlen, int write,
2248 * 2325 *
2249 * Returns 0 on success. 2326 * Returns 0 on success.
2250 */ 2327 */
2251int proc_dostring(struct ctl_table *table, int write, struct file *filp, 2328int proc_dostring(struct ctl_table *table, int write,
2252 void __user *buffer, size_t *lenp, loff_t *ppos) 2329 void __user *buffer, size_t *lenp, loff_t *ppos)
2253{ 2330{
2254 return _proc_do_string(table->data, table->maxlen, write, filp, 2331 return _proc_do_string(table->data, table->maxlen, write,
2255 buffer, lenp, ppos); 2332 buffer, lenp, ppos);
2256} 2333}
2257 2334
@@ -2276,7 +2353,7 @@ static int do_proc_dointvec_conv(int *negp, unsigned long *lvalp,
2276} 2353}
2277 2354
2278static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table, 2355static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table,
2279 int write, struct file *filp, void __user *buffer, 2356 int write, void __user *buffer,
2280 size_t *lenp, loff_t *ppos, 2357 size_t *lenp, loff_t *ppos,
2281 int (*conv)(int *negp, unsigned long *lvalp, int *valp, 2358 int (*conv)(int *negp, unsigned long *lvalp, int *valp,
2282 int write, void *data), 2359 int write, void *data),
@@ -2383,13 +2460,13 @@ static int __do_proc_dointvec(void *tbl_data, struct ctl_table *table,
2383#undef TMPBUFLEN 2460#undef TMPBUFLEN
2384} 2461}
2385 2462
2386static int do_proc_dointvec(struct ctl_table *table, int write, struct file *filp, 2463static int do_proc_dointvec(struct ctl_table *table, int write,
2387 void __user *buffer, size_t *lenp, loff_t *ppos, 2464 void __user *buffer, size_t *lenp, loff_t *ppos,
2388 int (*conv)(int *negp, unsigned long *lvalp, int *valp, 2465 int (*conv)(int *negp, unsigned long *lvalp, int *valp,
2389 int write, void *data), 2466 int write, void *data),
2390 void *data) 2467 void *data)
2391{ 2468{
2392 return __do_proc_dointvec(table->data, table, write, filp, 2469 return __do_proc_dointvec(table->data, table, write,
2393 buffer, lenp, ppos, conv, data); 2470 buffer, lenp, ppos, conv, data);
2394} 2471}
2395 2472
@@ -2397,7 +2474,6 @@ static int do_proc_dointvec(struct ctl_table *table, int write, struct file *fil
2397 * proc_dointvec - read a vector of integers 2474 * proc_dointvec - read a vector of integers
2398 * @table: the sysctl table 2475 * @table: the sysctl table
2399 * @write: %TRUE if this is a write to the sysctl file 2476 * @write: %TRUE if this is a write to the sysctl file
2400 * @filp: the file structure
2401 * @buffer: the user buffer 2477 * @buffer: the user buffer
2402 * @lenp: the size of the user buffer 2478 * @lenp: the size of the user buffer
2403 * @ppos: file position 2479 * @ppos: file position
@@ -2407,10 +2483,10 @@ static int do_proc_dointvec(struct ctl_table *table, int write, struct file *fil
2407 * 2483 *
2408 * Returns 0 on success. 2484 * Returns 0 on success.
2409 */ 2485 */
2410int proc_dointvec(struct ctl_table *table, int write, struct file *filp, 2486int proc_dointvec(struct ctl_table *table, int write,
2411 void __user *buffer, size_t *lenp, loff_t *ppos) 2487 void __user *buffer, size_t *lenp, loff_t *ppos)
2412{ 2488{
2413 return do_proc_dointvec(table,write,filp,buffer,lenp,ppos, 2489 return do_proc_dointvec(table,write,buffer,lenp,ppos,
2414 NULL,NULL); 2490 NULL,NULL);
2415} 2491}
2416 2492
@@ -2418,7 +2494,7 @@ int proc_dointvec(struct ctl_table *table, int write, struct file *filp,
2418 * Taint values can only be increased 2494 * Taint values can only be increased
2419 * This means we can safely use a temporary. 2495 * This means we can safely use a temporary.
2420 */ 2496 */
2421static int proc_taint(struct ctl_table *table, int write, struct file *filp, 2497static int proc_taint(struct ctl_table *table, int write,
2422 void __user *buffer, size_t *lenp, loff_t *ppos) 2498 void __user *buffer, size_t *lenp, loff_t *ppos)
2423{ 2499{
2424 struct ctl_table t; 2500 struct ctl_table t;
@@ -2430,7 +2506,7 @@ static int proc_taint(struct ctl_table *table, int write, struct file *filp,
2430 2506
2431 t = *table; 2507 t = *table;
2432 t.data = &tmptaint; 2508 t.data = &tmptaint;
2433 err = proc_doulongvec_minmax(&t, write, filp, buffer, lenp, ppos); 2509 err = proc_doulongvec_minmax(&t, write, buffer, lenp, ppos);
2434 if (err < 0) 2510 if (err < 0)
2435 return err; 2511 return err;
2436 2512
@@ -2482,7 +2558,6 @@ static int do_proc_dointvec_minmax_conv(int *negp, unsigned long *lvalp,
2482 * 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
2483 * @table: the sysctl table 2559 * @table: the sysctl table
2484 * @write: %TRUE if this is a write to the sysctl file 2560 * @write: %TRUE if this is a write to the sysctl file
2485 * @filp: the file structure
2486 * @buffer: the user buffer 2561 * @buffer: the user buffer
2487 * @lenp: the size of the user buffer 2562 * @lenp: the size of the user buffer
2488 * @ppos: file position 2563 * @ppos: file position
@@ -2495,19 +2570,18 @@ static int do_proc_dointvec_minmax_conv(int *negp, unsigned long *lvalp,
2495 * 2570 *
2496 * Returns 0 on success. 2571 * Returns 0 on success.
2497 */ 2572 */
2498int proc_dointvec_minmax(struct ctl_table *table, int write, struct file *filp, 2573int proc_dointvec_minmax(struct ctl_table *table, int write,
2499 void __user *buffer, size_t *lenp, loff_t *ppos) 2574 void __user *buffer, size_t *lenp, loff_t *ppos)
2500{ 2575{
2501 struct do_proc_dointvec_minmax_conv_param param = { 2576 struct do_proc_dointvec_minmax_conv_param param = {
2502 .min = (int *) table->extra1, 2577 .min = (int *) table->extra1,
2503 .max = (int *) table->extra2, 2578 .max = (int *) table->extra2,
2504 }; 2579 };
2505 return do_proc_dointvec(table, write, filp, buffer, lenp, ppos, 2580 return do_proc_dointvec(table, write, buffer, lenp, ppos,
2506 do_proc_dointvec_minmax_conv, &param); 2581 do_proc_dointvec_minmax_conv, &param);
2507} 2582}
2508 2583
2509static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int write, 2584static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int write,
2510 struct file *filp,
2511 void __user *buffer, 2585 void __user *buffer,
2512 size_t *lenp, loff_t *ppos, 2586 size_t *lenp, loff_t *ppos,
2513 unsigned long convmul, 2587 unsigned long convmul,
@@ -2612,21 +2686,19 @@ static int __do_proc_doulongvec_minmax(void *data, struct ctl_table *table, int
2612} 2686}
2613 2687
2614static int do_proc_doulongvec_minmax(struct ctl_table *table, int write, 2688static int do_proc_doulongvec_minmax(struct ctl_table *table, int write,
2615 struct file *filp,
2616 void __user *buffer, 2689 void __user *buffer,
2617 size_t *lenp, loff_t *ppos, 2690 size_t *lenp, loff_t *ppos,
2618 unsigned long convmul, 2691 unsigned long convmul,
2619 unsigned long convdiv) 2692 unsigned long convdiv)
2620{ 2693{
2621 return __do_proc_doulongvec_minmax(table->data, table, write, 2694 return __do_proc_doulongvec_minmax(table->data, table, write,
2622 filp, buffer, lenp, ppos, convmul, convdiv); 2695 buffer, lenp, ppos, convmul, convdiv);
2623} 2696}
2624 2697
2625/** 2698/**
2626 * 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
2627 * @table: the sysctl table 2700 * @table: the sysctl table
2628 * @write: %TRUE if this is a write to the sysctl file 2701 * @write: %TRUE if this is a write to the sysctl file
2629 * @filp: the file structure
2630 * @buffer: the user buffer 2702 * @buffer: the user buffer
2631 * @lenp: the size of the user buffer 2703 * @lenp: the size of the user buffer
2632 * @ppos: file position 2704 * @ppos: file position
@@ -2639,17 +2711,16 @@ static int do_proc_doulongvec_minmax(struct ctl_table *table, int write,
2639 * 2711 *
2640 * Returns 0 on success. 2712 * Returns 0 on success.
2641 */ 2713 */
2642int proc_doulongvec_minmax(struct ctl_table *table, int write, struct file *filp, 2714int proc_doulongvec_minmax(struct ctl_table *table, int write,
2643 void __user *buffer, size_t *lenp, loff_t *ppos) 2715 void __user *buffer, size_t *lenp, loff_t *ppos)
2644{ 2716{
2645 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);
2646} 2718}
2647 2719
2648/** 2720/**
2649 * 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
2650 * @table: the sysctl table 2722 * @table: the sysctl table
2651 * @write: %TRUE if this is a write to the sysctl file 2723 * @write: %TRUE if this is a write to the sysctl file
2652 * @filp: the file structure
2653 * @buffer: the user buffer 2724 * @buffer: the user buffer
2654 * @lenp: the size of the user buffer 2725 * @lenp: the size of the user buffer
2655 * @ppos: file position 2726 * @ppos: file position
@@ -2664,11 +2735,10 @@ int proc_doulongvec_minmax(struct ctl_table *table, int write, struct file *filp
2664 * Returns 0 on success. 2735 * Returns 0 on success.
2665 */ 2736 */
2666int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write, 2737int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,
2667 struct file *filp,
2668 void __user *buffer, 2738 void __user *buffer,
2669 size_t *lenp, loff_t *ppos) 2739 size_t *lenp, loff_t *ppos)
2670{ 2740{
2671 return do_proc_doulongvec_minmax(table, write, filp, buffer, 2741 return do_proc_doulongvec_minmax(table, write, buffer,
2672 lenp, ppos, HZ, 1000l); 2742 lenp, ppos, HZ, 1000l);
2673} 2743}
2674 2744
@@ -2744,7 +2814,6 @@ static int do_proc_dointvec_ms_jiffies_conv(int *negp, unsigned long *lvalp,
2744 * proc_dointvec_jiffies - read a vector of integers as seconds 2814 * proc_dointvec_jiffies - read a vector of integers as seconds
2745 * @table: the sysctl table 2815 * @table: the sysctl table
2746 * @write: %TRUE if this is a write to the sysctl file 2816 * @write: %TRUE if this is a write to the sysctl file
2747 * @filp: the file structure
2748 * @buffer: the user buffer 2817 * @buffer: the user buffer
2749 * @lenp: the size of the user buffer 2818 * @lenp: the size of the user buffer
2750 * @ppos: file position 2819 * @ppos: file position
@@ -2756,10 +2825,10 @@ static int do_proc_dointvec_ms_jiffies_conv(int *negp, unsigned long *lvalp,
2756 * 2825 *
2757 * Returns 0 on success. 2826 * Returns 0 on success.
2758 */ 2827 */
2759int proc_dointvec_jiffies(struct ctl_table *table, int write, struct file *filp, 2828int proc_dointvec_jiffies(struct ctl_table *table, int write,
2760 void __user *buffer, size_t *lenp, loff_t *ppos) 2829 void __user *buffer, size_t *lenp, loff_t *ppos)
2761{ 2830{
2762 return do_proc_dointvec(table,write,filp,buffer,lenp,ppos, 2831 return do_proc_dointvec(table,write,buffer,lenp,ppos,
2763 do_proc_dointvec_jiffies_conv,NULL); 2832 do_proc_dointvec_jiffies_conv,NULL);
2764} 2833}
2765 2834
@@ -2767,7 +2836,6 @@ int proc_dointvec_jiffies(struct ctl_table *table, int write, struct file *filp,
2767 * 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
2768 * @table: the sysctl table 2837 * @table: the sysctl table
2769 * @write: %TRUE if this is a write to the sysctl file 2838 * @write: %TRUE if this is a write to the sysctl file
2770 * @filp: the file structure
2771 * @buffer: the user buffer 2839 * @buffer: the user buffer
2772 * @lenp: the size of the user buffer 2840 * @lenp: the size of the user buffer
2773 * @ppos: pointer to the file position 2841 * @ppos: pointer to the file position
@@ -2779,10 +2847,10 @@ int proc_dointvec_jiffies(struct ctl_table *table, int write, struct file *filp,
2779 * 2847 *
2780 * Returns 0 on success. 2848 * Returns 0 on success.
2781 */ 2849 */
2782int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write, struct file *filp, 2850int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write,
2783 void __user *buffer, size_t *lenp, loff_t *ppos) 2851 void __user *buffer, size_t *lenp, loff_t *ppos)
2784{ 2852{
2785 return do_proc_dointvec(table,write,filp,buffer,lenp,ppos, 2853 return do_proc_dointvec(table,write,buffer,lenp,ppos,
2786 do_proc_dointvec_userhz_jiffies_conv,NULL); 2854 do_proc_dointvec_userhz_jiffies_conv,NULL);
2787} 2855}
2788 2856
@@ -2790,7 +2858,6 @@ int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write, struct file
2790 * 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
2791 * @table: the sysctl table 2859 * @table: the sysctl table
2792 * @write: %TRUE if this is a write to the sysctl file 2860 * @write: %TRUE if this is a write to the sysctl file
2793 * @filp: the file structure
2794 * @buffer: the user buffer 2861 * @buffer: the user buffer
2795 * @lenp: the size of the user buffer 2862 * @lenp: the size of the user buffer
2796 * @ppos: file position 2863 * @ppos: file position
@@ -2803,14 +2870,14 @@ int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write, struct file
2803 * 2870 *
2804 * Returns 0 on success. 2871 * Returns 0 on success.
2805 */ 2872 */
2806int proc_dointvec_ms_jiffies(struct ctl_table *table, int write, struct file *filp, 2873int proc_dointvec_ms_jiffies(struct ctl_table *table, int write,
2807 void __user *buffer, size_t *lenp, loff_t *ppos) 2874 void __user *buffer, size_t *lenp, loff_t *ppos)
2808{ 2875{
2809 return do_proc_dointvec(table, write, filp, buffer, lenp, ppos, 2876 return do_proc_dointvec(table, write, buffer, lenp, ppos,
2810 do_proc_dointvec_ms_jiffies_conv, NULL); 2877 do_proc_dointvec_ms_jiffies_conv, NULL);
2811} 2878}
2812 2879
2813static int proc_do_cad_pid(struct ctl_table *table, int write, struct file *filp, 2880static int proc_do_cad_pid(struct ctl_table *table, int write,
2814 void __user *buffer, size_t *lenp, loff_t *ppos) 2881 void __user *buffer, size_t *lenp, loff_t *ppos)
2815{ 2882{
2816 struct pid *new_pid; 2883 struct pid *new_pid;
@@ -2819,7 +2886,7 @@ static int proc_do_cad_pid(struct ctl_table *table, int write, struct file *filp
2819 2886
2820 tmp = pid_vnr(cad_pid); 2887 tmp = pid_vnr(cad_pid);
2821 2888
2822 r = __do_proc_dointvec(&tmp, table, write, filp, buffer, 2889 r = __do_proc_dointvec(&tmp, table, write, buffer,
2823 lenp, ppos, NULL, NULL); 2890 lenp, ppos, NULL, NULL);
2824 if (r || !write) 2891 if (r || !write)
2825 return r; 2892 return r;
@@ -2834,50 +2901,49 @@ static int proc_do_cad_pid(struct ctl_table *table, int write, struct file *filp
2834 2901
2835#else /* CONFIG_PROC_FS */ 2902#else /* CONFIG_PROC_FS */
2836 2903
2837int proc_dostring(struct ctl_table *table, int write, struct file *filp, 2904int proc_dostring(struct ctl_table *table, int write,
2838 void __user *buffer, size_t *lenp, loff_t *ppos) 2905 void __user *buffer, size_t *lenp, loff_t *ppos)
2839{ 2906{
2840 return -ENOSYS; 2907 return -ENOSYS;
2841} 2908}
2842 2909
2843int proc_dointvec(struct ctl_table *table, int write, struct file *filp, 2910int proc_dointvec(struct ctl_table *table, int write,
2844 void __user *buffer, size_t *lenp, loff_t *ppos) 2911 void __user *buffer, size_t *lenp, loff_t *ppos)
2845{ 2912{
2846 return -ENOSYS; 2913 return -ENOSYS;
2847} 2914}
2848 2915
2849int proc_dointvec_minmax(struct ctl_table *table, int write, struct file *filp, 2916int proc_dointvec_minmax(struct ctl_table *table, int write,
2850 void __user *buffer, size_t *lenp, loff_t *ppos) 2917 void __user *buffer, size_t *lenp, loff_t *ppos)
2851{ 2918{
2852 return -ENOSYS; 2919 return -ENOSYS;
2853} 2920}
2854 2921
2855int proc_dointvec_jiffies(struct ctl_table *table, int write, struct file *filp, 2922int proc_dointvec_jiffies(struct ctl_table *table, int write,
2856 void __user *buffer, size_t *lenp, loff_t *ppos) 2923 void __user *buffer, size_t *lenp, loff_t *ppos)
2857{ 2924{
2858 return -ENOSYS; 2925 return -ENOSYS;
2859} 2926}
2860 2927
2861int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write, struct file *filp, 2928int proc_dointvec_userhz_jiffies(struct ctl_table *table, int write,
2862 void __user *buffer, size_t *lenp, loff_t *ppos) 2929 void __user *buffer, size_t *lenp, loff_t *ppos)
2863{ 2930{
2864 return -ENOSYS; 2931 return -ENOSYS;
2865} 2932}
2866 2933
2867int proc_dointvec_ms_jiffies(struct ctl_table *table, int write, struct file *filp, 2934int proc_dointvec_ms_jiffies(struct ctl_table *table, int write,
2868 void __user *buffer, size_t *lenp, loff_t *ppos) 2935 void __user *buffer, size_t *lenp, loff_t *ppos)
2869{ 2936{
2870 return -ENOSYS; 2937 return -ENOSYS;
2871} 2938}
2872 2939
2873int proc_doulongvec_minmax(struct ctl_table *table, int write, struct file *filp, 2940int proc_doulongvec_minmax(struct ctl_table *table, int write,
2874 void __user *buffer, size_t *lenp, loff_t *ppos) 2941 void __user *buffer, size_t *lenp, loff_t *ppos)
2875{ 2942{
2876 return -ENOSYS; 2943 return -ENOSYS;
2877} 2944}
2878 2945
2879int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write, 2946int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,
2880 struct file *filp,
2881 void __user *buffer, 2947 void __user *buffer,
2882 size_t *lenp, loff_t *ppos) 2948 size_t *lenp, loff_t *ppos)
2883{ 2949{