aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/kernel/isa.c11
-rw-r--r--arch/arm/mach-bcmring/arch.c6
-rw-r--r--arch/frv/kernel/pm.c106
-rw-r--r--arch/frv/kernel/sysctl.c3
-rw-r--r--arch/ia64/ia32/ia32_entry.S2
-rw-r--r--arch/ia64/ia32/sys_ia32.c55
-rw-r--r--arch/ia64/kernel/crash.c7
-rw-r--r--arch/ia64/kernel/perfmon.c6
-rw-r--r--arch/mips/kernel/linux32.c61
-rw-r--r--arch/mips/kernel/scall64-n32.S2
-rw-r--r--arch/mips/kernel/scall64-o32.S2
-rw-r--r--arch/mips/lasat/sysctl.c99
-rw-r--r--arch/parisc/kernel/sys_parisc32.c71
-rw-r--r--arch/parisc/kernel/syscall_table.S2
-rw-r--r--arch/powerpc/kernel/idle.c2
-rw-r--r--arch/powerpc/kernel/sys_ppc32.c52
-rw-r--r--arch/s390/kernel/compat_linux.c53
-rw-r--r--arch/s390/kernel/compat_linux.h2
-rw-r--r--arch/s390/kernel/compat_wrapper.S6
-rw-r--r--arch/s390/kernel/debug.c9
-rw-r--r--arch/s390/mm/cmm.c5
-rw-r--r--arch/sh/kernel/traps_64.c7
-rw-r--r--arch/sparc/kernel/sys_sparc32.c57
-rw-r--r--arch/sparc/kernel/systbls_64.S2
-rw-r--r--arch/x86/ia32/ia32entry.S2
-rw-r--r--arch/x86/ia32/sys_ia32.c56
-rw-r--r--arch/x86/include/asm/sys_ia32.h5
-rw-r--r--arch/x86/kernel/vsyscall_64.c2
-rw-r--r--arch/x86/vdso/vdso32-setup.c1
-rw-r--r--crypto/proc.c10
-rw-r--r--drivers/cdrom/cdrom.c8
-rw-r--r--drivers/char/hpet.c9
-rw-r--r--drivers/char/ipmi/ipmi_poweroff.c9
-rw-r--r--drivers/char/pty.c10
-rw-r--r--drivers/char/random.c42
-rw-r--r--drivers/char/rtc.c9
-rw-r--r--drivers/macintosh/mac_hid.c11
-rw-r--r--drivers/md/md.c10
-rw-r--r--drivers/misc/sgi-xp/xpc_main.c8
-rw-r--r--drivers/net/wireless/arlan-proc.c181
-rw-r--r--drivers/parport/procfs.c11
-rw-r--r--drivers/s390/char/sclp_async.c5
-rw-r--r--drivers/scsi/scsi_sysctl.c9
-rw-r--r--fs/coda/sysctl.c4
-rw-r--r--fs/eventpoll.c2
-rw-r--r--fs/lockd/svc.c14
-rw-r--r--fs/nfs/sysctl.c14
-rw-r--r--fs/notify/inotify/inotify_user.c8
-rw-r--r--fs/ntfs/sysctl.c2
-rw-r--r--fs/ocfs2/stackglue.c13
-rw-r--r--fs/proc/proc_sysctl.c4
-rw-r--r--fs/quota/dquot.c17
-rw-r--r--fs/xfs/linux-2.6/xfs_sysctl.c32
-rw-r--r--include/linux/sysctl.h24
-rw-r--r--include/net/dn_dev.h1
-rw-r--r--include/net/neighbour.h3
-rw-r--r--init/Kconfig1
-rw-r--r--ipc/ipc_sysctl.c77
-rw-r--r--ipc/mq_sysctl.c7
-rw-r--r--kernel/Makefile2
-rw-r--r--kernel/sched.c5
-rw-r--r--kernel/slow-work.c5
-rw-r--r--kernel/sys_ni.c1
-rw-r--r--kernel/sysctl.c627
-rw-r--r--kernel/sysctl_binary.c1507
-rw-r--r--kernel/sysctl_check.c1376
-rw-r--r--kernel/utsname_sysctl.c31
-rw-r--r--lib/Kconfig.debug2
-rw-r--r--net/802/tr.c7
-rw-r--r--net/appletalk/sysctl_net_atalk.c13
-rw-r--r--net/ax25/sysctl_net_ax25.c38
-rw-r--r--net/bridge/br_netfilter.c6
-rw-r--r--net/core/neighbour.c47
-rw-r--r--net/core/sysctl_net_core.c21
-rw-r--r--net/dccp/sysctl.c8
-rw-r--r--net/decnet/dn_dev.c64
-rw-r--r--net/decnet/sysctl_net_decnet.c123
-rw-r--r--net/ipv4/arp.c2
-rw-r--r--net/ipv4/devinet.c111
-rw-r--r--net/ipv4/ip_fragment.c6
-rw-r--r--net/ipv4/netfilter.c6
-rw-r--r--net/ipv4/netfilter/ip_queue.c3
-rw-r--r--net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c10
-rw-r--r--net/ipv4/netfilter/nf_conntrack_proto_icmp.c8
-rw-r--r--net/ipv4/route.c73
-rw-r--r--net/ipv4/sysctl_net_ipv4.c164
-rw-r--r--net/ipv4/xfrm4_policy.c1
-rw-r--r--net/ipv6/addrconf.c90
-rw-r--r--net/ipv6/icmp.c4
-rw-r--r--net/ipv6/ndisc.c39
-rw-r--r--net/ipv6/netfilter/ip6_queue.c4
-rw-r--r--net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c4
-rw-r--r--net/ipv6/netfilter/nf_conntrack_reasm.c4
-rw-r--r--net/ipv6/reassembly.c6
-rw-r--r--net/ipv6/route.c18
-rw-r--r--net/ipv6/sysctl_net_ipv6.c12
-rw-r--r--net/ipv6/xfrm6_policy.c1
-rw-r--r--net/ipx/sysctl_net_ipx.c7
-rw-r--r--net/irda/irsysctl.c31
-rw-r--r--net/llc/sysctl_net_llc.c25
-rw-r--r--net/netfilter/core.c4
-rw-r--r--net/netfilter/ipvs/ip_vs_ctl.c6
-rw-r--r--net/netfilter/ipvs/ip_vs_lblc.c2
-rw-r--r--net/netfilter/ipvs/ip_vs_lblcr.c2
-rw-r--r--net/netfilter/nf_conntrack_acct.c1
-rw-r--r--net/netfilter/nf_conntrack_ecache.c2
-rw-r--r--net/netfilter/nf_conntrack_proto_dccp.c12
-rw-r--r--net/netfilter/nf_conntrack_proto_generic.c8
-rw-r--r--net/netfilter/nf_conntrack_proto_sctp.c8
-rw-r--r--net/netfilter/nf_conntrack_proto_tcp.c14
-rw-r--r--net/netfilter/nf_conntrack_proto_udp.c8
-rw-r--r--net/netfilter/nf_conntrack_proto_udplite.c6
-rw-r--r--net/netfilter/nf_conntrack_standalone.c14
-rw-r--r--net/netfilter/nf_log.c7
-rw-r--r--net/netrom/sysctl_net_netrom.c30
-rw-r--r--net/phonet/sysctl.c8
-rw-r--r--net/rds/ib_sysctl.c14
-rw-r--r--net/rds/iw_sysctl.c14
-rw-r--r--net/rds/sysctl.c11
-rw-r--r--net/rose/sysctl_net_rose.c26
-rw-r--r--net/sctp/sysctl.c49
-rw-r--r--net/sunrpc/sysctl.c5
-rw-r--r--net/sunrpc/xprtrdma/svc_rdma.c16
-rw-r--r--net/sunrpc/xprtrdma/transport.c20
-rw-r--r--net/sunrpc/xprtsock.c18
-rw-r--r--net/unix/sysctl_net_unix.c7
-rw-r--r--net/x25/sysctl_net_x25.c15
-rw-r--r--net/xfrm/xfrm_sysctl.c4
-rw-r--r--security/keys/sysctl.c7
-rw-r--r--security/tomoyo/tomoyo.c10
130 files changed, 1836 insertions, 4273 deletions
diff --git a/arch/arm/kernel/isa.c b/arch/arm/kernel/isa.c
index 8ac9b8424007..738dfcc658ca 100644
--- a/arch/arm/kernel/isa.c
+++ b/arch/arm/kernel/isa.c
@@ -22,47 +22,42 @@ static unsigned int isa_membase, isa_portbase, isa_portshift;
22 22
23static ctl_table ctl_isa_vars[4] = { 23static ctl_table ctl_isa_vars[4] = {
24 { 24 {
25 .ctl_name = BUS_ISA_MEM_BASE,
26 .procname = "membase", 25 .procname = "membase",
27 .data = &isa_membase, 26 .data = &isa_membase,
28 .maxlen = sizeof(isa_membase), 27 .maxlen = sizeof(isa_membase),
29 .mode = 0444, 28 .mode = 0444,
30 .proc_handler = &proc_dointvec, 29 .proc_handler = &proc_dointvec,
31 }, { 30 }, {
32 .ctl_name = BUS_ISA_PORT_BASE,
33 .procname = "portbase", 31 .procname = "portbase",
34 .data = &isa_portbase, 32 .data = &isa_portbase,
35 .maxlen = sizeof(isa_portbase), 33 .maxlen = sizeof(isa_portbase),
36 .mode = 0444, 34 .mode = 0444,
37 .proc_handler = &proc_dointvec, 35 .proc_handler = &proc_dointvec,
38 }, { 36 }, {
39 .ctl_name = BUS_ISA_PORT_SHIFT,
40 .procname = "portshift", 37 .procname = "portshift",
41 .data = &isa_portshift, 38 .data = &isa_portshift,
42 .maxlen = sizeof(isa_portshift), 39 .maxlen = sizeof(isa_portshift),
43 .mode = 0444, 40 .mode = 0444,
44 .proc_handler = &proc_dointvec, 41 .proc_handler = &proc_dointvec,
45 }, {0} 42 }, {}
46}; 43};
47 44
48static struct ctl_table_header *isa_sysctl_header; 45static struct ctl_table_header *isa_sysctl_header;
49 46
50static ctl_table ctl_isa[2] = { 47static ctl_table ctl_isa[2] = {
51 { 48 {
52 .ctl_name = CTL_BUS_ISA,
53 .procname = "isa", 49 .procname = "isa",
54 .mode = 0555, 50 .mode = 0555,
55 .child = ctl_isa_vars, 51 .child = ctl_isa_vars,
56 }, {0} 52 }, {}
57}; 53};
58 54
59static ctl_table ctl_bus[2] = { 55static ctl_table ctl_bus[2] = {
60 { 56 {
61 .ctl_name = CTL_BUS,
62 .procname = "bus", 57 .procname = "bus",
63 .mode = 0555, 58 .mode = 0555,
64 .child = ctl_isa, 59 .child = ctl_isa,
65 }, {0} 60 }, {}
66}; 61};
67 62
68void __init 63void __init
diff --git a/arch/arm/mach-bcmring/arch.c b/arch/arm/mach-bcmring/arch.c
index 0da693b0f7e1..f3c11199707a 100644
--- a/arch/arm/mach-bcmring/arch.c
+++ b/arch/arm/mach-bcmring/arch.c
@@ -47,10 +47,6 @@ HW_DECLARE_SPINLOCK(gpio)
47 EXPORT_SYMBOL(bcmring_gpio_reg_lock); 47 EXPORT_SYMBOL(bcmring_gpio_reg_lock);
48#endif 48#endif
49 49
50/* FIXME: temporary solution */
51#define BCM_SYSCTL_REBOOT_WARM 1
52#define CTL_BCM_REBOOT 112
53
54/* sysctl */ 50/* sysctl */
55int bcmring_arch_warm_reboot; /* do a warm reboot on hard reset */ 51int bcmring_arch_warm_reboot; /* do a warm reboot on hard reset */
56 52
@@ -58,7 +54,6 @@ static struct ctl_table_header *bcmring_sysctl_header;
58 54
59static struct ctl_table bcmring_sysctl_warm_reboot[] = { 55static struct ctl_table bcmring_sysctl_warm_reboot[] = {
60 { 56 {
61 .ctl_name = BCM_SYSCTL_REBOOT_WARM,
62 .procname = "warm", 57 .procname = "warm",
63 .data = &bcmring_arch_warm_reboot, 58 .data = &bcmring_arch_warm_reboot,
64 .maxlen = sizeof(int), 59 .maxlen = sizeof(int),
@@ -69,7 +64,6 @@ static struct ctl_table bcmring_sysctl_warm_reboot[] = {
69 64
70static struct ctl_table bcmring_sysctl_reboot[] = { 65static struct ctl_table bcmring_sysctl_reboot[] = {
71 { 66 {
72 .ctl_name = CTL_BCM_REBOOT,
73 .procname = "reboot", 67 .procname = "reboot",
74 .mode = 0555, 68 .mode = 0555,
75 .child = bcmring_sysctl_warm_reboot}, 69 .child = bcmring_sysctl_warm_reboot},
diff --git a/arch/frv/kernel/pm.c b/arch/frv/kernel/pm.c
index 0d4d3e3a4cfc..940d8bb486f8 100644
--- a/arch/frv/kernel/pm.c
+++ b/arch/frv/kernel/pm.c
@@ -211,37 +211,6 @@ static int cmode_procctl(ctl_table *ctl, int write,
211 return try_set_cmode(new_cmode)?:*lenp; 211 return try_set_cmode(new_cmode)?:*lenp;
212} 212}
213 213
214static int cmode_sysctl(ctl_table *table,
215 void __user *oldval, size_t __user *oldlenp,
216 void __user *newval, size_t newlen)
217{
218 if (oldval && oldlenp) {
219 size_t oldlen;
220
221 if (get_user(oldlen, oldlenp))
222 return -EFAULT;
223
224 if (oldlen != sizeof(int))
225 return -EINVAL;
226
227 if (put_user(clock_cmode_current, (unsigned __user *)oldval) ||
228 put_user(sizeof(int), oldlenp))
229 return -EFAULT;
230 }
231 if (newval && newlen) {
232 int new_cmode;
233
234 if (newlen != sizeof(int))
235 return -EINVAL;
236
237 if (get_user(new_cmode, (int __user *)newval))
238 return -EFAULT;
239
240 return try_set_cmode(new_cmode)?:1;
241 }
242 return 1;
243}
244
245static int try_set_p0(int new_p0) 214static int try_set_p0(int new_p0)
246{ 215{
247 unsigned long flags, clkc; 216 unsigned long flags, clkc;
@@ -314,37 +283,6 @@ static int p0_procctl(ctl_table *ctl, int write,
314 return try_set_p0(new_p0)?:*lenp; 283 return try_set_p0(new_p0)?:*lenp;
315} 284}
316 285
317static int p0_sysctl(ctl_table *table,
318 void __user *oldval, size_t __user *oldlenp,
319 void __user *newval, size_t newlen)
320{
321 if (oldval && oldlenp) {
322 size_t oldlen;
323
324 if (get_user(oldlen, oldlenp))
325 return -EFAULT;
326
327 if (oldlen != sizeof(int))
328 return -EINVAL;
329
330 if (put_user(clock_p0_current, (unsigned __user *)oldval) ||
331 put_user(sizeof(int), oldlenp))
332 return -EFAULT;
333 }
334 if (newval && newlen) {
335 int new_p0;
336
337 if (newlen != sizeof(int))
338 return -EINVAL;
339
340 if (get_user(new_p0, (int __user *)newval))
341 return -EFAULT;
342
343 return try_set_p0(new_p0)?:1;
344 }
345 return 1;
346}
347
348static int cm_procctl(ctl_table *ctl, int write, 286static int cm_procctl(ctl_table *ctl, int write,
349 void __user *buffer, size_t *lenp, loff_t *fpos) 287 void __user *buffer, size_t *lenp, loff_t *fpos)
350{ 288{
@@ -358,42 +296,9 @@ static int cm_procctl(ctl_table *ctl, int write,
358 return try_set_cm(new_cm)?:*lenp; 296 return try_set_cm(new_cm)?:*lenp;
359} 297}
360 298
361static int cm_sysctl(ctl_table *table,
362 void __user *oldval, size_t __user *oldlenp,
363 void __user *newval, size_t newlen)
364{
365 if (oldval && oldlenp) {
366 size_t oldlen;
367
368 if (get_user(oldlen, oldlenp))
369 return -EFAULT;
370
371 if (oldlen != sizeof(int))
372 return -EINVAL;
373
374 if (put_user(clock_cm_current, (unsigned __user *)oldval) ||
375 put_user(sizeof(int), oldlenp))
376 return -EFAULT;
377 }
378 if (newval && newlen) {
379 int new_cm;
380
381 if (newlen != sizeof(int))
382 return -EINVAL;
383
384 if (get_user(new_cm, (int __user *)newval))
385 return -EFAULT;
386
387 return try_set_cm(new_cm)?:1;
388 }
389 return 1;
390}
391
392
393static struct ctl_table pm_table[] = 299static struct ctl_table pm_table[] =
394{ 300{
395 { 301 {
396 .ctl_name = CTL_PM_SUSPEND,
397 .procname = "suspend", 302 .procname = "suspend",
398 .data = NULL, 303 .data = NULL,
399 .maxlen = 0, 304 .maxlen = 0,
@@ -401,44 +306,37 @@ static struct ctl_table pm_table[] =
401 .proc_handler = &sysctl_pm_do_suspend, 306 .proc_handler = &sysctl_pm_do_suspend,
402 }, 307 },
403 { 308 {
404 .ctl_name = CTL_PM_CMODE,
405 .procname = "cmode", 309 .procname = "cmode",
406 .data = &clock_cmode_current, 310 .data = &clock_cmode_current,
407 .maxlen = sizeof(int), 311 .maxlen = sizeof(int),
408 .mode = 0644, 312 .mode = 0644,
409 .proc_handler = &cmode_procctl, 313 .proc_handler = &cmode_procctl,
410 .strategy = &cmode_sysctl,
411 }, 314 },
412 { 315 {
413 .ctl_name = CTL_PM_P0,
414 .procname = "p0", 316 .procname = "p0",
415 .data = &clock_p0_current, 317 .data = &clock_p0_current,
416 .maxlen = sizeof(int), 318 .maxlen = sizeof(int),
417 .mode = 0644, 319 .mode = 0644,
418 .proc_handler = &p0_procctl, 320 .proc_handler = &p0_procctl,
419 .strategy = &p0_sysctl,
420 }, 321 },
421 { 322 {
422 .ctl_name = CTL_PM_CM,
423 .procname = "cm", 323 .procname = "cm",
424 .data = &clock_cm_current, 324 .data = &clock_cm_current,
425 .maxlen = sizeof(int), 325 .maxlen = sizeof(int),
426 .mode = 0644, 326 .mode = 0644,
427 .proc_handler = &cm_procctl, 327 .proc_handler = &cm_procctl,
428 .strategy = &cm_sysctl,
429 }, 328 },
430 { .ctl_name = 0} 329 { }
431}; 330};
432 331
433static struct ctl_table pm_dir_table[] = 332static struct ctl_table pm_dir_table[] =
434{ 333{
435 { 334 {
436 .ctl_name = CTL_PM,
437 .procname = "pm", 335 .procname = "pm",
438 .mode = 0555, 336 .mode = 0555,
439 .child = pm_table, 337 .child = pm_table,
440 }, 338 },
441 { .ctl_name = 0} 339 { }
442}; 340};
443 341
444/* 342/*
diff --git a/arch/frv/kernel/sysctl.c b/arch/frv/kernel/sysctl.c
index 3e9d7e03fb95..b30a4f2cda3e 100644
--- a/arch/frv/kernel/sysctl.c
+++ b/arch/frv/kernel/sysctl.c
@@ -176,7 +176,6 @@ static int procctl_frv_pin_cxnr(ctl_table *table, int write, struct file *filp,
176static struct ctl_table frv_table[] = 176static struct ctl_table frv_table[] =
177{ 177{
178 { 178 {
179 .ctl_name = 1,
180 .procname = "cache-mode", 179 .procname = "cache-mode",
181 .data = NULL, 180 .data = NULL,
182 .maxlen = 0, 181 .maxlen = 0,
@@ -185,7 +184,6 @@ static struct ctl_table frv_table[] =
185 }, 184 },
186#ifdef CONFIG_MMU 185#ifdef CONFIG_MMU
187 { 186 {
188 .ctl_name = 2,
189 .procname = "pin-cxnr", 187 .procname = "pin-cxnr",
190 .data = NULL, 188 .data = NULL,
191 .maxlen = 0, 189 .maxlen = 0,
@@ -203,7 +201,6 @@ static struct ctl_table frv_table[] =
203static struct ctl_table frv_dir_table[] = 201static struct ctl_table frv_dir_table[] =
204{ 202{
205 { 203 {
206 .ctl_name = CTL_FRV,
207 .procname = "frv", 204 .procname = "frv",
208 .mode = 0555, 205 .mode = 0555,
209 .child = frv_table 206 .child = frv_table
diff --git a/arch/ia64/ia32/ia32_entry.S b/arch/ia64/ia32/ia32_entry.S
index af9405cd70e5..10c37510f4b4 100644
--- a/arch/ia64/ia32/ia32_entry.S
+++ b/arch/ia64/ia32/ia32_entry.S
@@ -327,7 +327,7 @@ ia32_syscall_table:
327 data8 compat_sys_writev 327 data8 compat_sys_writev
328 data8 sys_getsid 328 data8 sys_getsid
329 data8 sys_fdatasync 329 data8 sys_fdatasync
330 data8 sys32_sysctl 330 data8 compat_sys_sysctl
331 data8 sys_mlock /* 150 */ 331 data8 sys_mlock /* 150 */
332 data8 sys_munlock 332 data8 sys_munlock
333 data8 sys_mlockall 333 data8 sys_mlockall
diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c
index 625ed8f76fce..429ec968c9ee 100644
--- a/arch/ia64/ia32/sys_ia32.c
+++ b/arch/ia64/ia32/sys_ia32.c
@@ -1628,61 +1628,6 @@ sys32_msync (unsigned int start, unsigned int len, int flags)
1628 return sys_msync(addr, len + (start - addr), flags); 1628 return sys_msync(addr, len + (start - addr), flags);
1629} 1629}
1630 1630
1631struct sysctl32 {
1632 unsigned int name;
1633 int nlen;
1634 unsigned int oldval;
1635 unsigned int oldlenp;
1636 unsigned int newval;
1637 unsigned int newlen;
1638 unsigned int __unused[4];
1639};
1640
1641#ifdef CONFIG_SYSCTL_SYSCALL
1642asmlinkage long
1643sys32_sysctl (struct sysctl32 __user *args)
1644{
1645 struct sysctl32 a32;
1646 mm_segment_t old_fs = get_fs ();
1647 void __user *oldvalp, *newvalp;
1648 size_t oldlen;
1649 int __user *namep;
1650 long ret;
1651
1652 if (copy_from_user(&a32, args, sizeof(a32)))
1653 return -EFAULT;
1654
1655 /*
1656 * We need to pre-validate these because we have to disable address checking
1657 * before calling do_sysctl() because of OLDLEN but we can't run the risk of the
1658 * user specifying bad addresses here. Well, since we're dealing with 32 bit
1659 * addresses, we KNOW that access_ok() will always succeed, so this is an
1660 * expensive NOP, but so what...
1661 */
1662 namep = (int __user *) compat_ptr(a32.name);
1663 oldvalp = compat_ptr(a32.oldval);
1664 newvalp = compat_ptr(a32.newval);
1665
1666 if ((oldvalp && get_user(oldlen, (int __user *) compat_ptr(a32.oldlenp)))
1667 || !access_ok(VERIFY_WRITE, namep, 0)
1668 || !access_ok(VERIFY_WRITE, oldvalp, 0)
1669 || !access_ok(VERIFY_WRITE, newvalp, 0))
1670 return -EFAULT;
1671
1672 set_fs(KERNEL_DS);
1673 lock_kernel();
1674 ret = do_sysctl(namep, a32.nlen, oldvalp, (size_t __user *) &oldlen,
1675 newvalp, (size_t) a32.newlen);
1676 unlock_kernel();
1677 set_fs(old_fs);
1678
1679 if (oldvalp && put_user (oldlen, (int __user *) compat_ptr(a32.oldlenp)))
1680 return -EFAULT;
1681
1682 return ret;
1683}
1684#endif
1685
1686asmlinkage long 1631asmlinkage long
1687sys32_newuname (struct new_utsname __user *name) 1632sys32_newuname (struct new_utsname __user *name)
1688{ 1633{
diff --git a/arch/ia64/kernel/crash.c b/arch/ia64/kernel/crash.c
index 6631a9dfafdc..7c7d6a6dc0f7 100644
--- a/arch/ia64/kernel/crash.c
+++ b/arch/ia64/kernel/crash.c
@@ -239,7 +239,6 @@ kdump_init_notifier(struct notifier_block *self, unsigned long val, void *data)
239#ifdef CONFIG_SYSCTL 239#ifdef CONFIG_SYSCTL
240static ctl_table kdump_ctl_table[] = { 240static ctl_table kdump_ctl_table[] = {
241 { 241 {
242 .ctl_name = CTL_UNNUMBERED,
243 .procname = "kdump_on_init", 242 .procname = "kdump_on_init",
244 .data = &kdump_on_init, 243 .data = &kdump_on_init,
245 .maxlen = sizeof(int), 244 .maxlen = sizeof(int),
@@ -247,24 +246,22 @@ static ctl_table kdump_ctl_table[] = {
247 .proc_handler = &proc_dointvec, 246 .proc_handler = &proc_dointvec,
248 }, 247 },
249 { 248 {
250 .ctl_name = CTL_UNNUMBERED,
251 .procname = "kdump_on_fatal_mca", 249 .procname = "kdump_on_fatal_mca",
252 .data = &kdump_on_fatal_mca, 250 .data = &kdump_on_fatal_mca,
253 .maxlen = sizeof(int), 251 .maxlen = sizeof(int),
254 .mode = 0644, 252 .mode = 0644,
255 .proc_handler = &proc_dointvec, 253 .proc_handler = &proc_dointvec,
256 }, 254 },
257 { .ctl_name = 0 } 255 { }
258}; 256};
259 257
260static ctl_table sys_table[] = { 258static ctl_table sys_table[] = {
261 { 259 {
262 .ctl_name = CTL_KERN,
263 .procname = "kernel", 260 .procname = "kernel",
264 .mode = 0555, 261 .mode = 0555,
265 .child = kdump_ctl_table, 262 .child = kdump_ctl_table,
266 }, 263 },
267 { .ctl_name = 0 } 264 { }
268}; 265};
269#endif 266#endif
270 267
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index f1782705b1f7..ca30b3646405 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -522,7 +522,6 @@ EXPORT_SYMBOL(pfm_sysctl);
522 522
523static ctl_table pfm_ctl_table[]={ 523static ctl_table pfm_ctl_table[]={
524 { 524 {
525 .ctl_name = CTL_UNNUMBERED,
526 .procname = "debug", 525 .procname = "debug",
527 .data = &pfm_sysctl.debug, 526 .data = &pfm_sysctl.debug,
528 .maxlen = sizeof(int), 527 .maxlen = sizeof(int),
@@ -530,7 +529,6 @@ static ctl_table pfm_ctl_table[]={
530 .proc_handler = &proc_dointvec, 529 .proc_handler = &proc_dointvec,
531 }, 530 },
532 { 531 {
533 .ctl_name = CTL_UNNUMBERED,
534 .procname = "debug_ovfl", 532 .procname = "debug_ovfl",
535 .data = &pfm_sysctl.debug_ovfl, 533 .data = &pfm_sysctl.debug_ovfl,
536 .maxlen = sizeof(int), 534 .maxlen = sizeof(int),
@@ -538,7 +536,6 @@ static ctl_table pfm_ctl_table[]={
538 .proc_handler = &proc_dointvec, 536 .proc_handler = &proc_dointvec,
539 }, 537 },
540 { 538 {
541 .ctl_name = CTL_UNNUMBERED,
542 .procname = "fastctxsw", 539 .procname = "fastctxsw",
543 .data = &pfm_sysctl.fastctxsw, 540 .data = &pfm_sysctl.fastctxsw,
544 .maxlen = sizeof(int), 541 .maxlen = sizeof(int),
@@ -546,7 +543,6 @@ static ctl_table pfm_ctl_table[]={
546 .proc_handler = &proc_dointvec, 543 .proc_handler = &proc_dointvec,
547 }, 544 },
548 { 545 {
549 .ctl_name = CTL_UNNUMBERED,
550 .procname = "expert_mode", 546 .procname = "expert_mode",
551 .data = &pfm_sysctl.expert_mode, 547 .data = &pfm_sysctl.expert_mode,
552 .maxlen = sizeof(int), 548 .maxlen = sizeof(int),
@@ -557,7 +553,6 @@ static ctl_table pfm_ctl_table[]={
557}; 553};
558static ctl_table pfm_sysctl_dir[] = { 554static ctl_table pfm_sysctl_dir[] = {
559 { 555 {
560 .ctl_name = CTL_UNNUMBERED,
561 .procname = "perfmon", 556 .procname = "perfmon",
562 .mode = 0555, 557 .mode = 0555,
563 .child = pfm_ctl_table, 558 .child = pfm_ctl_table,
@@ -566,7 +561,6 @@ static ctl_table pfm_sysctl_dir[] = {
566}; 561};
567static ctl_table pfm_sysctl_root[] = { 562static ctl_table pfm_sysctl_root[] = {
568 { 563 {
569 .ctl_name = CTL_KERN,
570 .procname = "kernel", 564 .procname = "kernel",
571 .mode = 0555, 565 .mode = 0555,
572 .child = pfm_sysctl_dir, 566 .child = pfm_sysctl_dir,
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c
index b77fefaff9da..1a2793efdc4e 100644
--- a/arch/mips/kernel/linux32.c
+++ b/arch/mips/kernel/linux32.c
@@ -265,67 +265,6 @@ SYSCALL_DEFINE5(n32_msgrcv, int, msqid, u32, msgp, size_t, msgsz,
265} 265}
266#endif 266#endif
267 267
268struct sysctl_args32
269{
270 compat_caddr_t name;
271 int nlen;
272 compat_caddr_t oldval;
273 compat_caddr_t oldlenp;
274 compat_caddr_t newval;
275 compat_size_t newlen;
276 unsigned int __unused[4];
277};
278
279#ifdef CONFIG_SYSCTL_SYSCALL
280
281SYSCALL_DEFINE1(32_sysctl, struct sysctl_args32 __user *, args)
282{
283 struct sysctl_args32 tmp;
284 int error;
285 size_t oldlen;
286 size_t __user *oldlenp = NULL;
287 unsigned long addr = (((unsigned long)&args->__unused[0]) + 7) & ~7;
288
289 if (copy_from_user(&tmp, args, sizeof(tmp)))
290 return -EFAULT;
291
292 if (tmp.oldval && tmp.oldlenp) {
293 /* Duh, this is ugly and might not work if sysctl_args
294 is in read-only memory, but do_sysctl does indirectly
295 a lot of uaccess in both directions and we'd have to
296 basically copy the whole sysctl.c here, and
297 glibc's __sysctl uses rw memory for the structure
298 anyway. */
299 if (get_user(oldlen, (u32 __user *)A(tmp.oldlenp)) ||
300 put_user(oldlen, (size_t __user *)addr))
301 return -EFAULT;
302 oldlenp = (size_t __user *)addr;
303 }
304
305 lock_kernel();
306 error = do_sysctl((int __user *)A(tmp.name), tmp.nlen, (void __user *)A(tmp.oldval),
307 oldlenp, (void __user *)A(tmp.newval), tmp.newlen);
308 unlock_kernel();
309 if (oldlenp) {
310 if (!error) {
311 if (get_user(oldlen, (size_t __user *)addr) ||
312 put_user(oldlen, (u32 __user *)A(tmp.oldlenp)))
313 error = -EFAULT;
314 }
315 copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused));
316 }
317 return error;
318}
319
320#else
321
322SYSCALL_DEFINE1(32_sysctl, struct sysctl_args32 __user *, args)
323{
324 return -ENOSYS;
325}
326
327#endif /* CONFIG_SYSCTL_SYSCALL */
328
329SYSCALL_DEFINE1(32_newuname, struct new_utsname __user *, name) 268SYSCALL_DEFINE1(32_newuname, struct new_utsname __user *, name)
330{ 269{
331 int ret = 0; 270 int ret = 0;
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S
index 6ebc07976694..8a0be0bdebad 100644
--- a/arch/mips/kernel/scall64-n32.S
+++ b/arch/mips/kernel/scall64-n32.S
@@ -272,7 +272,7 @@ EXPORT(sysn32_call_table)
272 PTR sys_munlockall 272 PTR sys_munlockall
273 PTR sys_vhangup /* 6150 */ 273 PTR sys_vhangup /* 6150 */
274 PTR sys_pivot_root 274 PTR sys_pivot_root
275 PTR sys_32_sysctl 275 PTR compat_sys_sysctl
276 PTR sys_prctl 276 PTR sys_prctl
277 PTR compat_sys_adjtimex 277 PTR compat_sys_adjtimex
278 PTR compat_sys_setrlimit /* 6155 */ 278 PTR compat_sys_setrlimit /* 6155 */
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S
index 14dde4ca932e..41dbdb7d67e5 100644
--- a/arch/mips/kernel/scall64-o32.S
+++ b/arch/mips/kernel/scall64-o32.S
@@ -356,7 +356,7 @@ sys_call_table:
356 PTR sys_ni_syscall /* 4150 */ 356 PTR sys_ni_syscall /* 4150 */
357 PTR sys_getsid 357 PTR sys_getsid
358 PTR sys_fdatasync 358 PTR sys_fdatasync
359 PTR sys_32_sysctl 359 PTR compat_sys_sysctl
360 PTR sys_mlock 360 PTR sys_mlock
361 PTR sys_munlock /* 4155 */ 361 PTR sys_munlock /* 4155 */
362 PTR sys_mlockall 362 PTR sys_mlockall
diff --git a/arch/mips/lasat/sysctl.c b/arch/mips/lasat/sysctl.c
index b3deed8db619..1dbdd76a8c04 100644
--- a/arch/mips/lasat/sysctl.c
+++ b/arch/mips/lasat/sysctl.c
@@ -37,23 +37,6 @@
37#include "ds1603.h" 37#include "ds1603.h"
38#endif 38#endif
39 39
40/* Strategy function to write EEPROM after changing string entry */
41int sysctl_lasatstring(ctl_table *table,
42 void *oldval, size_t *oldlenp,
43 void *newval, size_t newlen)
44{
45 int r;
46
47 r = sysctl_string(table, oldval, oldlenp, newval, newlen);
48 if (r < 0)
49 return r;
50
51 if (newval && newlen)
52 lasat_write_eeprom_info();
53
54 return 0;
55}
56
57 40
58/* And the same for proc */ 41/* And the same for proc */
59int proc_dolasatstring(ctl_table *table, int write, 42int proc_dolasatstring(ctl_table *table, int write,
@@ -113,46 +96,6 @@ int proc_dolasatrtc(ctl_table *table, int write,
113} 96}
114#endif 97#endif
115 98
116/* Sysctl for setting the IP addresses */
117int sysctl_lasat_intvec(ctl_table *table,
118 void *oldval, size_t *oldlenp,
119 void *newval, size_t newlen)
120{
121 int r;
122
123 r = sysctl_intvec(table, oldval, oldlenp, newval, newlen);
124 if (r < 0)
125 return r;
126
127 if (newval && newlen)
128 lasat_write_eeprom_info();
129
130 return 0;
131}
132
133#ifdef CONFIG_DS1603
134/* Same for RTC */
135int sysctl_lasat_rtc(ctl_table *table,
136 void *oldval, size_t *oldlenp,
137 void *newval, size_t newlen)
138{
139 struct timespec ts;
140 int r;
141
142 read_persistent_clock(&ts);
143 rtctmp = ts.tv_sec;
144 if (rtctmp < 0)
145 rtctmp = 0;
146 r = sysctl_intvec(table, oldval, oldlenp, newval, newlen);
147 if (r < 0)
148 return r;
149 if (newval && newlen)
150 rtc_mips_set_mmss(rtctmp);
151
152 return r;
153}
154#endif
155
156#ifdef CONFIG_INET 99#ifdef CONFIG_INET
157int proc_lasat_ip(ctl_table *table, int write, 100int proc_lasat_ip(ctl_table *table, int write,
158 void *buffer, size_t *lenp, loff_t *ppos) 101 void *buffer, size_t *lenp, loff_t *ppos)
@@ -214,23 +157,6 @@ int proc_lasat_ip(ctl_table *table, int write,
214} 157}
215#endif 158#endif
216 159
217static int sysctl_lasat_prid(ctl_table *table,
218 void *oldval, size_t *oldlenp,
219 void *newval, size_t newlen)
220{
221 int r;
222
223 r = sysctl_intvec(table, oldval, oldlenp, newval, newlen);
224 if (r < 0)
225 return r;
226 if (newval && newlen) {
227 lasat_board_info.li_eeprom_info.prid = *(int *)newval;
228 lasat_write_eeprom_info();
229 lasat_init_board_info();
230 }
231 return 0;
232}
233
234int proc_lasat_prid(ctl_table *table, int write, 160int proc_lasat_prid(ctl_table *table, int write,
235 void *buffer, size_t *lenp, loff_t *ppos) 161 void *buffer, size_t *lenp, loff_t *ppos)
236{ 162{
@@ -252,115 +178,92 @@ extern int lasat_boot_to_service;
252 178
253static ctl_table lasat_table[] = { 179static ctl_table lasat_table[] = {
254 { 180 {
255 .ctl_name = CTL_UNNUMBERED,
256 .procname = "cpu-hz", 181 .procname = "cpu-hz",
257 .data = &lasat_board_info.li_cpu_hz, 182 .data = &lasat_board_info.li_cpu_hz,
258 .maxlen = sizeof(int), 183 .maxlen = sizeof(int),
259 .mode = 0444, 184 .mode = 0444,
260 .proc_handler = &proc_dointvec, 185 .proc_handler = &proc_dointvec,
261 .strategy = &sysctl_intvec
262 }, 186 },
263 { 187 {
264 .ctl_name = CTL_UNNUMBERED,
265 .procname = "bus-hz", 188 .procname = "bus-hz",
266 .data = &lasat_board_info.li_bus_hz, 189 .data = &lasat_board_info.li_bus_hz,
267 .maxlen = sizeof(int), 190 .maxlen = sizeof(int),
268 .mode = 0444, 191 .mode = 0444,
269 .proc_handler = &proc_dointvec, 192 .proc_handler = &proc_dointvec,
270 .strategy = &sysctl_intvec
271 }, 193 },
272 { 194 {
273 .ctl_name = CTL_UNNUMBERED,
274 .procname = "bmid", 195 .procname = "bmid",
275 .data = &lasat_board_info.li_bmid, 196 .data = &lasat_board_info.li_bmid,
276 .maxlen = sizeof(int), 197 .maxlen = sizeof(int),
277 .mode = 0444, 198 .mode = 0444,
278 .proc_handler = &proc_dointvec, 199 .proc_handler = &proc_dointvec,
279 .strategy = &sysctl_intvec
280 }, 200 },
281 { 201 {
282 .ctl_name = CTL_UNNUMBERED,
283 .procname = "prid", 202 .procname = "prid",
284 .data = &lasat_board_info.li_prid, 203 .data = &lasat_board_info.li_prid,
285 .maxlen = sizeof(int), 204 .maxlen = sizeof(int),
286 .mode = 0644, 205 .mode = 0644,
287 .proc_handler = &proc_lasat_prid, 206 .proc_handler = &proc_lasat_prid,
288 .strategy = &sysctl_lasat_prid 207. },
289 },
290#ifdef CONFIG_INET 208#ifdef CONFIG_INET
291 { 209 {
292 .ctl_name = CTL_UNNUMBERED,
293 .procname = "ipaddr", 210 .procname = "ipaddr",
294 .data = &lasat_board_info.li_eeprom_info.ipaddr, 211 .data = &lasat_board_info.li_eeprom_info.ipaddr,
295 .maxlen = sizeof(int), 212 .maxlen = sizeof(int),
296 .mode = 0644, 213 .mode = 0644,
297 .proc_handler = &proc_lasat_ip, 214 .proc_handler = &proc_lasat_ip,
298 .strategy = &sysctl_lasat_intvec
299 }, 215 },
300 { 216 {
301 .ctl_name = CTL_UNNUMBERED,
302 .procname = "netmask", 217 .procname = "netmask",
303 .data = &lasat_board_info.li_eeprom_info.netmask, 218 .data = &lasat_board_info.li_eeprom_info.netmask,
304 .maxlen = sizeof(int), 219 .maxlen = sizeof(int),
305 .mode = 0644, 220 .mode = 0644,
306 .proc_handler = &proc_lasat_ip, 221 .proc_handler = &proc_lasat_ip,
307 .strategy = &sysctl_lasat_intvec
308 }, 222 },
309#endif 223#endif
310 { 224 {
311 .ctl_name = CTL_UNNUMBERED,
312 .procname = "passwd_hash", 225 .procname = "passwd_hash",
313 .data = &lasat_board_info.li_eeprom_info.passwd_hash, 226 .data = &lasat_board_info.li_eeprom_info.passwd_hash,
314 .maxlen = 227 .maxlen =
315 sizeof(lasat_board_info.li_eeprom_info.passwd_hash), 228 sizeof(lasat_board_info.li_eeprom_info.passwd_hash),
316 .mode = 0600, 229 .mode = 0600,
317 .proc_handler = &proc_dolasatstring, 230 .proc_handler = &proc_dolasatstring,
318 .strategy = &sysctl_lasatstring
319 }, 231 },
320 { 232 {
321 .ctl_name = CTL_UNNUMBERED,
322 .procname = "boot-service", 233 .procname = "boot-service",
323 .data = &lasat_boot_to_service, 234 .data = &lasat_boot_to_service,
324 .maxlen = sizeof(int), 235 .maxlen = sizeof(int),
325 .mode = 0644, 236 .mode = 0644,
326 .proc_handler = &proc_dointvec, 237 .proc_handler = &proc_dointvec,
327 .strategy = &sysctl_intvec
328 }, 238 },
329#ifdef CONFIG_DS1603 239#ifdef CONFIG_DS1603
330 { 240 {
331 .ctl_name = CTL_UNNUMBERED,
332 .procname = "rtc", 241 .procname = "rtc",
333 .data = &rtctmp, 242 .data = &rtctmp,
334 .maxlen = sizeof(int), 243 .maxlen = sizeof(int),
335 .mode = 0644, 244 .mode = 0644,
336 .proc_handler = &proc_dolasatrtc, 245 .proc_handler = &proc_dolasatrtc,
337 .strategy = &sysctl_lasat_rtc
338 }, 246 },
339#endif 247#endif
340 { 248 {
341 .ctl_name = CTL_UNNUMBERED,
342 .procname = "namestr", 249 .procname = "namestr",
343 .data = &lasat_board_info.li_namestr, 250 .data = &lasat_board_info.li_namestr,
344 .maxlen = sizeof(lasat_board_info.li_namestr), 251 .maxlen = sizeof(lasat_board_info.li_namestr),
345 .mode = 0444, 252 .mode = 0444,
346 .proc_handler = &proc_dostring, 253 .proc_handler = &proc_dostring,
347 .strategy = &sysctl_string
348 }, 254 },
349 { 255 {
350 .ctl_name = CTL_UNNUMBERED,
351 .procname = "typestr", 256 .procname = "typestr",
352 .data = &lasat_board_info.li_typestr, 257 .data = &lasat_board_info.li_typestr,
353 .maxlen = sizeof(lasat_board_info.li_typestr), 258 .maxlen = sizeof(lasat_board_info.li_typestr),
354 .mode = 0444, 259 .mode = 0444,
355 .proc_handler = &proc_dostring, 260 .proc_handler = &proc_dostring,
356 .strategy = &sysctl_string
357 }, 261 },
358 {} 262 {}
359}; 263};
360 264
361static ctl_table lasat_root_table[] = { 265static ctl_table lasat_root_table[] = {
362 { 266 {
363 .ctl_name = CTL_UNNUMBERED,
364 .procname = "lasat", 267 .procname = "lasat",
365 .mode = 0555, 268 .mode = 0555,
366 .child = lasat_table 269 .child = lasat_table
diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c
index 561388b17c91..76d23ec8dfaa 100644
--- a/arch/parisc/kernel/sys_parisc32.c
+++ b/arch/parisc/kernel/sys_parisc32.c
@@ -90,77 +90,6 @@ asmlinkage long sys32_unimplemented(int r26, int r25, int r24, int r23,
90 return -ENOSYS; 90 return -ENOSYS;
91} 91}
92 92
93#ifdef CONFIG_SYSCTL
94
95struct __sysctl_args32 {
96 u32 name;
97 int nlen;
98 u32 oldval;
99 u32 oldlenp;
100 u32 newval;
101 u32 newlen;
102 u32 __unused[4];
103};
104
105asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
106{
107#ifndef CONFIG_SYSCTL_SYSCALL
108 return -ENOSYS;
109#else
110 struct __sysctl_args32 tmp;
111 int error;
112 unsigned int oldlen32;
113 size_t oldlen, __user *oldlenp = NULL;
114 unsigned long addr = (((long __force)&args->__unused[0]) + 7) & ~7;
115
116 DBG(("sysctl32(%p)\n", args));
117
118 if (copy_from_user(&tmp, args, sizeof(tmp)))
119 return -EFAULT;
120
121 if (tmp.oldval && tmp.oldlenp) {
122 /* Duh, this is ugly and might not work if sysctl_args
123 is in read-only memory, but do_sysctl does indirectly
124 a lot of uaccess in both directions and we'd have to
125 basically copy the whole sysctl.c here, and
126 glibc's __sysctl uses rw memory for the structure
127 anyway. */
128 /* a possibly better hack than this, which will avoid the
129 * problem if the struct is read only, is to push the
130 * 'oldlen' value out to the user's stack instead. -PB
131 */
132 if (get_user(oldlen32, (u32 *)(u64)tmp.oldlenp))
133 return -EFAULT;
134 oldlen = oldlen32;
135 if (put_user(oldlen, (size_t *)addr))
136 return -EFAULT;
137 oldlenp = (size_t *)addr;
138 }
139
140 lock_kernel();
141 error = do_sysctl((int __user *)(u64)tmp.name, tmp.nlen,
142 (void __user *)(u64)tmp.oldval, oldlenp,
143 (void __user *)(u64)tmp.newval, tmp.newlen);
144 unlock_kernel();
145 if (oldlenp) {
146 if (!error) {
147 if (get_user(oldlen, (size_t *)addr)) {
148 error = -EFAULT;
149 } else {
150 oldlen32 = oldlen;
151 if (put_user(oldlen32, (u32 *)(u64)tmp.oldlenp))
152 error = -EFAULT;
153 }
154 }
155 if (copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused)))
156 error = -EFAULT;
157 }
158 return error;
159#endif
160}
161
162#endif /* CONFIG_SYSCTL */
163
164asmlinkage long sys32_sched_rr_get_interval(pid_t pid, 93asmlinkage long sys32_sched_rr_get_interval(pid_t pid,
165 struct compat_timespec __user *interval) 94 struct compat_timespec __user *interval)
166{ 95{
diff --git a/arch/parisc/kernel/syscall_table.S b/arch/parisc/kernel/syscall_table.S
index 843f423dec67..01c4fcf8f481 100644
--- a/arch/parisc/kernel/syscall_table.S
+++ b/arch/parisc/kernel/syscall_table.S
@@ -234,7 +234,7 @@
234 ENTRY_SAME(getsid) 234 ENTRY_SAME(getsid)
235 ENTRY_SAME(fdatasync) 235 ENTRY_SAME(fdatasync)
236 /* struct __sysctl_args is a mess */ 236 /* struct __sysctl_args is a mess */
237 ENTRY_DIFF(sysctl) 237 ENTRY_COMP(sysctl)
238 ENTRY_SAME(mlock) /* 150 */ 238 ENTRY_SAME(mlock) /* 150 */
239 ENTRY_SAME(munlock) 239 ENTRY_SAME(munlock)
240 ENTRY_SAME(mlockall) 240 ENTRY_SAME(mlockall)
diff --git a/arch/powerpc/kernel/idle.c b/arch/powerpc/kernel/idle.c
index 88d9c1d5e5fb..cece9e2cc5e4 100644
--- a/arch/powerpc/kernel/idle.c
+++ b/arch/powerpc/kernel/idle.c
@@ -110,7 +110,6 @@ int powersave_nap;
110 */ 110 */
111static ctl_table powersave_nap_ctl_table[]={ 111static ctl_table powersave_nap_ctl_table[]={
112 { 112 {
113 .ctl_name = KERN_PPC_POWERSAVE_NAP,
114 .procname = "powersave-nap", 113 .procname = "powersave-nap",
115 .data = &powersave_nap, 114 .data = &powersave_nap,
116 .maxlen = sizeof(int), 115 .maxlen = sizeof(int),
@@ -121,7 +120,6 @@ static ctl_table powersave_nap_ctl_table[]={
121}; 120};
122static ctl_table powersave_nap_sysctl_root[] = { 121static ctl_table powersave_nap_sysctl_root[] = {
123 { 122 {
124 .ctl_name = CTL_KERN,
125 .procname = "kernel", 123 .procname = "kernel",
126 .mode = 0555, 124 .mode = 0555,
127 .child = powersave_nap_ctl_table, 125 .child = powersave_nap_ctl_table,
diff --git a/arch/powerpc/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c
index b97c2d67f4ac..c5a4732bcc48 100644
--- a/arch/powerpc/kernel/sys_ppc32.c
+++ b/arch/powerpc/kernel/sys_ppc32.c
@@ -520,58 +520,6 @@ asmlinkage long compat_sys_umask(u32 mask)
520 return sys_umask((int)mask); 520 return sys_umask((int)mask);
521} 521}
522 522
523#ifdef CONFIG_SYSCTL_SYSCALL
524struct __sysctl_args32 {
525 u32 name;
526 int nlen;
527 u32 oldval;
528 u32 oldlenp;
529 u32 newval;
530 u32 newlen;
531 u32 __unused[4];
532};
533
534asmlinkage long compat_sys_sysctl(struct __sysctl_args32 __user *args)
535{
536 struct __sysctl_args32 tmp;
537 int error;
538 size_t oldlen;
539 size_t __user *oldlenp = NULL;
540 unsigned long addr = (((unsigned long)&args->__unused[0]) + 7) & ~7;
541
542 if (copy_from_user(&tmp, args, sizeof(tmp)))
543 return -EFAULT;
544
545 if (tmp.oldval && tmp.oldlenp) {
546 /* Duh, this is ugly and might not work if sysctl_args
547 is in read-only memory, but do_sysctl does indirectly
548 a lot of uaccess in both directions and we'd have to
549 basically copy the whole sysctl.c here, and
550 glibc's __sysctl uses rw memory for the structure
551 anyway. */
552 oldlenp = (size_t __user *)addr;
553 if (get_user(oldlen, (compat_size_t __user *)compat_ptr(tmp.oldlenp)) ||
554 put_user(oldlen, oldlenp))
555 return -EFAULT;
556 }
557
558 lock_kernel();
559 error = do_sysctl(compat_ptr(tmp.name), tmp.nlen,
560 compat_ptr(tmp.oldval), oldlenp,
561 compat_ptr(tmp.newval), tmp.newlen);
562 unlock_kernel();
563 if (oldlenp) {
564 if (!error) {
565 if (get_user(oldlen, oldlenp) ||
566 put_user(oldlen, (compat_size_t __user *)compat_ptr(tmp.oldlenp)))
567 error = -EFAULT;
568 }
569 copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused));
570 }
571 return error;
572}
573#endif
574
575unsigned long compat_sys_mmap2(unsigned long addr, size_t len, 523unsigned long compat_sys_mmap2(unsigned long addr, size_t len,
576 unsigned long prot, unsigned long flags, 524 unsigned long prot, unsigned long flags,
577 unsigned long fd, unsigned long pgoff) 525 unsigned long fd, unsigned long pgoff)
diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c
index 0debcec23a39..fda1a8123f9b 100644
--- a/arch/s390/kernel/compat_linux.c
+++ b/arch/s390/kernel/compat_linux.c
@@ -527,59 +527,6 @@ asmlinkage long sys32_sendfile64(int out_fd, int in_fd,
527 return ret; 527 return ret;
528} 528}
529 529
530#ifdef CONFIG_SYSCTL_SYSCALL
531struct __sysctl_args32 {
532 u32 name;
533 int nlen;
534 u32 oldval;
535 u32 oldlenp;
536 u32 newval;
537 u32 newlen;
538 u32 __unused[4];
539};
540
541asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
542{
543 struct __sysctl_args32 tmp;
544 int error;
545 size_t oldlen;
546 size_t __user *oldlenp = NULL;
547 unsigned long addr = (((unsigned long)&args->__unused[0]) + 7) & ~7;
548
549 if (copy_from_user(&tmp, args, sizeof(tmp)))
550 return -EFAULT;
551
552 if (tmp.oldval && tmp.oldlenp) {
553 /* Duh, this is ugly and might not work if sysctl_args
554 is in read-only memory, but do_sysctl does indirectly
555 a lot of uaccess in both directions and we'd have to
556 basically copy the whole sysctl.c here, and
557 glibc's __sysctl uses rw memory for the structure
558 anyway. */
559 if (get_user(oldlen, (u32 __user *)compat_ptr(tmp.oldlenp)) ||
560 put_user(oldlen, (size_t __user *)addr))
561 return -EFAULT;
562 oldlenp = (size_t __user *)addr;
563 }
564
565 lock_kernel();
566 error = do_sysctl(compat_ptr(tmp.name), tmp.nlen, compat_ptr(tmp.oldval),
567 oldlenp, compat_ptr(tmp.newval), tmp.newlen);
568 unlock_kernel();
569 if (oldlenp) {
570 if (!error) {
571 if (get_user(oldlen, (size_t __user *)addr) ||
572 put_user(oldlen, (u32 __user *)compat_ptr(tmp.oldlenp)))
573 error = -EFAULT;
574 }
575 if (copy_to_user(args->__unused, tmp.__unused,
576 sizeof(tmp.__unused)))
577 error = -EFAULT;
578 }
579 return error;
580}
581#endif
582
583struct stat64_emu31 { 530struct stat64_emu31 {
584 unsigned long long st_dev; 531 unsigned long long st_dev;
585 unsigned int __pad1; 532 unsigned int __pad1;
diff --git a/arch/s390/kernel/compat_linux.h b/arch/s390/kernel/compat_linux.h
index c07f9ca05ade..45e9092b3aad 100644
--- a/arch/s390/kernel/compat_linux.h
+++ b/arch/s390/kernel/compat_linux.h
@@ -162,7 +162,6 @@ struct ucontext32 {
162 compat_sigset_t uc_sigmask; /* mask last for extensibility */ 162 compat_sigset_t uc_sigmask; /* mask last for extensibility */
163}; 163};
164 164
165struct __sysctl_args32;
166struct stat64_emu31; 165struct stat64_emu31;
167struct mmap_arg_struct_emu31; 166struct mmap_arg_struct_emu31;
168struct fadvise64_64_args; 167struct fadvise64_64_args;
@@ -212,7 +211,6 @@ long sys32_sendfile(int out_fd, int in_fd, compat_off_t __user *offset,
212 size_t count); 211 size_t count);
213long sys32_sendfile64(int out_fd, int in_fd, compat_loff_t __user *offset, 212long sys32_sendfile64(int out_fd, int in_fd, compat_loff_t __user *offset,
214 s32 count); 213 s32 count);
215long sys32_sysctl(struct __sysctl_args32 __user *args);
216long sys32_stat64(char __user * filename, struct stat64_emu31 __user * statbuf); 214long sys32_stat64(char __user * filename, struct stat64_emu31 __user * statbuf);
217long sys32_lstat64(char __user * filename, 215long sys32_lstat64(char __user * filename,
218 struct stat64_emu31 __user * statbuf); 216 struct stat64_emu31 __user * statbuf);
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
index cbd9901dc0f8..30de2d0e52bb 100644
--- a/arch/s390/kernel/compat_wrapper.S
+++ b/arch/s390/kernel/compat_wrapper.S
@@ -689,8 +689,6 @@ sys32_fdatasync_wrapper:
689 llgfr %r2,%r2 # unsigned int 689 llgfr %r2,%r2 # unsigned int
690 jg sys_fdatasync # branch to system call 690 jg sys_fdatasync # branch to system call
691 691
692#sys32_sysctl_wrapper # tbd
693
694 .globl sys32_mlock_wrapper 692 .globl sys32_mlock_wrapper
695sys32_mlock_wrapper: 693sys32_mlock_wrapper:
696 llgfr %r2,%r2 # unsigned long 694 llgfr %r2,%r2 # unsigned long
@@ -1087,8 +1085,8 @@ sys32_stime_wrapper:
1087 1085
1088 .globl sys32_sysctl_wrapper 1086 .globl sys32_sysctl_wrapper
1089sys32_sysctl_wrapper: 1087sys32_sysctl_wrapper:
1090 llgtr %r2,%r2 # struct __sysctl_args32 * 1088 llgtr %r2,%r2 # struct compat_sysctl_args *
1091 jg sys32_sysctl 1089 jg compat_sys_sysctl
1092 1090
1093 .globl sys32_fstat64_wrapper 1091 .globl sys32_fstat64_wrapper
1094sys32_fstat64_wrapper: 1092sys32_fstat64_wrapper:
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c
index 20f282c911c2..adf11260260a 100644
--- a/arch/s390/kernel/debug.c
+++ b/arch/s390/kernel/debug.c
@@ -893,35 +893,30 @@ s390dbf_procactive(ctl_table *table, int write,
893 893
894static struct ctl_table s390dbf_table[] = { 894static struct ctl_table s390dbf_table[] = {
895 { 895 {
896 .ctl_name = CTL_S390DBF_STOPPABLE,
897 .procname = "debug_stoppable", 896 .procname = "debug_stoppable",
898 .data = &debug_stoppable, 897 .data = &debug_stoppable,
899 .maxlen = sizeof(int), 898 .maxlen = sizeof(int),
900 .mode = S_IRUGO | S_IWUSR, 899 .mode = S_IRUGO | S_IWUSR,
901 .proc_handler = &proc_dointvec, 900 .proc_handler = &proc_dointvec,
902 .strategy = &sysctl_intvec,
903 }, 901 },
904 { 902 {
905 .ctl_name = CTL_S390DBF_ACTIVE,
906 .procname = "debug_active", 903 .procname = "debug_active",
907 .data = &debug_active, 904 .data = &debug_active,
908 .maxlen = sizeof(int), 905 .maxlen = sizeof(int),
909 .mode = S_IRUGO | S_IWUSR, 906 .mode = S_IRUGO | S_IWUSR,
910 .proc_handler = &s390dbf_procactive, 907 .proc_handler = &s390dbf_procactive,
911 .strategy = &sysctl_intvec,
912 }, 908 },
913 { .ctl_name = 0 } 909 { }
914}; 910};
915 911
916static struct ctl_table s390dbf_dir_table[] = { 912static struct ctl_table s390dbf_dir_table[] = {
917 { 913 {
918 .ctl_name = CTL_S390DBF,
919 .procname = "s390dbf", 914 .procname = "s390dbf",
920 .maxlen = 0, 915 .maxlen = 0,
921 .mode = S_IRUGO | S_IXUGO, 916 .mode = S_IRUGO | S_IXUGO,
922 .child = s390dbf_table, 917 .child = s390dbf_table,
923 }, 918 },
924 { .ctl_name = 0 } 919 { }
925}; 920};
926 921
927static struct ctl_table_header *s390dbf_sysctl_header; 922static struct ctl_table_header *s390dbf_sysctl_header;
diff --git a/arch/s390/mm/cmm.c b/arch/s390/mm/cmm.c
index b201135cc18c..dab3e4a7582e 100644
--- a/arch/s390/mm/cmm.c
+++ b/arch/s390/mm/cmm.c
@@ -355,18 +355,17 @@ static struct ctl_table cmm_table[] = {
355 .mode = 0644, 355 .mode = 0644,
356 .proc_handler = &cmm_timeout_handler, 356 .proc_handler = &cmm_timeout_handler,
357 }, 357 },
358 { .ctl_name = 0 } 358 { }
359}; 359};
360 360
361static struct ctl_table cmm_dir_table[] = { 361static struct ctl_table cmm_dir_table[] = {
362 { 362 {
363 .ctl_name = CTL_VM,
364 .procname = "vm", 363 .procname = "vm",
365 .maxlen = 0, 364 .maxlen = 0,
366 .mode = 0555, 365 .mode = 0555,
367 .child = cmm_table, 366 .child = cmm_table,
368 }, 367 },
369 { .ctl_name = 0 } 368 { }
370}; 369};
371#endif 370#endif
372 371
diff --git a/arch/sh/kernel/traps_64.c b/arch/sh/kernel/traps_64.c
index 267e5ebbb475..080c8ee2d862 100644
--- a/arch/sh/kernel/traps_64.c
+++ b/arch/sh/kernel/traps_64.c
@@ -877,7 +877,6 @@ static int misaligned_fixup(struct pt_regs *regs)
877 877
878static ctl_table unaligned_table[] = { 878static ctl_table unaligned_table[] = {
879 { 879 {
880 .ctl_name = CTL_UNNUMBERED,
881 .procname = "kernel_reports", 880 .procname = "kernel_reports",
882 .data = &kernel_mode_unaligned_fixup_count, 881 .data = &kernel_mode_unaligned_fixup_count,
883 .maxlen = sizeof(int), 882 .maxlen = sizeof(int),
@@ -885,7 +884,6 @@ static ctl_table unaligned_table[] = {
885 .proc_handler = &proc_dointvec 884 .proc_handler = &proc_dointvec
886 }, 885 },
887 { 886 {
888 .ctl_name = CTL_UNNUMBERED,
889 .procname = "user_reports", 887 .procname = "user_reports",
890 .data = &user_mode_unaligned_fixup_count, 888 .data = &user_mode_unaligned_fixup_count,
891 .maxlen = sizeof(int), 889 .maxlen = sizeof(int),
@@ -893,7 +891,6 @@ static ctl_table unaligned_table[] = {
893 .proc_handler = &proc_dointvec 891 .proc_handler = &proc_dointvec
894 }, 892 },
895 { 893 {
896 .ctl_name = CTL_UNNUMBERED,
897 .procname = "user_enable", 894 .procname = "user_enable",
898 .data = &user_mode_unaligned_fixup_enable, 895 .data = &user_mode_unaligned_fixup_enable,
899 .maxlen = sizeof(int), 896 .maxlen = sizeof(int),
@@ -904,17 +901,15 @@ static ctl_table unaligned_table[] = {
904 901
905static ctl_table unaligned_root[] = { 902static ctl_table unaligned_root[] = {
906 { 903 {
907 .ctl_name = CTL_UNNUMBERED,
908 .procname = "unaligned_fixup", 904 .procname = "unaligned_fixup",
909 .mode = 0555, 905 .mode = 0555,
910 unaligned_table 906 .child = unaligned_table
911 }, 907 },
912 {} 908 {}
913}; 909};
914 910
915static ctl_table sh64_root[] = { 911static ctl_table sh64_root[] = {
916 { 912 {
917 .ctl_name = CTL_UNNUMBERED,
918 .procname = "sh64", 913 .procname = "sh64",
919 .mode = 0555, 914 .mode = 0555,
920 .child = unaligned_root 915 .child = unaligned_root
diff --git a/arch/sparc/kernel/sys_sparc32.c b/arch/sparc/kernel/sys_sparc32.c
index 04e28b2671c8..f862372074bc 100644
--- a/arch/sparc/kernel/sys_sparc32.c
+++ b/arch/sparc/kernel/sys_sparc32.c
@@ -591,63 +591,6 @@ out:
591 return ret; 591 return ret;
592} 592}
593 593
594struct __sysctl_args32 {
595 u32 name;
596 int nlen;
597 u32 oldval;
598 u32 oldlenp;
599 u32 newval;
600 u32 newlen;
601 u32 __unused[4];
602};
603
604asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
605{
606#ifndef CONFIG_SYSCTL_SYSCALL
607 return -ENOSYS;
608#else
609 struct __sysctl_args32 tmp;
610 int error;
611 size_t oldlen, __user *oldlenp = NULL;
612 unsigned long addr = (((unsigned long)&args->__unused[0]) + 7UL) & ~7UL;
613
614 if (copy_from_user(&tmp, args, sizeof(tmp)))
615 return -EFAULT;
616
617 if (tmp.oldval && tmp.oldlenp) {
618 /* Duh, this is ugly and might not work if sysctl_args
619 is in read-only memory, but do_sysctl does indirectly
620 a lot of uaccess in both directions and we'd have to
621 basically copy the whole sysctl.c here, and
622 glibc's __sysctl uses rw memory for the structure
623 anyway. */
624 if (get_user(oldlen, (u32 __user *)(unsigned long)tmp.oldlenp) ||
625 put_user(oldlen, (size_t __user *)addr))
626 return -EFAULT;
627 oldlenp = (size_t __user *)addr;
628 }
629
630 lock_kernel();
631 error = do_sysctl((int __user *)(unsigned long) tmp.name,
632 tmp.nlen,
633 (void __user *)(unsigned long) tmp.oldval,
634 oldlenp,
635 (void __user *)(unsigned long) tmp.newval,
636 tmp.newlen);
637 unlock_kernel();
638 if (oldlenp) {
639 if (!error) {
640 if (get_user(oldlen, (size_t __user *)addr) ||
641 put_user(oldlen, (u32 __user *)(unsigned long) tmp.oldlenp))
642 error = -EFAULT;
643 }
644 if (copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused)))
645 error = -EFAULT;
646 }
647 return error;
648#endif
649}
650
651long sys32_lookup_dcookie(unsigned long cookie_high, 594long sys32_lookup_dcookie(unsigned long cookie_high,
652 unsigned long cookie_low, 595 unsigned long cookie_low,
653 char __user *buf, size_t len) 596 char __user *buf, size_t len)
diff --git a/arch/sparc/kernel/systbls_64.S b/arch/sparc/kernel/systbls_64.S
index 009825f6e73c..034b10e0d4b0 100644
--- a/arch/sparc/kernel/systbls_64.S
+++ b/arch/sparc/kernel/systbls_64.S
@@ -68,7 +68,7 @@ sys_call_table32:
68 .word compat_sys_fstatfs64, sys_llseek, sys_mlock, sys_munlock, sys32_mlockall 68 .word compat_sys_fstatfs64, sys_llseek, sys_mlock, sys_munlock, sys32_mlockall
69/*240*/ .word sys_munlockall, sys32_sched_setparam, sys32_sched_getparam, sys32_sched_setscheduler, sys32_sched_getscheduler 69/*240*/ .word sys_munlockall, sys32_sched_setparam, sys32_sched_getparam, sys32_sched_setscheduler, sys32_sched_getscheduler
70 .word sys_sched_yield, sys32_sched_get_priority_max, sys32_sched_get_priority_min, sys32_sched_rr_get_interval, compat_sys_nanosleep 70 .word sys_sched_yield, sys32_sched_get_priority_max, sys32_sched_get_priority_min, sys32_sched_rr_get_interval, compat_sys_nanosleep
71/*250*/ .word sys32_mremap, sys32_sysctl, sys32_getsid, sys_fdatasync, sys32_nfsservctl 71/*250*/ .word sys32_mremap, compat_sys_sysctl, sys32_getsid, sys_fdatasync, sys32_nfsservctl
72 .word sys32_sync_file_range, compat_sys_clock_settime, compat_sys_clock_gettime, compat_sys_clock_getres, sys32_clock_nanosleep 72 .word sys32_sync_file_range, compat_sys_clock_settime, compat_sys_clock_gettime, compat_sys_clock_getres, sys32_clock_nanosleep
73/*260*/ .word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, sys32_timer_settime, compat_sys_timer_gettime, sys_timer_getoverrun 73/*260*/ .word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, sys32_timer_settime, compat_sys_timer_gettime, sys_timer_getoverrun
74 .word sys_timer_delete, compat_sys_timer_create, sys_ni_syscall, compat_sys_io_setup, sys_io_destroy 74 .word sys_timer_delete, compat_sys_timer_create, sys_ni_syscall, compat_sys_io_setup, sys_io_destroy
diff --git a/arch/x86/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S
index 581b0568fe19..5d2584839be4 100644
--- a/arch/x86/ia32/ia32entry.S
+++ b/arch/x86/ia32/ia32entry.S
@@ -653,7 +653,7 @@ ia32_sys_call_table:
653 .quad compat_sys_writev 653 .quad compat_sys_writev
654 .quad sys_getsid 654 .quad sys_getsid
655 .quad sys_fdatasync 655 .quad sys_fdatasync
656 .quad sys32_sysctl /* sysctl */ 656 .quad compat_sys_sysctl /* sysctl */
657 .quad sys_mlock /* 150 */ 657 .quad sys_mlock /* 150 */
658 .quad sys_munlock 658 .quad sys_munlock
659 .quad sys_mlockall 659 .quad sys_mlockall
diff --git a/arch/x86/ia32/sys_ia32.c b/arch/x86/ia32/sys_ia32.c
index 9f5527198825..df82c0e48ded 100644
--- a/arch/x86/ia32/sys_ia32.c
+++ b/arch/x86/ia32/sys_ia32.c
@@ -434,62 +434,6 @@ asmlinkage long sys32_rt_sigqueueinfo(int pid, int sig,
434 return ret; 434 return ret;
435} 435}
436 436
437#ifdef CONFIG_SYSCTL_SYSCALL
438struct sysctl_ia32 {
439 unsigned int name;
440 int nlen;
441 unsigned int oldval;
442 unsigned int oldlenp;
443 unsigned int newval;
444 unsigned int newlen;
445 unsigned int __unused[4];
446};
447
448
449asmlinkage long sys32_sysctl(struct sysctl_ia32 __user *args32)
450{
451 struct sysctl_ia32 a32;
452 mm_segment_t old_fs = get_fs();
453 void __user *oldvalp, *newvalp;
454 size_t oldlen;
455 int __user *namep;
456 long ret;
457
458 if (copy_from_user(&a32, args32, sizeof(a32)))
459 return -EFAULT;
460
461 /*
462 * We need to pre-validate these because we have to disable
463 * address checking before calling do_sysctl() because of
464 * OLDLEN but we can't run the risk of the user specifying bad
465 * addresses here. Well, since we're dealing with 32 bit
466 * addresses, we KNOW that access_ok() will always succeed, so
467 * this is an expensive NOP, but so what...
468 */
469 namep = compat_ptr(a32.name);
470 oldvalp = compat_ptr(a32.oldval);
471 newvalp = compat_ptr(a32.newval);
472
473 if ((oldvalp && get_user(oldlen, (int __user *)compat_ptr(a32.oldlenp)))
474 || !access_ok(VERIFY_WRITE, namep, 0)
475 || !access_ok(VERIFY_WRITE, oldvalp, 0)
476 || !access_ok(VERIFY_WRITE, newvalp, 0))
477 return -EFAULT;
478
479 set_fs(KERNEL_DS);
480 lock_kernel();
481 ret = do_sysctl(namep, a32.nlen, oldvalp, (size_t __user *)&oldlen,
482 newvalp, (size_t) a32.newlen);
483 unlock_kernel();
484 set_fs(old_fs);
485
486 if (oldvalp && put_user(oldlen, (int __user *)compat_ptr(a32.oldlenp)))
487 return -EFAULT;
488
489 return ret;
490}
491#endif
492
493/* warning: next two assume little endian */ 437/* warning: next two assume little endian */
494asmlinkage long sys32_pread(unsigned int fd, char __user *ubuf, u32 count, 438asmlinkage long sys32_pread(unsigned int fd, char __user *ubuf, u32 count,
495 u32 poslo, u32 poshi) 439 u32 poslo, u32 poshi)
diff --git a/arch/x86/include/asm/sys_ia32.h b/arch/x86/include/asm/sys_ia32.h
index 72a6dcd1299b..9af9decb38c3 100644
--- a/arch/x86/include/asm/sys_ia32.h
+++ b/arch/x86/include/asm/sys_ia32.h
@@ -51,11 +51,6 @@ asmlinkage long sys32_sched_rr_get_interval(compat_pid_t,
51asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *, compat_size_t); 51asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *, compat_size_t);
52asmlinkage long sys32_rt_sigqueueinfo(int, int, compat_siginfo_t __user *); 52asmlinkage long sys32_rt_sigqueueinfo(int, int, compat_siginfo_t __user *);
53 53
54#ifdef CONFIG_SYSCTL_SYSCALL
55struct sysctl_ia32;
56asmlinkage long sys32_sysctl(struct sysctl_ia32 __user *);
57#endif
58
59asmlinkage long sys32_pread(unsigned int, char __user *, u32, u32, u32); 54asmlinkage long sys32_pread(unsigned int, char __user *, u32, u32, u32);
60asmlinkage long sys32_pwrite(unsigned int, char __user *, u32, u32, u32); 55asmlinkage long sys32_pwrite(unsigned int, char __user *, u32, u32, u32);
61 56
diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c
index 8cb4974ff599..e02d92d12bcd 100644
--- a/arch/x86/kernel/vsyscall_64.c
+++ b/arch/x86/kernel/vsyscall_64.c
@@ -237,7 +237,7 @@ static ctl_table kernel_table2[] = {
237}; 237};
238 238
239static ctl_table kernel_root_table2[] = { 239static ctl_table kernel_root_table2[] = {
240 { .ctl_name = CTL_KERN, .procname = "kernel", .mode = 0555, 240 { .procname = "kernel", .mode = 0555,
241 .child = kernel_table2 }, 241 .child = kernel_table2 },
242 {} 242 {}
243}; 243};
diff --git a/arch/x86/vdso/vdso32-setup.c b/arch/x86/vdso/vdso32-setup.c
index 58bc00f68b12..02b442e92007 100644
--- a/arch/x86/vdso/vdso32-setup.c
+++ b/arch/x86/vdso/vdso32-setup.c
@@ -393,7 +393,6 @@ static ctl_table abi_table2[] = {
393 393
394static ctl_table abi_root_table2[] = { 394static ctl_table abi_root_table2[] = {
395 { 395 {
396 .ctl_name = CTL_ABI,
397 .procname = "abi", 396 .procname = "abi",
398 .mode = 0555, 397 .mode = 0555,
399 .child = abi_table2 398 .child = abi_table2
diff --git a/crypto/proc.c b/crypto/proc.c
index 5dc07e442fca..fe95975fc533 100644
--- a/crypto/proc.c
+++ b/crypto/proc.c
@@ -25,28 +25,22 @@
25#ifdef CONFIG_CRYPTO_FIPS 25#ifdef CONFIG_CRYPTO_FIPS
26static struct ctl_table crypto_sysctl_table[] = { 26static struct ctl_table crypto_sysctl_table[] = {
27 { 27 {
28 .ctl_name = CTL_UNNUMBERED,
29 .procname = "fips_enabled", 28 .procname = "fips_enabled",
30 .data = &fips_enabled, 29 .data = &fips_enabled,
31 .maxlen = sizeof(int), 30 .maxlen = sizeof(int),
32 .mode = 0444, 31 .mode = 0444,
33 .proc_handler = &proc_dointvec 32 .proc_handler = &proc_dointvec
34 }, 33 },
35 { 34 {}
36 .ctl_name = 0,
37 },
38}; 35};
39 36
40static struct ctl_table crypto_dir_table[] = { 37static struct ctl_table crypto_dir_table[] = {
41 { 38 {
42 .ctl_name = CTL_UNNUMBERED,
43 .procname = "crypto", 39 .procname = "crypto",
44 .mode = 0555, 40 .mode = 0555,
45 .child = crypto_sysctl_table 41 .child = crypto_sysctl_table
46 }, 42 },
47 { 43 {}
48 .ctl_name = 0,
49 },
50}; 44};
51 45
52static struct ctl_table_header *crypto_sysctls; 46static struct ctl_table_header *crypto_sysctls;
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index 614da5b8613a..1872b6dc168a 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -3594,30 +3594,28 @@ static ctl_table cdrom_table[] = {
3594 .mode = 0644, 3594 .mode = 0644,
3595 .proc_handler = &cdrom_sysctl_handler 3595 .proc_handler = &cdrom_sysctl_handler
3596 }, 3596 },
3597 { .ctl_name = 0 } 3597 { }
3598}; 3598};
3599 3599
3600static ctl_table cdrom_cdrom_table[] = { 3600static ctl_table cdrom_cdrom_table[] = {
3601 { 3601 {
3602 .ctl_name = DEV_CDROM,
3603 .procname = "cdrom", 3602 .procname = "cdrom",
3604 .maxlen = 0, 3603 .maxlen = 0,
3605 .mode = 0555, 3604 .mode = 0555,
3606 .child = cdrom_table, 3605 .child = cdrom_table,
3607 }, 3606 },
3608 { .ctl_name = 0 } 3607 { }
3609}; 3608};
3610 3609
3611/* Make sure that /proc/sys/dev is there */ 3610/* Make sure that /proc/sys/dev is there */
3612static ctl_table cdrom_root_table[] = { 3611static ctl_table cdrom_root_table[] = {
3613 { 3612 {
3614 .ctl_name = CTL_DEV,
3615 .procname = "dev", 3613 .procname = "dev",
3616 .maxlen = 0, 3614 .maxlen = 0,
3617 .mode = 0555, 3615 .mode = 0555,
3618 .child = cdrom_cdrom_table, 3616 .child = cdrom_cdrom_table,
3619 }, 3617 },
3620 { .ctl_name = 0 } 3618 { }
3621}; 3619};
3622static struct ctl_table_header *cdrom_sysctl_header; 3620static struct ctl_table_header *cdrom_sysctl_header;
3623 3621
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index 70a770ac0138..a05a6112240b 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -675,36 +675,33 @@ static int hpet_is_known(struct hpet_data *hdp)
675 675
676static ctl_table hpet_table[] = { 676static ctl_table hpet_table[] = {
677 { 677 {
678 .ctl_name = CTL_UNNUMBERED,
679 .procname = "max-user-freq", 678 .procname = "max-user-freq",
680 .data = &hpet_max_freq, 679 .data = &hpet_max_freq,
681 .maxlen = sizeof(int), 680 .maxlen = sizeof(int),
682 .mode = 0644, 681 .mode = 0644,
683 .proc_handler = &proc_dointvec, 682 .proc_handler = &proc_dointvec,
684 }, 683 },
685 {.ctl_name = 0} 684 {}
686}; 685};
687 686
688static ctl_table hpet_root[] = { 687static ctl_table hpet_root[] = {
689 { 688 {
690 .ctl_name = CTL_UNNUMBERED,
691 .procname = "hpet", 689 .procname = "hpet",
692 .maxlen = 0, 690 .maxlen = 0,
693 .mode = 0555, 691 .mode = 0555,
694 .child = hpet_table, 692 .child = hpet_table,
695 }, 693 },
696 {.ctl_name = 0} 694 {}
697}; 695};
698 696
699static ctl_table dev_root[] = { 697static ctl_table dev_root[] = {
700 { 698 {
701 .ctl_name = CTL_DEV,
702 .procname = "dev", 699 .procname = "dev",
703 .maxlen = 0, 700 .maxlen = 0,
704 .mode = 0555, 701 .mode = 0555,
705 .child = hpet_root, 702 .child = hpet_root,
706 }, 703 },
707 {.ctl_name = 0} 704 {}
708}; 705};
709 706
710static struct ctl_table_header *sysctl_header; 707static struct ctl_table_header *sysctl_header;
diff --git a/drivers/char/ipmi/ipmi_poweroff.c b/drivers/char/ipmi/ipmi_poweroff.c
index 2e66b5f773dd..aa39722696dd 100644
--- a/drivers/char/ipmi/ipmi_poweroff.c
+++ b/drivers/char/ipmi/ipmi_poweroff.c
@@ -660,8 +660,7 @@ static struct ipmi_smi_watcher smi_watcher = {
660#include <linux/sysctl.h> 660#include <linux/sysctl.h>
661 661
662static ctl_table ipmi_table[] = { 662static ctl_table ipmi_table[] = {
663 { .ctl_name = DEV_IPMI_POWEROFF_POWERCYCLE, 663 { .procname = "poweroff_powercycle",
664 .procname = "poweroff_powercycle",
665 .data = &poweroff_powercycle, 664 .data = &poweroff_powercycle,
666 .maxlen = sizeof(poweroff_powercycle), 665 .maxlen = sizeof(poweroff_powercycle),
667 .mode = 0644, 666 .mode = 0644,
@@ -670,16 +669,14 @@ static ctl_table ipmi_table[] = {
670}; 669};
671 670
672static ctl_table ipmi_dir_table[] = { 671static ctl_table ipmi_dir_table[] = {
673 { .ctl_name = DEV_IPMI, 672 { .procname = "ipmi",
674 .procname = "ipmi",
675 .mode = 0555, 673 .mode = 0555,
676 .child = ipmi_table }, 674 .child = ipmi_table },
677 { } 675 { }
678}; 676};
679 677
680static ctl_table ipmi_root_table[] = { 678static ctl_table ipmi_root_table[] = {
681 { .ctl_name = CTL_DEV, 679 { .procname = "dev",
682 .procname = "dev",
683 .mode = 0555, 680 .mode = 0555,
684 .child = ipmi_dir_table }, 681 .child = ipmi_dir_table },
685 { } 682 { }
diff --git a/drivers/char/pty.c b/drivers/char/pty.c
index 62f282e67638..d516e9ced3c2 100644
--- a/drivers/char/pty.c
+++ b/drivers/char/pty.c
@@ -431,30 +431,25 @@ static struct cdev ptmx_cdev;
431 431
432static struct ctl_table pty_table[] = { 432static struct ctl_table pty_table[] = {
433 { 433 {
434 .ctl_name = PTY_MAX,
435 .procname = "max", 434 .procname = "max",
436 .maxlen = sizeof(int), 435 .maxlen = sizeof(int),
437 .mode = 0644, 436 .mode = 0644,
438 .data = &pty_limit, 437 .data = &pty_limit,
439 .proc_handler = &proc_dointvec_minmax, 438 .proc_handler = &proc_dointvec_minmax,
440 .strategy = &sysctl_intvec,
441 .extra1 = &pty_limit_min, 439 .extra1 = &pty_limit_min,
442 .extra2 = &pty_limit_max, 440 .extra2 = &pty_limit_max,
443 }, { 441 }, {
444 .ctl_name = PTY_NR,
445 .procname = "nr", 442 .procname = "nr",
446 .maxlen = sizeof(int), 443 .maxlen = sizeof(int),
447 .mode = 0444, 444 .mode = 0444,
448 .data = &pty_count, 445 .data = &pty_count,
449 .proc_handler = &proc_dointvec, 446 .proc_handler = &proc_dointvec,
450 }, { 447 },
451 .ctl_name = 0 448 {}
452 }
453}; 449};
454 450
455static struct ctl_table pty_kern_table[] = { 451static struct ctl_table pty_kern_table[] = {
456 { 452 {
457 .ctl_name = KERN_PTY,
458 .procname = "pty", 453 .procname = "pty",
459 .mode = 0555, 454 .mode = 0555,
460 .child = pty_table, 455 .child = pty_table,
@@ -464,7 +459,6 @@ static struct ctl_table pty_kern_table[] = {
464 459
465static struct ctl_table pty_root_table[] = { 460static struct ctl_table pty_root_table[] = {
466 { 461 {
467 .ctl_name = CTL_KERN,
468 .procname = "kernel", 462 .procname = "kernel",
469 .mode = 0555, 463 .mode = 0555,
470 .child = pty_kern_table, 464 .child = pty_kern_table,
diff --git a/drivers/char/random.c b/drivers/char/random.c
index 04b505e5a5e2..bcf680f9ff58 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1257,40 +1257,9 @@ static int proc_do_uuid(ctl_table *table, int write,
1257 return proc_dostring(&fake_table, write, buffer, lenp, ppos); 1257 return proc_dostring(&fake_table, write, buffer, lenp, ppos);
1258} 1258}
1259 1259
1260static int uuid_strategy(ctl_table *table,
1261 void __user *oldval, size_t __user *oldlenp,
1262 void __user *newval, size_t newlen)
1263{
1264 unsigned char tmp_uuid[16], *uuid;
1265 unsigned int len;
1266
1267 if (!oldval || !oldlenp)
1268 return 1;
1269
1270 uuid = table->data;
1271 if (!uuid) {
1272 uuid = tmp_uuid;
1273 uuid[8] = 0;
1274 }
1275 if (uuid[8] == 0)
1276 generate_random_uuid(uuid);
1277
1278 if (get_user(len, oldlenp))
1279 return -EFAULT;
1280 if (len) {
1281 if (len > 16)
1282 len = 16;
1283 if (copy_to_user(oldval, uuid, len) ||
1284 put_user(len, oldlenp))
1285 return -EFAULT;
1286 }
1287 return 1;
1288}
1289
1290static int sysctl_poolsize = INPUT_POOL_WORDS * 32; 1260static int sysctl_poolsize = INPUT_POOL_WORDS * 32;
1291ctl_table random_table[] = { 1261ctl_table random_table[] = {
1292 { 1262 {
1293 .ctl_name = RANDOM_POOLSIZE,
1294 .procname = "poolsize", 1263 .procname = "poolsize",
1295 .data = &sysctl_poolsize, 1264 .data = &sysctl_poolsize,
1296 .maxlen = sizeof(int), 1265 .maxlen = sizeof(int),
@@ -1298,7 +1267,6 @@ ctl_table random_table[] = {
1298 .proc_handler = &proc_dointvec, 1267 .proc_handler = &proc_dointvec,
1299 }, 1268 },
1300 { 1269 {
1301 .ctl_name = RANDOM_ENTROPY_COUNT,
1302 .procname = "entropy_avail", 1270 .procname = "entropy_avail",
1303 .maxlen = sizeof(int), 1271 .maxlen = sizeof(int),
1304 .mode = 0444, 1272 .mode = 0444,
@@ -1306,45 +1274,37 @@ ctl_table random_table[] = {
1306 .data = &input_pool.entropy_count, 1274 .data = &input_pool.entropy_count,
1307 }, 1275 },
1308 { 1276 {
1309 .ctl_name = RANDOM_READ_THRESH,
1310 .procname = "read_wakeup_threshold", 1277 .procname = "read_wakeup_threshold",
1311 .data = &random_read_wakeup_thresh, 1278 .data = &random_read_wakeup_thresh,
1312 .maxlen = sizeof(int), 1279 .maxlen = sizeof(int),
1313 .mode = 0644, 1280 .mode = 0644,
1314 .proc_handler = &proc_dointvec_minmax, 1281 .proc_handler = &proc_dointvec_minmax,
1315 .strategy = &sysctl_intvec,
1316 .extra1 = &min_read_thresh, 1282 .extra1 = &min_read_thresh,
1317 .extra2 = &max_read_thresh, 1283 .extra2 = &max_read_thresh,
1318 }, 1284 },
1319 { 1285 {
1320 .ctl_name = RANDOM_WRITE_THRESH,
1321 .procname = "write_wakeup_threshold", 1286 .procname = "write_wakeup_threshold",
1322 .data = &random_write_wakeup_thresh, 1287 .data = &random_write_wakeup_thresh,
1323 .maxlen = sizeof(int), 1288 .maxlen = sizeof(int),
1324 .mode = 0644, 1289 .mode = 0644,
1325 .proc_handler = &proc_dointvec_minmax, 1290 .proc_handler = &proc_dointvec_minmax,
1326 .strategy = &sysctl_intvec,
1327 .extra1 = &min_write_thresh, 1291 .extra1 = &min_write_thresh,
1328 .extra2 = &max_write_thresh, 1292 .extra2 = &max_write_thresh,
1329 }, 1293 },
1330 { 1294 {
1331 .ctl_name = RANDOM_BOOT_ID,
1332 .procname = "boot_id", 1295 .procname = "boot_id",
1333 .data = &sysctl_bootid, 1296 .data = &sysctl_bootid,
1334 .maxlen = 16, 1297 .maxlen = 16,
1335 .mode = 0444, 1298 .mode = 0444,
1336 .proc_handler = &proc_do_uuid, 1299 .proc_handler = &proc_do_uuid,
1337 .strategy = &uuid_strategy,
1338 }, 1300 },
1339 { 1301 {
1340 .ctl_name = RANDOM_UUID,
1341 .procname = "uuid", 1302 .procname = "uuid",
1342 .maxlen = 16, 1303 .maxlen = 16,
1343 .mode = 0444, 1304 .mode = 0444,
1344 .proc_handler = &proc_do_uuid, 1305 .proc_handler = &proc_do_uuid,
1345 .strategy = &uuid_strategy,
1346 }, 1306 },
1347 { .ctl_name = 0 } 1307 { }
1348}; 1308};
1349#endif /* CONFIG_SYSCTL */ 1309#endif /* CONFIG_SYSCTL */
1350 1310
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c
index bc4ab3e54550..37bfe23c218e 100644
--- a/drivers/char/rtc.c
+++ b/drivers/char/rtc.c
@@ -282,34 +282,31 @@ static irqreturn_t rtc_interrupt(int irq, void *dev_id)
282 */ 282 */
283static ctl_table rtc_table[] = { 283static ctl_table rtc_table[] = {
284 { 284 {
285 .ctl_name = CTL_UNNUMBERED,
286 .procname = "max-user-freq", 285 .procname = "max-user-freq",
287 .data = &rtc_max_user_freq, 286 .data = &rtc_max_user_freq,
288 .maxlen = sizeof(int), 287 .maxlen = sizeof(int),
289 .mode = 0644, 288 .mode = 0644,
290 .proc_handler = &proc_dointvec, 289 .proc_handler = &proc_dointvec,
291 }, 290 },
292 { .ctl_name = 0 } 291 { }
293}; 292};
294 293
295static ctl_table rtc_root[] = { 294static ctl_table rtc_root[] = {
296 { 295 {
297 .ctl_name = CTL_UNNUMBERED,
298 .procname = "rtc", 296 .procname = "rtc",
299 .mode = 0555, 297 .mode = 0555,
300 .child = rtc_table, 298 .child = rtc_table,
301 }, 299 },
302 { .ctl_name = 0 } 300 { }
303}; 301};
304 302
305static ctl_table dev_root[] = { 303static ctl_table dev_root[] = {
306 { 304 {
307 .ctl_name = CTL_DEV,
308 .procname = "dev", 305 .procname = "dev",
309 .mode = 0555, 306 .mode = 0555,
310 .child = rtc_root, 307 .child = rtc_root,
311 }, 308 },
312 { .ctl_name = 0 } 309 { }
313}; 310};
314 311
315static struct ctl_table_header *sysctl_header; 312static struct ctl_table_header *sysctl_header;
diff --git a/drivers/macintosh/mac_hid.c b/drivers/macintosh/mac_hid.c
index cc9f27514aef..2dd29b42a49e 100644
--- a/drivers/macintosh/mac_hid.c
+++ b/drivers/macintosh/mac_hid.c
@@ -27,7 +27,6 @@ static int mouse_last_keycode;
27/* file(s) in /proc/sys/dev/mac_hid */ 27/* file(s) in /proc/sys/dev/mac_hid */
28static ctl_table mac_hid_files[] = { 28static ctl_table mac_hid_files[] = {
29 { 29 {
30 .ctl_name = DEV_MAC_HID_MOUSE_BUTTON_EMULATION,
31 .procname = "mouse_button_emulation", 30 .procname = "mouse_button_emulation",
32 .data = &mouse_emulate_buttons, 31 .data = &mouse_emulate_buttons,
33 .maxlen = sizeof(int), 32 .maxlen = sizeof(int),
@@ -35,7 +34,6 @@ static ctl_table mac_hid_files[] = {
35 .proc_handler = &proc_dointvec, 34 .proc_handler = &proc_dointvec,
36 }, 35 },
37 { 36 {
38 .ctl_name = DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE,
39 .procname = "mouse_button2_keycode", 37 .procname = "mouse_button2_keycode",
40 .data = &mouse_button2_keycode, 38 .data = &mouse_button2_keycode,
41 .maxlen = sizeof(int), 39 .maxlen = sizeof(int),
@@ -43,38 +41,35 @@ static ctl_table mac_hid_files[] = {
43 .proc_handler = &proc_dointvec, 41 .proc_handler = &proc_dointvec,
44 }, 42 },
45 { 43 {
46 .ctl_name = DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE,
47 .procname = "mouse_button3_keycode", 44 .procname = "mouse_button3_keycode",
48 .data = &mouse_button3_keycode, 45 .data = &mouse_button3_keycode,
49 .maxlen = sizeof(int), 46 .maxlen = sizeof(int),
50 .mode = 0644, 47 .mode = 0644,
51 .proc_handler = &proc_dointvec, 48 .proc_handler = &proc_dointvec,
52 }, 49 },
53 { .ctl_name = 0 } 50 { }
54}; 51};
55 52
56/* dir in /proc/sys/dev */ 53/* dir in /proc/sys/dev */
57static ctl_table mac_hid_dir[] = { 54static ctl_table mac_hid_dir[] = {
58 { 55 {
59 .ctl_name = DEV_MAC_HID,
60 .procname = "mac_hid", 56 .procname = "mac_hid",
61 .maxlen = 0, 57 .maxlen = 0,
62 .mode = 0555, 58 .mode = 0555,
63 .child = mac_hid_files, 59 .child = mac_hid_files,
64 }, 60 },
65 { .ctl_name = 0 } 61 { }
66}; 62};
67 63
68/* /proc/sys/dev itself, in case that is not there yet */ 64/* /proc/sys/dev itself, in case that is not there yet */
69static ctl_table mac_hid_root_dir[] = { 65static ctl_table mac_hid_root_dir[] = {
70 { 66 {
71 .ctl_name = CTL_DEV,
72 .procname = "dev", 67 .procname = "dev",
73 .maxlen = 0, 68 .maxlen = 0,
74 .mode = 0555, 69 .mode = 0555,
75 .child = mac_hid_dir, 70 .child = mac_hid_dir,
76 }, 71 },
77 { .ctl_name = 0 } 72 { }
78}; 73};
79 74
80static struct ctl_table_header *mac_hid_sysctl_header; 75static struct ctl_table_header *mac_hid_sysctl_header;
diff --git a/drivers/md/md.c b/drivers/md/md.c
index e64c971038d1..1d529551e944 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -98,7 +98,6 @@ static struct ctl_table_header *raid_table_header;
98 98
99static ctl_table raid_table[] = { 99static ctl_table raid_table[] = {
100 { 100 {
101 .ctl_name = DEV_RAID_SPEED_LIMIT_MIN,
102 .procname = "speed_limit_min", 101 .procname = "speed_limit_min",
103 .data = &sysctl_speed_limit_min, 102 .data = &sysctl_speed_limit_min,
104 .maxlen = sizeof(int), 103 .maxlen = sizeof(int),
@@ -106,36 +105,33 @@ static ctl_table raid_table[] = {
106 .proc_handler = &proc_dointvec, 105 .proc_handler = &proc_dointvec,
107 }, 106 },
108 { 107 {
109 .ctl_name = DEV_RAID_SPEED_LIMIT_MAX,
110 .procname = "speed_limit_max", 108 .procname = "speed_limit_max",
111 .data = &sysctl_speed_limit_max, 109 .data = &sysctl_speed_limit_max,
112 .maxlen = sizeof(int), 110 .maxlen = sizeof(int),
113 .mode = S_IRUGO|S_IWUSR, 111 .mode = S_IRUGO|S_IWUSR,
114 .proc_handler = &proc_dointvec, 112 .proc_handler = &proc_dointvec,
115 }, 113 },
116 { .ctl_name = 0 } 114 { }
117}; 115};
118 116
119static ctl_table raid_dir_table[] = { 117static ctl_table raid_dir_table[] = {
120 { 118 {
121 .ctl_name = DEV_RAID,
122 .procname = "raid", 119 .procname = "raid",
123 .maxlen = 0, 120 .maxlen = 0,
124 .mode = S_IRUGO|S_IXUGO, 121 .mode = S_IRUGO|S_IXUGO,
125 .child = raid_table, 122 .child = raid_table,
126 }, 123 },
127 { .ctl_name = 0 } 124 { }
128}; 125};
129 126
130static ctl_table raid_root_table[] = { 127static ctl_table raid_root_table[] = {
131 { 128 {
132 .ctl_name = CTL_DEV,
133 .procname = "dev", 129 .procname = "dev",
134 .maxlen = 0, 130 .maxlen = 0,
135 .mode = 0555, 131 .mode = 0555,
136 .child = raid_dir_table, 132 .child = raid_dir_table,
137 }, 133 },
138 { .ctl_name = 0 } 134 { }
139}; 135};
140 136
141static const struct block_device_operations md_fops; 137static const struct block_device_operations md_fops;
diff --git a/drivers/misc/sgi-xp/xpc_main.c b/drivers/misc/sgi-xp/xpc_main.c
index fd3688a3e23f..ce98b9373be7 100644
--- a/drivers/misc/sgi-xp/xpc_main.c
+++ b/drivers/misc/sgi-xp/xpc_main.c
@@ -89,48 +89,40 @@ static int xpc_disengage_max_timelimit = 120;
89 89
90static ctl_table xpc_sys_xpc_hb_dir[] = { 90static ctl_table xpc_sys_xpc_hb_dir[] = {
91 { 91 {
92 .ctl_name = CTL_UNNUMBERED,
93 .procname = "hb_interval", 92 .procname = "hb_interval",
94 .data = &xpc_hb_interval, 93 .data = &xpc_hb_interval,
95 .maxlen = sizeof(int), 94 .maxlen = sizeof(int),
96 .mode = 0644, 95 .mode = 0644,
97 .proc_handler = &proc_dointvec_minmax, 96 .proc_handler = &proc_dointvec_minmax,
98 .strategy = &sysctl_intvec,
99 .extra1 = &xpc_hb_min_interval, 97 .extra1 = &xpc_hb_min_interval,
100 .extra2 = &xpc_hb_max_interval}, 98 .extra2 = &xpc_hb_max_interval},
101 { 99 {
102 .ctl_name = CTL_UNNUMBERED,
103 .procname = "hb_check_interval", 100 .procname = "hb_check_interval",
104 .data = &xpc_hb_check_interval, 101 .data = &xpc_hb_check_interval,
105 .maxlen = sizeof(int), 102 .maxlen = sizeof(int),
106 .mode = 0644, 103 .mode = 0644,
107 .proc_handler = &proc_dointvec_minmax, 104 .proc_handler = &proc_dointvec_minmax,
108 .strategy = &sysctl_intvec,
109 .extra1 = &xpc_hb_check_min_interval, 105 .extra1 = &xpc_hb_check_min_interval,
110 .extra2 = &xpc_hb_check_max_interval}, 106 .extra2 = &xpc_hb_check_max_interval},
111 {} 107 {}
112}; 108};
113static ctl_table xpc_sys_xpc_dir[] = { 109static ctl_table xpc_sys_xpc_dir[] = {
114 { 110 {
115 .ctl_name = CTL_UNNUMBERED,
116 .procname = "hb", 111 .procname = "hb",
117 .mode = 0555, 112 .mode = 0555,
118 .child = xpc_sys_xpc_hb_dir}, 113 .child = xpc_sys_xpc_hb_dir},
119 { 114 {
120 .ctl_name = CTL_UNNUMBERED,
121 .procname = "disengage_timelimit", 115 .procname = "disengage_timelimit",
122 .data = &xpc_disengage_timelimit, 116 .data = &xpc_disengage_timelimit,
123 .maxlen = sizeof(int), 117 .maxlen = sizeof(int),
124 .mode = 0644, 118 .mode = 0644,
125 .proc_handler = &proc_dointvec_minmax, 119 .proc_handler = &proc_dointvec_minmax,
126 .strategy = &sysctl_intvec,
127 .extra1 = &xpc_disengage_min_timelimit, 120 .extra1 = &xpc_disengage_min_timelimit,
128 .extra2 = &xpc_disengage_max_timelimit}, 121 .extra2 = &xpc_disengage_max_timelimit},
129 {} 122 {}
130}; 123};
131static ctl_table xpc_sys_dir[] = { 124static ctl_table xpc_sys_dir[] = {
132 { 125 {
133 .ctl_name = CTL_UNNUMBERED,
134 .procname = "xpc", 126 .procname = "xpc",
135 .mode = 0555, 127 .mode = 0555,
136 .child = xpc_sys_xpc_dir}, 128 .child = xpc_sys_xpc_dir},
diff --git a/drivers/net/wireless/arlan-proc.c b/drivers/net/wireless/arlan-proc.c
index a8b689635a3b..66a0b330b756 100644
--- a/drivers/net/wireless/arlan-proc.c
+++ b/drivers/net/wireless/arlan-proc.c
@@ -816,84 +816,83 @@ static int arlan_sysctl_reset(ctl_table * ctl, int write,
816 816
817 817
818/* Place files in /proc/sys/dev/arlan */ 818/* Place files in /proc/sys/dev/arlan */
819#define CTBLN(num,card,nam) \ 819#define CTBLN(card,nam) \
820 { .ctl_name = num,\ 820 { .procname = #nam,\
821 .procname = #nam,\
822 .data = &(arlan_conf[card].nam),\ 821 .data = &(arlan_conf[card].nam),\
823 .maxlen = sizeof(int), .mode = 0600, .proc_handler = &proc_dointvec} 822 .maxlen = sizeof(int), .mode = 0600, .proc_handler = &proc_dointvec}
824#ifdef ARLAN_DEBUGGING 823#ifdef ARLAN_DEBUGGING
825 824
826#define ARLAN_PROC_DEBUG_ENTRIES \ 825#define ARLAN_PROC_DEBUG_ENTRIES \
827 { .ctl_name = 48, .procname = "entry_exit_debug",\ 826 { .procname = "entry_exit_debug",\
828 .data = &arlan_entry_and_exit_debug,\ 827 .data = &arlan_entry_and_exit_debug,\
829 .maxlen = sizeof(int), .mode = 0600, .proc_handler = &proc_dointvec},\ 828 .maxlen = sizeof(int), .mode = 0600, .proc_handler = &proc_dointvec},\
830 { .ctl_name = 49, .procname = "debug", .data = &arlan_debug,\ 829 { .procname = "debug", .data = &arlan_debug,\
831 .maxlen = sizeof(int), .mode = 0600, .proc_handler = &proc_dointvec}, 830 .maxlen = sizeof(int), .mode = 0600, .proc_handler = &proc_dointvec},
832#else 831#else
833#define ARLAN_PROC_DEBUG_ENTRIES 832#define ARLAN_PROC_DEBUG_ENTRIES
834#endif 833#endif
835 834
836#define ARLAN_SYSCTL_TABLE_TOTAL(cardNo)\ 835#define ARLAN_SYSCTL_TABLE_TOTAL(cardNo)\
837 CTBLN(1,cardNo,spreadingCode),\ 836 CTBLN(cardNo,spreadingCode),\
838 CTBLN(2,cardNo, channelNumber),\ 837 CTBLN(cardNo, channelNumber),\
839 CTBLN(3,cardNo, scramblingDisable),\ 838 CTBLN(cardNo, scramblingDisable),\
840 CTBLN(4,cardNo, txAttenuation),\ 839 CTBLN(cardNo, txAttenuation),\
841 CTBLN(5,cardNo, systemId), \ 840 CTBLN(cardNo, systemId), \
842 CTBLN(6,cardNo, maxDatagramSize),\ 841 CTBLN(cardNo, maxDatagramSize),\
843 CTBLN(7,cardNo, maxFrameSize),\ 842 CTBLN(cardNo, maxFrameSize),\
844 CTBLN(8,cardNo, maxRetries),\ 843 CTBLN(cardNo, maxRetries),\
845 CTBLN(9,cardNo, receiveMode),\ 844 CTBLN(cardNo, receiveMode),\
846 CTBLN(10,cardNo, priority),\ 845 CTBLN(cardNo, priority),\
847 CTBLN(11,cardNo, rootOrRepeater),\ 846 CTBLN(cardNo, rootOrRepeater),\
848 CTBLN(12,cardNo, SID),\ 847 CTBLN(cardNo, SID),\
849 CTBLN(13,cardNo, registrationMode),\ 848 CTBLN(cardNo, registrationMode),\
850 CTBLN(14,cardNo, registrationFill),\ 849 CTBLN(cardNo, registrationFill),\
851 CTBLN(15,cardNo, localTalkAddress),\ 850 CTBLN(cardNo, localTalkAddress),\
852 CTBLN(16,cardNo, codeFormat),\ 851 CTBLN(cardNo, codeFormat),\
853 CTBLN(17,cardNo, numChannels),\ 852 CTBLN(cardNo, numChannels),\
854 CTBLN(18,cardNo, channel1),\ 853 CTBLN(cardNo, channel1),\
855 CTBLN(19,cardNo, channel2),\ 854 CTBLN(cardNo, channel2),\
856 CTBLN(20,cardNo, channel3),\ 855 CTBLN(cardNo, channel3),\
857 CTBLN(21,cardNo, channel4),\ 856 CTBLN(cardNo, channel4),\
858 CTBLN(22,cardNo, txClear),\ 857 CTBLN(cardNo, txClear),\
859 CTBLN(23,cardNo, txRetries),\ 858 CTBLN(cardNo, txRetries),\
860 CTBLN(24,cardNo, txRouting),\ 859 CTBLN(cardNo, txRouting),\
861 CTBLN(25,cardNo, txScrambled),\ 860 CTBLN(cardNo, txScrambled),\
862 CTBLN(26,cardNo, rxParameter),\ 861 CTBLN(cardNo, rxParameter),\
863 CTBLN(27,cardNo, txTimeoutMs),\ 862 CTBLN(cardNo, txTimeoutMs),\
864 CTBLN(28,cardNo, waitCardTimeout),\ 863 CTBLN(cardNo, waitCardTimeout),\
865 CTBLN(29,cardNo, channelSet), \ 864 CTBLN(cardNo, channelSet), \
866 {.ctl_name = 30, .procname = "name",\ 865 { .procname = "name",\
867 .data = arlan_conf[cardNo].siteName,\ 866 .data = arlan_conf[cardNo].siteName,\
868 .maxlen = 16, .mode = 0600, .proc_handler = &proc_dostring},\ 867 .maxlen = 16, .mode = 0600, .proc_handler = &proc_dostring},\
869 CTBLN(31,cardNo,waitTime),\ 868 CTBLN(cardNo,waitTime),\
870 CTBLN(32,cardNo,lParameter),\ 869 CTBLN(cardNo,lParameter),\
871 CTBLN(33,cardNo,_15),\ 870 CTBLN(cardNo,_15),\
872 CTBLN(34,cardNo,headerSize),\ 871 CTBLN(cardNo,headerSize),\
873 CTBLN(36,cardNo,tx_delay_ms),\ 872 CTBLN(cardNo,tx_delay_ms),\
874 CTBLN(37,cardNo,retries),\ 873 CTBLN(cardNo,retries),\
875 CTBLN(38,cardNo,ReTransmitPacketMaxSize),\ 874 CTBLN(cardNo,ReTransmitPacketMaxSize),\
876 CTBLN(39,cardNo,waitReTransmitPacketMaxSize),\ 875 CTBLN(cardNo,waitReTransmitPacketMaxSize),\
877 CTBLN(40,cardNo,fastReTransCount),\ 876 CTBLN(cardNo,fastReTransCount),\
878 CTBLN(41,cardNo,driverRetransmissions),\ 877 CTBLN(cardNo,driverRetransmissions),\
879 CTBLN(42,cardNo,txAckTimeoutMs),\ 878 CTBLN(cardNo,txAckTimeoutMs),\
880 CTBLN(43,cardNo,registrationInterrupts),\ 879 CTBLN(cardNo,registrationInterrupts),\
881 CTBLN(44,cardNo,hardwareType),\ 880 CTBLN(cardNo,hardwareType),\
882 CTBLN(45,cardNo,radioType),\ 881 CTBLN(cardNo,radioType),\
883 CTBLN(46,cardNo,writeEEPROM),\ 882 CTBLN(cardNo,writeEEPROM),\
884 CTBLN(47,cardNo,writeRadioType),\ 883 CTBLN(cardNo,writeRadioType),\
885 ARLAN_PROC_DEBUG_ENTRIES\ 884 ARLAN_PROC_DEBUG_ENTRIES\
886 CTBLN(50,cardNo,in_speed),\ 885 CTBLN(cardNo,in_speed),\
887 CTBLN(51,cardNo,out_speed),\ 886 CTBLN(cardNo,out_speed),\
888 CTBLN(52,cardNo,in_speed10),\ 887 CTBLN(cardNo,in_speed10),\
889 CTBLN(53,cardNo,out_speed10),\ 888 CTBLN(cardNo,out_speed10),\
890 CTBLN(54,cardNo,in_speed_max),\ 889 CTBLN(cardNo,in_speed_max),\
891 CTBLN(55,cardNo,out_speed_max),\ 890 CTBLN(cardNo,out_speed_max),\
892 CTBLN(56,cardNo,measure_rate),\ 891 CTBLN(cardNo,measure_rate),\
893 CTBLN(57,cardNo,pre_Command_Wait),\ 892 CTBLN(cardNo,pre_Command_Wait),\
894 CTBLN(58,cardNo,rx_tweak1),\ 893 CTBLN(cardNo,rx_tweak1),\
895 CTBLN(59,cardNo,rx_tweak2),\ 894 CTBLN(cardNo,rx_tweak2),\
896 CTBLN(60,cardNo,tx_queue_len),\ 895 CTBLN(cardNo,tx_queue_len),\
897 896
898 897
899 898
@@ -903,7 +902,6 @@ static ctl_table arlan_conf_table0[] =
903 902
904#ifdef ARLAN_PROC_SHM_DUMP 903#ifdef ARLAN_PROC_SHM_DUMP
905 { 904 {
906 .ctl_name = 150,
907 .procname = "arlan0-txRing", 905 .procname = "arlan0-txRing",
908 .data = &arlan_drive_info, 906 .data = &arlan_drive_info,
909 .maxlen = ARLAN_STR_SIZE, 907 .maxlen = ARLAN_STR_SIZE,
@@ -911,7 +909,6 @@ static ctl_table arlan_conf_table0[] =
911 .proc_handler = &arlan_sysctl_infotxRing, 909 .proc_handler = &arlan_sysctl_infotxRing,
912 }, 910 },
913 { 911 {
914 .ctl_name = 151,
915 .procname = "arlan0-rxRing", 912 .procname = "arlan0-rxRing",
916 .data = &arlan_drive_info, 913 .data = &arlan_drive_info,
917 .maxlen = ARLAN_STR_SIZE, 914 .maxlen = ARLAN_STR_SIZE,
@@ -919,7 +916,6 @@ static ctl_table arlan_conf_table0[] =
919 .proc_handler = &arlan_sysctl_inforxRing, 916 .proc_handler = &arlan_sysctl_inforxRing,
920 }, 917 },
921 { 918 {
922 .ctl_name = 152,
923 .procname = "arlan0-18", 919 .procname = "arlan0-18",
924 .data = &arlan_drive_info, 920 .data = &arlan_drive_info,
925 .maxlen = ARLAN_STR_SIZE, 921 .maxlen = ARLAN_STR_SIZE,
@@ -927,7 +923,6 @@ static ctl_table arlan_conf_table0[] =
927 .proc_handler = &arlan_sysctl_info18, 923 .proc_handler = &arlan_sysctl_info18,
928 }, 924 },
929 { 925 {
930 .ctl_name = 153,
931 .procname = "arlan0-ring", 926 .procname = "arlan0-ring",
932 .data = &arlan_drive_info, 927 .data = &arlan_drive_info,
933 .maxlen = ARLAN_STR_SIZE, 928 .maxlen = ARLAN_STR_SIZE,
@@ -935,7 +930,6 @@ static ctl_table arlan_conf_table0[] =
935 .proc_handler = &arlan_sysctl_info161719, 930 .proc_handler = &arlan_sysctl_info161719,
936 }, 931 },
937 { 932 {
938 .ctl_name = 154,
939 .procname = "arlan0-shm-cpy", 933 .procname = "arlan0-shm-cpy",
940 .data = &arlan_drive_info, 934 .data = &arlan_drive_info,
941 .maxlen = ARLAN_STR_SIZE, 935 .maxlen = ARLAN_STR_SIZE,
@@ -944,7 +938,6 @@ static ctl_table arlan_conf_table0[] =
944 }, 938 },
945#endif 939#endif
946 { 940 {
947 .ctl_name = 155,
948 .procname = "config0", 941 .procname = "config0",
949 .data = &conf_reset_result, 942 .data = &conf_reset_result,
950 .maxlen = 100, 943 .maxlen = 100,
@@ -952,14 +945,13 @@ static ctl_table arlan_conf_table0[] =
952 .proc_handler = &arlan_configure 945 .proc_handler = &arlan_configure
953 }, 946 },
954 { 947 {
955 .ctl_name = 156,
956 .procname = "reset0", 948 .procname = "reset0",
957 .data = &conf_reset_result, 949 .data = &conf_reset_result,
958 .maxlen = 100, 950 .maxlen = 100,
959 .mode = 0400, 951 .mode = 0400,
960 .proc_handler = &arlan_sysctl_reset, 952 .proc_handler = &arlan_sysctl_reset,
961 }, 953 },
962 { .ctl_name = 0 } 954 { }
963}; 955};
964 956
965static ctl_table arlan_conf_table1[] = 957static ctl_table arlan_conf_table1[] =
@@ -969,7 +961,6 @@ static ctl_table arlan_conf_table1[] =
969 961
970#ifdef ARLAN_PROC_SHM_DUMP 962#ifdef ARLAN_PROC_SHM_DUMP
971 { 963 {
972 .ctl_name = 150,
973 .procname = "arlan1-txRing", 964 .procname = "arlan1-txRing",
974 .data = &arlan_drive_info, 965 .data = &arlan_drive_info,
975 .maxlen = ARLAN_STR_SIZE, 966 .maxlen = ARLAN_STR_SIZE,
@@ -977,7 +968,6 @@ static ctl_table arlan_conf_table1[] =
977 .proc_handler = &arlan_sysctl_infotxRing, 968 .proc_handler = &arlan_sysctl_infotxRing,
978 }, 969 },
979 { 970 {
980 .ctl_name = 151,
981 .procname = "arlan1-rxRing", 971 .procname = "arlan1-rxRing",
982 .data = &arlan_drive_info, 972 .data = &arlan_drive_info,
983 .maxlen = ARLAN_STR_SIZE, 973 .maxlen = ARLAN_STR_SIZE,
@@ -985,7 +975,6 @@ static ctl_table arlan_conf_table1[] =
985 .proc_handler = &arlan_sysctl_inforxRing, 975 .proc_handler = &arlan_sysctl_inforxRing,
986 }, 976 },
987 { 977 {
988 .ctl_name = 152,
989 .procname = "arlan1-18", 978 .procname = "arlan1-18",
990 .data = &arlan_drive_info, 979 .data = &arlan_drive_info,
991 .maxlen = ARLAN_STR_SIZE, 980 .maxlen = ARLAN_STR_SIZE,
@@ -993,7 +982,6 @@ static ctl_table arlan_conf_table1[] =
993 .proc_handler = &arlan_sysctl_info18, 982 .proc_handler = &arlan_sysctl_info18,
994 }, 983 },
995 { 984 {
996 .ctl_name = 153,
997 .procname = "arlan1-ring", 985 .procname = "arlan1-ring",
998 .data = &arlan_drive_info, 986 .data = &arlan_drive_info,
999 .maxlen = ARLAN_STR_SIZE, 987 .maxlen = ARLAN_STR_SIZE,
@@ -1001,7 +989,6 @@ static ctl_table arlan_conf_table1[] =
1001 .proc_handler = &arlan_sysctl_info161719, 989 .proc_handler = &arlan_sysctl_info161719,
1002 }, 990 },
1003 { 991 {
1004 .ctl_name = 154,
1005 .procname = "arlan1-shm-cpy", 992 .procname = "arlan1-shm-cpy",
1006 .data = &arlan_drive_info, 993 .data = &arlan_drive_info,
1007 .maxlen = ARLAN_STR_SIZE, 994 .maxlen = ARLAN_STR_SIZE,
@@ -1010,7 +997,6 @@ static ctl_table arlan_conf_table1[] =
1010 }, 997 },
1011#endif 998#endif
1012 { 999 {
1013 .ctl_name = 155,
1014 .procname = "config1", 1000 .procname = "config1",
1015 .data = &conf_reset_result, 1001 .data = &conf_reset_result,
1016 .maxlen = 100, 1002 .maxlen = 100,
@@ -1018,14 +1004,13 @@ static ctl_table arlan_conf_table1[] =
1018 .proc_handler = &arlan_configure, 1004 .proc_handler = &arlan_configure,
1019 }, 1005 },
1020 { 1006 {
1021 .ctl_name = 156,
1022 .procname = "reset1", 1007 .procname = "reset1",
1023 .data = &conf_reset_result, 1008 .data = &conf_reset_result,
1024 .maxlen = 100, 1009 .maxlen = 100,
1025 .mode = 0400, 1010 .mode = 0400,
1026 .proc_handler = &arlan_sysctl_reset, 1011 .proc_handler = &arlan_sysctl_reset,
1027 }, 1012 },
1028 { .ctl_name = 0 } 1013 { }
1029}; 1014};
1030 1015
1031static ctl_table arlan_conf_table2[] = 1016static ctl_table arlan_conf_table2[] =
@@ -1035,7 +1020,6 @@ static ctl_table arlan_conf_table2[] =
1035 1020
1036#ifdef ARLAN_PROC_SHM_DUMP 1021#ifdef ARLAN_PROC_SHM_DUMP
1037 { 1022 {
1038 .ctl_name = 150,
1039 .procname = "arlan2-txRing", 1023 .procname = "arlan2-txRing",
1040 .data = &arlan_drive_info, 1024 .data = &arlan_drive_info,
1041 .maxlen = ARLAN_STR_SIZE, 1025 .maxlen = ARLAN_STR_SIZE,
@@ -1043,7 +1027,6 @@ static ctl_table arlan_conf_table2[] =
1043 .proc_handler = &arlan_sysctl_infotxRing, 1027 .proc_handler = &arlan_sysctl_infotxRing,
1044 }, 1028 },
1045 { 1029 {
1046 .ctl_name = 151,
1047 .procname = "arlan2-rxRing", 1030 .procname = "arlan2-rxRing",
1048 .data = &arlan_drive_info, 1031 .data = &arlan_drive_info,
1049 .maxlen = ARLAN_STR_SIZE, 1032 .maxlen = ARLAN_STR_SIZE,
@@ -1051,7 +1034,6 @@ static ctl_table arlan_conf_table2[] =
1051 .proc_handler = &arlan_sysctl_inforxRing, 1034 .proc_handler = &arlan_sysctl_inforxRing,
1052 }, 1035 },
1053 { 1036 {
1054 .ctl_name = 152,
1055 .procname = "arlan2-18", 1037 .procname = "arlan2-18",
1056 .data = &arlan_drive_info, 1038 .data = &arlan_drive_info,
1057 .maxlen = ARLAN_STR_SIZE, 1039 .maxlen = ARLAN_STR_SIZE,
@@ -1059,7 +1041,6 @@ static ctl_table arlan_conf_table2[] =
1059 .proc_handler = &arlan_sysctl_info18, 1041 .proc_handler = &arlan_sysctl_info18,
1060 }, 1042 },
1061 { 1043 {
1062 .ctl_name = 153,
1063 .procname = "arlan2-ring", 1044 .procname = "arlan2-ring",
1064 .data = &arlan_drive_info, 1045 .data = &arlan_drive_info,
1065 .maxlen = ARLAN_STR_SIZE, 1046 .maxlen = ARLAN_STR_SIZE,
@@ -1067,7 +1048,6 @@ static ctl_table arlan_conf_table2[] =
1067 .proc_handler = &arlan_sysctl_info161719, 1048 .proc_handler = &arlan_sysctl_info161719,
1068 }, 1049 },
1069 { 1050 {
1070 .ctl_name = 154,
1071 .procname = "arlan2-shm-cpy", 1051 .procname = "arlan2-shm-cpy",
1072 .data = &arlan_drive_info, 1052 .data = &arlan_drive_info,
1073 .maxlen = ARLAN_STR_SIZE, 1053 .maxlen = ARLAN_STR_SIZE,
@@ -1076,7 +1056,6 @@ static ctl_table arlan_conf_table2[] =
1076 }, 1056 },
1077#endif 1057#endif
1078 { 1058 {
1079 .ctl_name = 155,
1080 .procname = "config2", 1059 .procname = "config2",
1081 .data = &conf_reset_result, 1060 .data = &conf_reset_result,
1082 .maxlen = 100, 1061 .maxlen = 100,
@@ -1084,14 +1063,13 @@ static ctl_table arlan_conf_table2[] =
1084 .proc_handler = &arlan_configure, 1063 .proc_handler = &arlan_configure,
1085 }, 1064 },
1086 { 1065 {
1087 .ctl_name = 156,
1088 .procname = "reset2", 1066 .procname = "reset2",
1089 .data = &conf_reset_result, 1067 .data = &conf_reset_result,
1090 .maxlen = 100, 1068 .maxlen = 100,
1091 .mode = 0400, 1069 .mode = 0400,
1092 .proc_handler = &arlan_sysctl_reset, 1070 .proc_handler = &arlan_sysctl_reset,
1093 }, 1071 },
1094 { .ctl_name = 0 } 1072 { }
1095}; 1073};
1096 1074
1097static ctl_table arlan_conf_table3[] = 1075static ctl_table arlan_conf_table3[] =
@@ -1101,7 +1079,6 @@ static ctl_table arlan_conf_table3[] =
1101 1079
1102#ifdef ARLAN_PROC_SHM_DUMP 1080#ifdef ARLAN_PROC_SHM_DUMP
1103 { 1081 {
1104 .ctl_name = 150,
1105 .procname = "arlan3-txRing", 1082 .procname = "arlan3-txRing",
1106 .data = &arlan_drive_info, 1083 .data = &arlan_drive_info,
1107 .maxlen = ARLAN_STR_SIZE, 1084 .maxlen = ARLAN_STR_SIZE,
@@ -1109,7 +1086,6 @@ static ctl_table arlan_conf_table3[] =
1109 .proc_handler = &arlan_sysctl_infotxRing, 1086 .proc_handler = &arlan_sysctl_infotxRing,
1110 }, 1087 },
1111 { 1088 {
1112 .ctl_name = 151,
1113 .procname = "arlan3-rxRing", 1089 .procname = "arlan3-rxRing",
1114 .data = &arlan_drive_info, 1090 .data = &arlan_drive_info,
1115 .maxlen = ARLAN_STR_SIZE, 1091 .maxlen = ARLAN_STR_SIZE,
@@ -1117,7 +1093,6 @@ static ctl_table arlan_conf_table3[] =
1117 .proc_handler = &arlan_sysctl_inforxRing, 1093 .proc_handler = &arlan_sysctl_inforxRing,
1118 }, 1094 },
1119 { 1095 {
1120 .ctl_name = 152,
1121 .procname = "arlan3-18", 1096 .procname = "arlan3-18",
1122 .data = &arlan_drive_info, 1097 .data = &arlan_drive_info,
1123 .maxlen = ARLAN_STR_SIZE, 1098 .maxlen = ARLAN_STR_SIZE,
@@ -1125,7 +1100,6 @@ static ctl_table arlan_conf_table3[] =
1125 .proc_handler = &arlan_sysctl_info18, 1100 .proc_handler = &arlan_sysctl_info18,
1126 }, 1101 },
1127 { 1102 {
1128 .ctl_name = 153,
1129 .procname = "arlan3-ring", 1103 .procname = "arlan3-ring",
1130 .data = &arlan_drive_info, 1104 .data = &arlan_drive_info,
1131 .maxlen = ARLAN_STR_SIZE, 1105 .maxlen = ARLAN_STR_SIZE,
@@ -1133,7 +1107,6 @@ static ctl_table arlan_conf_table3[] =
1133 .proc_handler = &arlan_sysctl_info161719, 1107 .proc_handler = &arlan_sysctl_info161719,
1134 }, 1108 },
1135 { 1109 {
1136 .ctl_name = 154,
1137 .procname = "arlan3-shm-cpy", 1110 .procname = "arlan3-shm-cpy",
1138 .data = &arlan_drive_info, 1111 .data = &arlan_drive_info,
1139 .maxlen = ARLAN_STR_SIZE, 1112 .maxlen = ARLAN_STR_SIZE,
@@ -1142,7 +1115,6 @@ static ctl_table arlan_conf_table3[] =
1142 }, 1115 },
1143#endif 1116#endif
1144 { 1117 {
1145 .ctl_name = 155,
1146 .procname = "config3", 1118 .procname = "config3",
1147 .data = &conf_reset_result, 1119 .data = &conf_reset_result,
1148 .maxlen = 100, 1120 .maxlen = 100,
@@ -1150,14 +1122,13 @@ static ctl_table arlan_conf_table3[] =
1150 .proc_handler = &arlan_configure, 1122 .proc_handler = &arlan_configure,
1151 }, 1123 },
1152 { 1124 {
1153 .ctl_name = 156,
1154 .procname = "reset3", 1125 .procname = "reset3",
1155 .data = &conf_reset_result, 1126 .data = &conf_reset_result,
1156 .maxlen = 100, 1127 .maxlen = 100,
1157 .mode = 0400, 1128 .mode = 0400,
1158 .proc_handler = &arlan_sysctl_reset, 1129 .proc_handler = &arlan_sysctl_reset,
1159 }, 1130 },
1160 { .ctl_name = 0 } 1131 { }
1161}; 1132};
1162 1133
1163 1134
@@ -1165,41 +1136,37 @@ static ctl_table arlan_conf_table3[] =
1165static ctl_table arlan_table[] = 1136static ctl_table arlan_table[] =
1166{ 1137{
1167 { 1138 {
1168 .ctl_name = 0,
1169 .procname = "arlan0", 1139 .procname = "arlan0",
1170 .maxlen = 0, 1140 .maxlen = 0,
1171 .mode = 0600, 1141 .mode = 0600,
1172 .child = arlan_conf_table0, 1142 .child = arlan_conf_table0,
1173 }, 1143 },
1174 { 1144 {
1175 .ctl_name = 0,
1176 .procname = "arlan1", 1145 .procname = "arlan1",
1177 .maxlen = 0, 1146 .maxlen = 0,
1178 .mode = 0600, 1147 .mode = 0600,
1179 .child = arlan_conf_table1, 1148 .child = arlan_conf_table1,
1180 }, 1149 },
1181 { 1150 {
1182 .ctl_name = 0,
1183 .procname = "arlan2", 1151 .procname = "arlan2",
1184 .maxlen = 0, 1152 .maxlen = 0,
1185 .mode = 0600, 1153 .mode = 0600,
1186 .child = arlan_conf_table2, 1154 .child = arlan_conf_table2,
1187 }, 1155 },
1188 { 1156 {
1189 .ctl_name = 0,
1190 .procname = "arlan3", 1157 .procname = "arlan3",
1191 .maxlen = 0, 1158 .maxlen = 0,
1192 .mode = 0600, 1159 .mode = 0600,
1193 .child = arlan_conf_table3, 1160 .child = arlan_conf_table3,
1194 }, 1161 },
1195 { .ctl_name = 0 } 1162 { }
1196}; 1163};
1197 1164
1198#else 1165#else
1199 1166
1200static ctl_table arlan_table[MAX_ARLANS + 1] = 1167static ctl_table arlan_table[] =
1201{ 1168{
1202 { .ctl_name = 0 } 1169 { }
1203}; 1170};
1204#endif 1171#endif
1205 1172
@@ -1209,22 +1176,14 @@ static ctl_table arlan_table[MAX_ARLANS + 1] =
1209static ctl_table arlan_root_table[] = 1176static ctl_table arlan_root_table[] =
1210{ 1177{
1211 { 1178 {
1212 .ctl_name = CTL_ARLAN,
1213 .procname = "arlan", 1179 .procname = "arlan",
1214 .maxlen = 0, 1180 .maxlen = 0,
1215 .mode = 0555, 1181 .mode = 0555,
1216 .child = arlan_table, 1182 .child = arlan_table,
1217 }, 1183 },
1218 { .ctl_name = 0 } 1184 { }
1219}; 1185};
1220 1186
1221/* Make sure that /proc/sys/dev is there */
1222//static ctl_table arlan_device_root_table[] =
1223//{
1224// {CTL_DEV, "dev", NULL, 0, 0555, arlan_root_table},
1225// {0}
1226//};
1227
1228 1187
1229static struct ctl_table_header *arlan_device_sysctl_header; 1188static struct ctl_table_header *arlan_device_sysctl_header;
1230 1189
@@ -1234,8 +1193,6 @@ int __init init_arlan_proc(void)
1234 int i = 0; 1193 int i = 0;
1235 if (arlan_device_sysctl_header) 1194 if (arlan_device_sysctl_header)
1236 return 0; 1195 return 0;
1237 for (i = 0; i < MAX_ARLANS && arlan_device[i]; i++)
1238 arlan_table[i].ctl_name = i + 1;
1239 arlan_device_sysctl_header = register_sysctl_table(arlan_root_table); 1196 arlan_device_sysctl_header = register_sysctl_table(arlan_root_table);
1240 if (!arlan_device_sysctl_header) 1197 if (!arlan_device_sysctl_header)
1241 return -1; 1198 return -1;
diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c
index 8eefe56f1cbe..f808bdbf1772 100644
--- a/drivers/parport/procfs.c
+++ b/drivers/parport/procfs.c
@@ -233,10 +233,10 @@ static int do_hardware_modes (ctl_table *table, int write,
233 return copy_to_user(result, buffer, len) ? -EFAULT : 0; 233 return copy_to_user(result, buffer, len) ? -EFAULT : 0;
234} 234}
235 235
236#define PARPORT_PORT_DIR(CHILD) { .ctl_name = 0, .procname = NULL, .mode = 0555, .child = CHILD } 236#define PARPORT_PORT_DIR(CHILD) { .procname = NULL, .mode = 0555, .child = CHILD }
237#define PARPORT_PARPORT_DIR(CHILD) { .ctl_name = DEV_PARPORT, .procname = "parport", \ 237#define PARPORT_PARPORT_DIR(CHILD) { .procname = "parport", \
238 .mode = 0555, .child = CHILD } 238 .mode = 0555, .child = CHILD }
239#define PARPORT_DEV_DIR(CHILD) { .ctl_name = CTL_DEV, .procname = "dev", .mode = 0555, .child = CHILD } 239#define PARPORT_DEV_DIR(CHILD) { .procname = "dev", .mode = 0555, .child = CHILD }
240#define PARPORT_DEVICES_ROOT_DIR { .procname = "devices", \ 240#define PARPORT_DEVICES_ROOT_DIR { .procname = "devices", \
241 .mode = 0555, .child = NULL } 241 .mode = 0555, .child = NULL }
242 242
@@ -393,7 +393,6 @@ parport_device_sysctl_template = {
393 }, 393 },
394 { 394 {
395 { 395 {
396 .ctl_name = 0,
397 .procname = NULL, 396 .procname = NULL,
398 .data = NULL, 397 .data = NULL,
399 .maxlen = 0, 398 .maxlen = 0,
@@ -455,7 +454,6 @@ parport_default_sysctl_table = {
455 }, 454 },
456 { 455 {
457 { 456 {
458 .ctl_name = DEV_PARPORT_DEFAULT,
459 .procname = "default", 457 .procname = "default",
460 .mode = 0555, 458 .mode = 0555,
461 .child = parport_default_sysctl_table.vars 459 .child = parport_default_sysctl_table.vars
@@ -495,7 +493,6 @@ int parport_proc_register(struct parport *port)
495 t->vars[6 + i].extra2 = &port->probe_info[i]; 493 t->vars[6 + i].extra2 = &port->probe_info[i];
496 494
497 t->port_dir[0].procname = port->name; 495 t->port_dir[0].procname = port->name;
498 t->port_dir[0].ctl_name = 0;
499 496
500 t->port_dir[0].child = t->vars; 497 t->port_dir[0].child = t->vars;
501 t->parport_dir[0].child = t->port_dir; 498 t->parport_dir[0].child = t->port_dir;
@@ -534,11 +531,9 @@ int parport_device_proc_register(struct pardevice *device)
534 t->dev_dir[0].child = t->parport_dir; 531 t->dev_dir[0].child = t->parport_dir;
535 t->parport_dir[0].child = t->port_dir; 532 t->parport_dir[0].child = t->port_dir;
536 t->port_dir[0].procname = port->name; 533 t->port_dir[0].procname = port->name;
537 t->port_dir[0].ctl_name = 0;
538 t->port_dir[0].child = t->devices_root_dir; 534 t->port_dir[0].child = t->devices_root_dir;
539 t->devices_root_dir[0].child = t->device_dir; 535 t->devices_root_dir[0].child = t->device_dir;
540 536
541 t->device_dir[0].ctl_name = 0;
542 t->device_dir[0].procname = device->name; 537 t->device_dir[0].procname = device->name;
543 t->device_dir[0].child = t->vars; 538 t->device_dir[0].child = t->vars;
544 t->vars[0].data = &device->timeslice; 539 t->vars[0].data = &device->timeslice;
diff --git a/drivers/s390/char/sclp_async.c b/drivers/s390/char/sclp_async.c
index b44462a6c6d3..740fe405c395 100644
--- a/drivers/s390/char/sclp_async.c
+++ b/drivers/s390/char/sclp_async.c
@@ -101,18 +101,17 @@ static struct ctl_table callhome_table[] = {
101 .mode = 0644, 101 .mode = 0644,
102 .proc_handler = proc_handler_callhome, 102 .proc_handler = proc_handler_callhome,
103 }, 103 },
104 { .ctl_name = 0 } 104 {}
105}; 105};
106 106
107static struct ctl_table kern_dir_table[] = { 107static struct ctl_table kern_dir_table[] = {
108 { 108 {
109 .ctl_name = CTL_KERN,
110 .procname = "kernel", 109 .procname = "kernel",
111 .maxlen = 0, 110 .maxlen = 0,
112 .mode = 0555, 111 .mode = 0555,
113 .child = callhome_table, 112 .child = callhome_table,
114 }, 113 },
115 { .ctl_name = 0 } 114 {}
116}; 115};
117 116
118/* 117/*
diff --git a/drivers/scsi/scsi_sysctl.c b/drivers/scsi/scsi_sysctl.c
index 63a30f566f3a..42c31bee7113 100644
--- a/drivers/scsi/scsi_sysctl.c
+++ b/drivers/scsi/scsi_sysctl.c
@@ -13,8 +13,7 @@
13 13
14 14
15static ctl_table scsi_table[] = { 15static ctl_table scsi_table[] = {
16 { .ctl_name = DEV_SCSI_LOGGING_LEVEL, 16 { .procname = "logging_level",
17 .procname = "logging_level",
18 .data = &scsi_logging_level, 17 .data = &scsi_logging_level,
19 .maxlen = sizeof(scsi_logging_level), 18 .maxlen = sizeof(scsi_logging_level),
20 .mode = 0644, 19 .mode = 0644,
@@ -23,16 +22,14 @@ static ctl_table scsi_table[] = {
23}; 22};
24 23
25static ctl_table scsi_dir_table[] = { 24static ctl_table scsi_dir_table[] = {
26 { .ctl_name = DEV_SCSI, 25 { .procname = "scsi",
27 .procname = "scsi",
28 .mode = 0555, 26 .mode = 0555,
29 .child = scsi_table }, 27 .child = scsi_table },
30 { } 28 { }
31}; 29};
32 30
33static ctl_table scsi_root_table[] = { 31static ctl_table scsi_root_table[] = {
34 { .ctl_name = CTL_DEV, 32 { .procname = "dev",
35 .procname = "dev",
36 .mode = 0555, 33 .mode = 0555,
37 .child = scsi_dir_table }, 34 .child = scsi_dir_table },
38 { } 35 { }
diff --git a/fs/coda/sysctl.c b/fs/coda/sysctl.c
index 43c96ce29614..354c050d4263 100644
--- a/fs/coda/sysctl.c
+++ b/fs/coda/sysctl.c
@@ -17,7 +17,6 @@ static struct ctl_table_header *fs_table_header;
17 17
18static ctl_table coda_table[] = { 18static ctl_table coda_table[] = {
19 { 19 {
20 .ctl_name = CTL_UNNUMBERED,
21 .procname = "timeout", 20 .procname = "timeout",
22 .data = &coda_timeout, 21 .data = &coda_timeout,
23 .maxlen = sizeof(int), 22 .maxlen = sizeof(int),
@@ -25,7 +24,6 @@ static ctl_table coda_table[] = {
25 .proc_handler = &proc_dointvec 24 .proc_handler = &proc_dointvec
26 }, 25 },
27 { 26 {
28 .ctl_name = CTL_UNNUMBERED,
29 .procname = "hard", 27 .procname = "hard",
30 .data = &coda_hard, 28 .data = &coda_hard,
31 .maxlen = sizeof(int), 29 .maxlen = sizeof(int),
@@ -33,7 +31,6 @@ static ctl_table coda_table[] = {
33 .proc_handler = &proc_dointvec 31 .proc_handler = &proc_dointvec
34 }, 32 },
35 { 33 {
36 .ctl_name = CTL_UNNUMBERED,
37 .procname = "fake_statfs", 34 .procname = "fake_statfs",
38 .data = &coda_fake_statfs, 35 .data = &coda_fake_statfs,
39 .maxlen = sizeof(int), 36 .maxlen = sizeof(int),
@@ -46,7 +43,6 @@ static ctl_table coda_table[] = {
46#ifdef CONFIG_SYSCTL 43#ifdef CONFIG_SYSCTL
47static ctl_table fs_table[] = { 44static ctl_table fs_table[] = {
48 { 45 {
49 .ctl_name = CTL_UNNUMBERED,
50 .procname = "coda", 46 .procname = "coda",
51 .mode = 0555, 47 .mode = 0555,
52 .child = coda_table 48 .child = coda_table
diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index 085c5c063420..70aa66c96c51 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -254,7 +254,7 @@ ctl_table epoll_table[] = {
254 .proc_handler = &proc_dointvec_minmax, 254 .proc_handler = &proc_dointvec_minmax,
255 .extra1 = &zero, 255 .extra1 = &zero,
256 }, 256 },
257 { .ctl_name = 0 } 257 { }
258}; 258};
259#endif /* CONFIG_SYSCTL */ 259#endif /* CONFIG_SYSCTL */
260 260
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c
index 1a54ae14a192..307ed4c3e1f5 100644
--- a/fs/lockd/svc.c
+++ b/fs/lockd/svc.c
@@ -371,7 +371,6 @@ EXPORT_SYMBOL_GPL(lockd_down);
371 371
372static ctl_table nlm_sysctls[] = { 372static ctl_table nlm_sysctls[] = {
373 { 373 {
374 .ctl_name = CTL_UNNUMBERED,
375 .procname = "nlm_grace_period", 374 .procname = "nlm_grace_period",
376 .data = &nlm_grace_period, 375 .data = &nlm_grace_period,
377 .maxlen = sizeof(unsigned long), 376 .maxlen = sizeof(unsigned long),
@@ -381,7 +380,6 @@ static ctl_table nlm_sysctls[] = {
381 .extra2 = (unsigned long *) &nlm_grace_period_max, 380 .extra2 = (unsigned long *) &nlm_grace_period_max,
382 }, 381 },
383 { 382 {
384 .ctl_name = CTL_UNNUMBERED,
385 .procname = "nlm_timeout", 383 .procname = "nlm_timeout",
386 .data = &nlm_timeout, 384 .data = &nlm_timeout,
387 .maxlen = sizeof(unsigned long), 385 .maxlen = sizeof(unsigned long),
@@ -391,7 +389,6 @@ static ctl_table nlm_sysctls[] = {
391 .extra2 = (unsigned long *) &nlm_timeout_max, 389 .extra2 = (unsigned long *) &nlm_timeout_max,
392 }, 390 },
393 { 391 {
394 .ctl_name = CTL_UNNUMBERED,
395 .procname = "nlm_udpport", 392 .procname = "nlm_udpport",
396 .data = &nlm_udpport, 393 .data = &nlm_udpport,
397 .maxlen = sizeof(int), 394 .maxlen = sizeof(int),
@@ -401,7 +398,6 @@ static ctl_table nlm_sysctls[] = {
401 .extra2 = (int *) &nlm_port_max, 398 .extra2 = (int *) &nlm_port_max,
402 }, 399 },
403 { 400 {
404 .ctl_name = CTL_UNNUMBERED,
405 .procname = "nlm_tcpport", 401 .procname = "nlm_tcpport",
406 .data = &nlm_tcpport, 402 .data = &nlm_tcpport,
407 .maxlen = sizeof(int), 403 .maxlen = sizeof(int),
@@ -411,7 +407,6 @@ static ctl_table nlm_sysctls[] = {
411 .extra2 = (int *) &nlm_port_max, 407 .extra2 = (int *) &nlm_port_max,
412 }, 408 },
413 { 409 {
414 .ctl_name = CTL_UNNUMBERED,
415 .procname = "nsm_use_hostnames", 410 .procname = "nsm_use_hostnames",
416 .data = &nsm_use_hostnames, 411 .data = &nsm_use_hostnames,
417 .maxlen = sizeof(int), 412 .maxlen = sizeof(int),
@@ -419,34 +414,31 @@ static ctl_table nlm_sysctls[] = {
419 .proc_handler = &proc_dointvec, 414 .proc_handler = &proc_dointvec,
420 }, 415 },
421 { 416 {
422 .ctl_name = CTL_UNNUMBERED,
423 .procname = "nsm_local_state", 417 .procname = "nsm_local_state",
424 .data = &nsm_local_state, 418 .data = &nsm_local_state,
425 .maxlen = sizeof(int), 419 .maxlen = sizeof(int),
426 .mode = 0644, 420 .mode = 0644,
427 .proc_handler = &proc_dointvec, 421 .proc_handler = &proc_dointvec,
428 }, 422 },
429 { .ctl_name = 0 } 423 { }
430}; 424};
431 425
432static ctl_table nlm_sysctl_dir[] = { 426static ctl_table nlm_sysctl_dir[] = {
433 { 427 {
434 .ctl_name = CTL_UNNUMBERED,
435 .procname = "nfs", 428 .procname = "nfs",
436 .mode = 0555, 429 .mode = 0555,
437 .child = nlm_sysctls, 430 .child = nlm_sysctls,
438 }, 431 },
439 { .ctl_name = 0 } 432 { }
440}; 433};
441 434
442static ctl_table nlm_sysctl_root[] = { 435static ctl_table nlm_sysctl_root[] = {
443 { 436 {
444 .ctl_name = CTL_FS,
445 .procname = "fs", 437 .procname = "fs",
446 .mode = 0555, 438 .mode = 0555,
447 .child = nlm_sysctl_dir, 439 .child = nlm_sysctl_dir,
448 }, 440 },
449 { .ctl_name = 0 } 441 { }
450}; 442};
451 443
452#endif /* CONFIG_SYSCTL */ 444#endif /* CONFIG_SYSCTL */
diff --git a/fs/nfs/sysctl.c b/fs/nfs/sysctl.c
index b62481dabae9..af51e6af2072 100644
--- a/fs/nfs/sysctl.c
+++ b/fs/nfs/sysctl.c
@@ -22,7 +22,6 @@ static struct ctl_table_header *nfs_callback_sysctl_table;
22static ctl_table nfs_cb_sysctls[] = { 22static ctl_table nfs_cb_sysctls[] = {
23#ifdef CONFIG_NFS_V4 23#ifdef CONFIG_NFS_V4
24 { 24 {
25 .ctl_name = CTL_UNNUMBERED,
26 .procname = "nfs_callback_tcpport", 25 .procname = "nfs_callback_tcpport",
27 .data = &nfs_callback_set_tcpport, 26 .data = &nfs_callback_set_tcpport,
28 .maxlen = sizeof(int), 27 .maxlen = sizeof(int),
@@ -32,53 +31,46 @@ static ctl_table nfs_cb_sysctls[] = {
32 .extra2 = (int *)&nfs_set_port_max, 31 .extra2 = (int *)&nfs_set_port_max,
33 }, 32 },
34 { 33 {
35 .ctl_name = CTL_UNNUMBERED,
36 .procname = "idmap_cache_timeout", 34 .procname = "idmap_cache_timeout",
37 .data = &nfs_idmap_cache_timeout, 35 .data = &nfs_idmap_cache_timeout,
38 .maxlen = sizeof(int), 36 .maxlen = sizeof(int),
39 .mode = 0644, 37 .mode = 0644,
40 .proc_handler = &proc_dointvec_jiffies, 38 .proc_handler = &proc_dointvec_jiffies,
41 .strategy = &sysctl_jiffies,
42 }, 39 },
43#endif 40#endif
44 { 41 {
45 .ctl_name = CTL_UNNUMBERED,
46 .procname = "nfs_mountpoint_timeout", 42 .procname = "nfs_mountpoint_timeout",
47 .data = &nfs_mountpoint_expiry_timeout, 43 .data = &nfs_mountpoint_expiry_timeout,
48 .maxlen = sizeof(nfs_mountpoint_expiry_timeout), 44 .maxlen = sizeof(nfs_mountpoint_expiry_timeout),
49 .mode = 0644, 45 .mode = 0644,
50 .proc_handler = &proc_dointvec_jiffies, 46 .proc_handler = &proc_dointvec_jiffies,
51 .strategy = &sysctl_jiffies,
52 }, 47 },
53 { 48 {
54 .ctl_name = CTL_UNNUMBERED,
55 .procname = "nfs_congestion_kb", 49 .procname = "nfs_congestion_kb",
56 .data = &nfs_congestion_kb, 50 .data = &nfs_congestion_kb,
57 .maxlen = sizeof(nfs_congestion_kb), 51 .maxlen = sizeof(nfs_congestion_kb),
58 .mode = 0644, 52 .mode = 0644,
59 .proc_handler = &proc_dointvec, 53 .proc_handler = &proc_dointvec,
60 }, 54 },
61 { .ctl_name = 0 } 55 { }
62}; 56};
63 57
64static ctl_table nfs_cb_sysctl_dir[] = { 58static ctl_table nfs_cb_sysctl_dir[] = {
65 { 59 {
66 .ctl_name = CTL_UNNUMBERED,
67 .procname = "nfs", 60 .procname = "nfs",
68 .mode = 0555, 61 .mode = 0555,
69 .child = nfs_cb_sysctls, 62 .child = nfs_cb_sysctls,
70 }, 63 },
71 { .ctl_name = 0 } 64 { }
72}; 65};
73 66
74static ctl_table nfs_cb_sysctl_root[] = { 67static ctl_table nfs_cb_sysctl_root[] = {
75 { 68 {
76 .ctl_name = CTL_FS,
77 .procname = "fs", 69 .procname = "fs",
78 .mode = 0555, 70 .mode = 0555,
79 .child = nfs_cb_sysctl_dir, 71 .child = nfs_cb_sysctl_dir,
80 }, 72 },
81 { .ctl_name = 0 } 73 { }
82}; 74};
83 75
84int nfs_register_sysctl(void) 76int nfs_register_sysctl(void)
diff --git a/fs/notify/inotify/inotify_user.c b/fs/notify/inotify/inotify_user.c
index dcd2040d330c..5275921ed1ce 100644
--- a/fs/notify/inotify/inotify_user.c
+++ b/fs/notify/inotify/inotify_user.c
@@ -69,36 +69,30 @@ static int zero;
69 69
70ctl_table inotify_table[] = { 70ctl_table inotify_table[] = {
71 { 71 {
72 .ctl_name = INOTIFY_MAX_USER_INSTANCES,
73 .procname = "max_user_instances", 72 .procname = "max_user_instances",
74 .data = &inotify_max_user_instances, 73 .data = &inotify_max_user_instances,
75 .maxlen = sizeof(int), 74 .maxlen = sizeof(int),
76 .mode = 0644, 75 .mode = 0644,
77 .proc_handler = &proc_dointvec_minmax, 76 .proc_handler = &proc_dointvec_minmax,
78 .strategy = &sysctl_intvec,
79 .extra1 = &zero, 77 .extra1 = &zero,
80 }, 78 },
81 { 79 {
82 .ctl_name = INOTIFY_MAX_USER_WATCHES,
83 .procname = "max_user_watches", 80 .procname = "max_user_watches",
84 .data = &inotify_max_user_watches, 81 .data = &inotify_max_user_watches,
85 .maxlen = sizeof(int), 82 .maxlen = sizeof(int),
86 .mode = 0644, 83 .mode = 0644,
87 .proc_handler = &proc_dointvec_minmax, 84 .proc_handler = &proc_dointvec_minmax,
88 .strategy = &sysctl_intvec,
89 .extra1 = &zero, 85 .extra1 = &zero,
90 }, 86 },
91 { 87 {
92 .ctl_name = INOTIFY_MAX_QUEUED_EVENTS,
93 .procname = "max_queued_events", 88 .procname = "max_queued_events",
94 .data = &inotify_max_queued_events, 89 .data = &inotify_max_queued_events,
95 .maxlen = sizeof(int), 90 .maxlen = sizeof(int),
96 .mode = 0644, 91 .mode = 0644,
97 .proc_handler = &proc_dointvec_minmax, 92 .proc_handler = &proc_dointvec_minmax,
98 .strategy = &sysctl_intvec,
99 .extra1 = &zero 93 .extra1 = &zero
100 }, 94 },
101 { .ctl_name = 0 } 95 { }
102}; 96};
103#endif /* CONFIG_SYSCTL */ 97#endif /* CONFIG_SYSCTL */
104 98
diff --git a/fs/ntfs/sysctl.c b/fs/ntfs/sysctl.c
index 9ef85e628fe1..99612ea690c2 100644
--- a/fs/ntfs/sysctl.c
+++ b/fs/ntfs/sysctl.c
@@ -36,7 +36,6 @@
36/* Definition of the ntfs sysctl. */ 36/* Definition of the ntfs sysctl. */
37static ctl_table ntfs_sysctls[] = { 37static ctl_table ntfs_sysctls[] = {
38 { 38 {
39 .ctl_name = CTL_UNNUMBERED, /* Binary and text IDs. */
40 .procname = "ntfs-debug", 39 .procname = "ntfs-debug",
41 .data = &debug_msgs, /* Data pointer and size. */ 40 .data = &debug_msgs, /* Data pointer and size. */
42 .maxlen = sizeof(debug_msgs), 41 .maxlen = sizeof(debug_msgs),
@@ -49,7 +48,6 @@ static ctl_table ntfs_sysctls[] = {
49/* Define the parent directory /proc/sys/fs. */ 48/* Define the parent directory /proc/sys/fs. */
50static ctl_table sysctls_root[] = { 49static ctl_table sysctls_root[] = {
51 { 50 {
52 .ctl_name = CTL_FS,
53 .procname = "fs", 51 .procname = "fs",
54 .mode = 0555, 52 .mode = 0555,
55 .child = ntfs_sysctls 53 .child = ntfs_sysctls
diff --git a/fs/ocfs2/stackglue.c b/fs/ocfs2/stackglue.c
index 3f2f1c45b7b6..ed12c1161479 100644
--- a/fs/ocfs2/stackglue.c
+++ b/fs/ocfs2/stackglue.c
@@ -620,51 +620,46 @@ error:
620 620
621static ctl_table ocfs2_nm_table[] = { 621static ctl_table ocfs2_nm_table[] = {
622 { 622 {
623 .ctl_name = 1,
624 .procname = "hb_ctl_path", 623 .procname = "hb_ctl_path",
625 .data = ocfs2_hb_ctl_path, 624 .data = ocfs2_hb_ctl_path,
626 .maxlen = OCFS2_MAX_HB_CTL_PATH, 625 .maxlen = OCFS2_MAX_HB_CTL_PATH,
627 .mode = 0644, 626 .mode = 0644,
628 .proc_handler = &proc_dostring, 627 .proc_handler = &proc_dostring,
629 .strategy = &sysctl_string,
630 }, 628 },
631 { .ctl_name = 0 } 629 { }
632}; 630};
633 631
634static ctl_table ocfs2_mod_table[] = { 632static ctl_table ocfs2_mod_table[] = {
635 { 633 {
636 .ctl_name = FS_OCFS2_NM,
637 .procname = "nm", 634 .procname = "nm",
638 .data = NULL, 635 .data = NULL,
639 .maxlen = 0, 636 .maxlen = 0,
640 .mode = 0555, 637 .mode = 0555,
641 .child = ocfs2_nm_table 638 .child = ocfs2_nm_table
642 }, 639 },
643 { .ctl_name = 0} 640 { }
644}; 641};
645 642
646static ctl_table ocfs2_kern_table[] = { 643static ctl_table ocfs2_kern_table[] = {
647 { 644 {
648 .ctl_name = FS_OCFS2,
649 .procname = "ocfs2", 645 .procname = "ocfs2",
650 .data = NULL, 646 .data = NULL,
651 .maxlen = 0, 647 .maxlen = 0,
652 .mode = 0555, 648 .mode = 0555,
653 .child = ocfs2_mod_table 649 .child = ocfs2_mod_table
654 }, 650 },
655 { .ctl_name = 0} 651 { }
656}; 652};
657 653
658static ctl_table ocfs2_root_table[] = { 654static ctl_table ocfs2_root_table[] = {
659 { 655 {
660 .ctl_name = CTL_FS,
661 .procname = "fs", 656 .procname = "fs",
662 .data = NULL, 657 .data = NULL,
663 .maxlen = 0, 658 .maxlen = 0,
664 .mode = 0555, 659 .mode = 0555,
665 .child = ocfs2_kern_table 660 .child = ocfs2_kern_table
666 }, 661 },
667 { .ctl_name = 0 } 662 { }
668}; 663};
669 664
670static struct ctl_table_header *ocfs2_table_header = NULL; 665static struct ctl_table_header *ocfs2_table_header = NULL;
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c
index f667e8aeabdf..6ff9981f0a18 100644
--- a/fs/proc/proc_sysctl.c
+++ b/fs/proc/proc_sysctl.c
@@ -48,7 +48,7 @@ out:
48static struct ctl_table *find_in_table(struct ctl_table *p, struct qstr *name) 48static struct ctl_table *find_in_table(struct ctl_table *p, struct qstr *name)
49{ 49{
50 int len; 50 int len;
51 for ( ; p->ctl_name || p->procname; p++) { 51 for ( ; p->procname; p++) {
52 52
53 if (!p->procname) 53 if (!p->procname)
54 continue; 54 continue;
@@ -218,7 +218,7 @@ static int scan(struct ctl_table_header *head, ctl_table *table,
218 void *dirent, filldir_t filldir) 218 void *dirent, filldir_t filldir)
219{ 219{
220 220
221 for (; table->ctl_name || table->procname; table++, (*pos)++) { 221 for (; table->procname; table++, (*pos)++) {
222 int res; 222 int res;
223 223
224 /* Can't do anything without a proc name */ 224 /* Can't do anything without a proc name */
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index 39b49c42a7ed..60940f8709d6 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -2473,7 +2473,6 @@ const struct quotactl_ops vfs_quotactl_ops = {
2473 2473
2474static ctl_table fs_dqstats_table[] = { 2474static ctl_table fs_dqstats_table[] = {
2475 { 2475 {
2476 .ctl_name = FS_DQ_LOOKUPS,
2477 .procname = "lookups", 2476 .procname = "lookups",
2478 .data = &dqstats.lookups, 2477 .data = &dqstats.lookups,
2479 .maxlen = sizeof(int), 2478 .maxlen = sizeof(int),
@@ -2481,7 +2480,6 @@ static ctl_table fs_dqstats_table[] = {
2481 .proc_handler = &proc_dointvec, 2480 .proc_handler = &proc_dointvec,
2482 }, 2481 },
2483 { 2482 {
2484 .ctl_name = FS_DQ_DROPS,
2485 .procname = "drops", 2483 .procname = "drops",
2486 .data = &dqstats.drops, 2484 .data = &dqstats.drops,
2487 .maxlen = sizeof(int), 2485 .maxlen = sizeof(int),
@@ -2489,7 +2487,6 @@ static ctl_table fs_dqstats_table[] = {
2489 .proc_handler = &proc_dointvec, 2487 .proc_handler = &proc_dointvec,
2490 }, 2488 },
2491 { 2489 {
2492 .ctl_name = FS_DQ_READS,
2493 .procname = "reads", 2490 .procname = "reads",
2494 .data = &dqstats.reads, 2491 .data = &dqstats.reads,
2495 .maxlen = sizeof(int), 2492 .maxlen = sizeof(int),
@@ -2497,7 +2494,6 @@ static ctl_table fs_dqstats_table[] = {
2497 .proc_handler = &proc_dointvec, 2494 .proc_handler = &proc_dointvec,
2498 }, 2495 },
2499 { 2496 {
2500 .ctl_name = FS_DQ_WRITES,
2501 .procname = "writes", 2497 .procname = "writes",
2502 .data = &dqstats.writes, 2498 .data = &dqstats.writes,
2503 .maxlen = sizeof(int), 2499 .maxlen = sizeof(int),
@@ -2505,7 +2501,6 @@ static ctl_table fs_dqstats_table[] = {
2505 .proc_handler = &proc_dointvec, 2501 .proc_handler = &proc_dointvec,
2506 }, 2502 },
2507 { 2503 {
2508 .ctl_name = FS_DQ_CACHE_HITS,
2509 .procname = "cache_hits", 2504 .procname = "cache_hits",
2510 .data = &dqstats.cache_hits, 2505 .data = &dqstats.cache_hits,
2511 .maxlen = sizeof(int), 2506 .maxlen = sizeof(int),
@@ -2513,7 +2508,6 @@ static ctl_table fs_dqstats_table[] = {
2513 .proc_handler = &proc_dointvec, 2508 .proc_handler = &proc_dointvec,
2514 }, 2509 },
2515 { 2510 {
2516 .ctl_name = FS_DQ_ALLOCATED,
2517 .procname = "allocated_dquots", 2511 .procname = "allocated_dquots",
2518 .data = &dqstats.allocated_dquots, 2512 .data = &dqstats.allocated_dquots,
2519 .maxlen = sizeof(int), 2513 .maxlen = sizeof(int),
@@ -2521,7 +2515,6 @@ static ctl_table fs_dqstats_table[] = {
2521 .proc_handler = &proc_dointvec, 2515 .proc_handler = &proc_dointvec,
2522 }, 2516 },
2523 { 2517 {
2524 .ctl_name = FS_DQ_FREE,
2525 .procname = "free_dquots", 2518 .procname = "free_dquots",
2526 .data = &dqstats.free_dquots, 2519 .data = &dqstats.free_dquots,
2527 .maxlen = sizeof(int), 2520 .maxlen = sizeof(int),
@@ -2529,7 +2522,6 @@ static ctl_table fs_dqstats_table[] = {
2529 .proc_handler = &proc_dointvec, 2522 .proc_handler = &proc_dointvec,
2530 }, 2523 },
2531 { 2524 {
2532 .ctl_name = FS_DQ_SYNCS,
2533 .procname = "syncs", 2525 .procname = "syncs",
2534 .data = &dqstats.syncs, 2526 .data = &dqstats.syncs,
2535 .maxlen = sizeof(int), 2527 .maxlen = sizeof(int),
@@ -2538,7 +2530,6 @@ static ctl_table fs_dqstats_table[] = {
2538 }, 2530 },
2539#ifdef CONFIG_PRINT_QUOTA_WARNING 2531#ifdef CONFIG_PRINT_QUOTA_WARNING
2540 { 2532 {
2541 .ctl_name = FS_DQ_WARNINGS,
2542 .procname = "warnings", 2533 .procname = "warnings",
2543 .data = &flag_print_warnings, 2534 .data = &flag_print_warnings,
2544 .maxlen = sizeof(int), 2535 .maxlen = sizeof(int),
@@ -2546,27 +2537,25 @@ static ctl_table fs_dqstats_table[] = {
2546 .proc_handler = &proc_dointvec, 2537 .proc_handler = &proc_dointvec,
2547 }, 2538 },
2548#endif 2539#endif
2549 { .ctl_name = 0 }, 2540 { },
2550}; 2541};
2551 2542
2552static ctl_table fs_table[] = { 2543static ctl_table fs_table[] = {
2553 { 2544 {
2554 .ctl_name = FS_DQSTATS,
2555 .procname = "quota", 2545 .procname = "quota",
2556 .mode = 0555, 2546 .mode = 0555,
2557 .child = fs_dqstats_table, 2547 .child = fs_dqstats_table,
2558 }, 2548 },
2559 { .ctl_name = 0 }, 2549 { },
2560}; 2550};
2561 2551
2562static ctl_table sys_table[] = { 2552static ctl_table sys_table[] = {
2563 { 2553 {
2564 .ctl_name = CTL_FS,
2565 .procname = "fs", 2554 .procname = "fs",
2566 .mode = 0555, 2555 .mode = 0555,
2567 .child = fs_table, 2556 .child = fs_table,
2568 }, 2557 },
2569 { .ctl_name = 0 }, 2558 { },
2570}; 2559};
2571 2560
2572static int __init dquot_init(void) 2561static int __init dquot_init(void)
diff --git a/fs/xfs/linux-2.6/xfs_sysctl.c b/fs/xfs/linux-2.6/xfs_sysctl.c
index c5bc67c4e3bb..6880147cafa8 100644
--- a/fs/xfs/linux-2.6/xfs_sysctl.c
+++ b/fs/xfs/linux-2.6/xfs_sysctl.c
@@ -55,170 +55,140 @@ xfs_stats_clear_proc_handler(
55 55
56static ctl_table xfs_table[] = { 56static ctl_table xfs_table[] = {
57 { 57 {
58 .ctl_name = XFS_SGID_INHERIT,
59 .procname = "irix_sgid_inherit", 58 .procname = "irix_sgid_inherit",
60 .data = &xfs_params.sgid_inherit.val, 59 .data = &xfs_params.sgid_inherit.val,
61 .maxlen = sizeof(int), 60 .maxlen = sizeof(int),
62 .mode = 0644, 61 .mode = 0644,
63 .proc_handler = &proc_dointvec_minmax, 62 .proc_handler = &proc_dointvec_minmax,
64 .strategy = &sysctl_intvec,
65 .extra1 = &xfs_params.sgid_inherit.min, 63 .extra1 = &xfs_params.sgid_inherit.min,
66 .extra2 = &xfs_params.sgid_inherit.max 64 .extra2 = &xfs_params.sgid_inherit.max
67 }, 65 },
68 { 66 {
69 .ctl_name = XFS_SYMLINK_MODE,
70 .procname = "irix_symlink_mode", 67 .procname = "irix_symlink_mode",
71 .data = &xfs_params.symlink_mode.val, 68 .data = &xfs_params.symlink_mode.val,
72 .maxlen = sizeof(int), 69 .maxlen = sizeof(int),
73 .mode = 0644, 70 .mode = 0644,
74 .proc_handler = &proc_dointvec_minmax, 71 .proc_handler = &proc_dointvec_minmax,
75 .strategy = &sysctl_intvec,
76 .extra1 = &xfs_params.symlink_mode.min, 72 .extra1 = &xfs_params.symlink_mode.min,
77 .extra2 = &xfs_params.symlink_mode.max 73 .extra2 = &xfs_params.symlink_mode.max
78 }, 74 },
79 { 75 {
80 .ctl_name = XFS_PANIC_MASK,
81 .procname = "panic_mask", 76 .procname = "panic_mask",
82 .data = &xfs_params.panic_mask.val, 77 .data = &xfs_params.panic_mask.val,
83 .maxlen = sizeof(int), 78 .maxlen = sizeof(int),
84 .mode = 0644, 79 .mode = 0644,
85 .proc_handler = &proc_dointvec_minmax, 80 .proc_handler = &proc_dointvec_minmax,
86 .strategy = &sysctl_intvec,
87 .extra1 = &xfs_params.panic_mask.min, 81 .extra1 = &xfs_params.panic_mask.min,
88 .extra2 = &xfs_params.panic_mask.max 82 .extra2 = &xfs_params.panic_mask.max
89 }, 83 },
90 84
91 { 85 {
92 .ctl_name = XFS_ERRLEVEL,
93 .procname = "error_level", 86 .procname = "error_level",
94 .data = &xfs_params.error_level.val, 87 .data = &xfs_params.error_level.val,
95 .maxlen = sizeof(int), 88 .maxlen = sizeof(int),
96 .mode = 0644, 89 .mode = 0644,
97 .proc_handler = &proc_dointvec_minmax, 90 .proc_handler = &proc_dointvec_minmax,
98 .strategy = &sysctl_intvec,
99 .extra1 = &xfs_params.error_level.min, 91 .extra1 = &xfs_params.error_level.min,
100 .extra2 = &xfs_params.error_level.max 92 .extra2 = &xfs_params.error_level.max
101 }, 93 },
102 { 94 {
103 .ctl_name = XFS_SYNCD_TIMER,
104 .procname = "xfssyncd_centisecs", 95 .procname = "xfssyncd_centisecs",
105 .data = &xfs_params.syncd_timer.val, 96 .data = &xfs_params.syncd_timer.val,
106 .maxlen = sizeof(int), 97 .maxlen = sizeof(int),
107 .mode = 0644, 98 .mode = 0644,
108 .proc_handler = &proc_dointvec_minmax, 99 .proc_handler = &proc_dointvec_minmax,
109 .strategy = &sysctl_intvec,
110 .extra1 = &xfs_params.syncd_timer.min, 100 .extra1 = &xfs_params.syncd_timer.min,
111 .extra2 = &xfs_params.syncd_timer.max 101 .extra2 = &xfs_params.syncd_timer.max
112 }, 102 },
113 { 103 {
114 .ctl_name = XFS_INHERIT_SYNC,
115 .procname = "inherit_sync", 104 .procname = "inherit_sync",
116 .data = &xfs_params.inherit_sync.val, 105 .data = &xfs_params.inherit_sync.val,
117 .maxlen = sizeof(int), 106 .maxlen = sizeof(int),
118 .mode = 0644, 107 .mode = 0644,
119 .proc_handler = &proc_dointvec_minmax, 108 .proc_handler = &proc_dointvec_minmax,
120 .strategy = &sysctl_intvec,
121 .extra1 = &xfs_params.inherit_sync.min, 109 .extra1 = &xfs_params.inherit_sync.min,
122 .extra2 = &xfs_params.inherit_sync.max 110 .extra2 = &xfs_params.inherit_sync.max
123 }, 111 },
124 { 112 {
125 .ctl_name = XFS_INHERIT_NODUMP,
126 .procname = "inherit_nodump", 113 .procname = "inherit_nodump",
127 .data = &xfs_params.inherit_nodump.val, 114 .data = &xfs_params.inherit_nodump.val,
128 .maxlen = sizeof(int), 115 .maxlen = sizeof(int),
129 .mode = 0644, 116 .mode = 0644,
130 .proc_handler = &proc_dointvec_minmax, 117 .proc_handler = &proc_dointvec_minmax,
131 .strategy = &sysctl_intvec,
132 .extra1 = &xfs_params.inherit_nodump.min, 118 .extra1 = &xfs_params.inherit_nodump.min,
133 .extra2 = &xfs_params.inherit_nodump.max 119 .extra2 = &xfs_params.inherit_nodump.max
134 }, 120 },
135 { 121 {
136 .ctl_name = XFS_INHERIT_NOATIME,
137 .procname = "inherit_noatime", 122 .procname = "inherit_noatime",
138 .data = &xfs_params.inherit_noatim.val, 123 .data = &xfs_params.inherit_noatim.val,
139 .maxlen = sizeof(int), 124 .maxlen = sizeof(int),
140 .mode = 0644, 125 .mode = 0644,
141 .proc_handler = &proc_dointvec_minmax, 126 .proc_handler = &proc_dointvec_minmax,
142 .strategy = &sysctl_intvec,
143 .extra1 = &xfs_params.inherit_noatim.min, 127 .extra1 = &xfs_params.inherit_noatim.min,
144 .extra2 = &xfs_params.inherit_noatim.max 128 .extra2 = &xfs_params.inherit_noatim.max
145 }, 129 },
146 { 130 {
147 .ctl_name = XFS_BUF_TIMER,
148 .procname = "xfsbufd_centisecs", 131 .procname = "xfsbufd_centisecs",
149 .data = &xfs_params.xfs_buf_timer.val, 132 .data = &xfs_params.xfs_buf_timer.val,
150 .maxlen = sizeof(int), 133 .maxlen = sizeof(int),
151 .mode = 0644, 134 .mode = 0644,
152 .proc_handler = &proc_dointvec_minmax, 135 .proc_handler = &proc_dointvec_minmax,
153 .strategy = &sysctl_intvec,
154 .extra1 = &xfs_params.xfs_buf_timer.min, 136 .extra1 = &xfs_params.xfs_buf_timer.min,
155 .extra2 = &xfs_params.xfs_buf_timer.max 137 .extra2 = &xfs_params.xfs_buf_timer.max
156 }, 138 },
157 { 139 {
158 .ctl_name = XFS_BUF_AGE,
159 .procname = "age_buffer_centisecs", 140 .procname = "age_buffer_centisecs",
160 .data = &xfs_params.xfs_buf_age.val, 141 .data = &xfs_params.xfs_buf_age.val,
161 .maxlen = sizeof(int), 142 .maxlen = sizeof(int),
162 .mode = 0644, 143 .mode = 0644,
163 .proc_handler = &proc_dointvec_minmax, 144 .proc_handler = &proc_dointvec_minmax,
164 .strategy = &sysctl_intvec,
165 .extra1 = &xfs_params.xfs_buf_age.min, 145 .extra1 = &xfs_params.xfs_buf_age.min,
166 .extra2 = &xfs_params.xfs_buf_age.max 146 .extra2 = &xfs_params.xfs_buf_age.max
167 }, 147 },
168 { 148 {
169 .ctl_name = XFS_INHERIT_NOSYM,
170 .procname = "inherit_nosymlinks", 149 .procname = "inherit_nosymlinks",
171 .data = &xfs_params.inherit_nosym.val, 150 .data = &xfs_params.inherit_nosym.val,
172 .maxlen = sizeof(int), 151 .maxlen = sizeof(int),
173 .mode = 0644, 152 .mode = 0644,
174 .proc_handler = &proc_dointvec_minmax, 153 .proc_handler = &proc_dointvec_minmax,
175 .strategy = &sysctl_intvec,
176 .extra1 = &xfs_params.inherit_nosym.min, 154 .extra1 = &xfs_params.inherit_nosym.min,
177 .extra2 = &xfs_params.inherit_nosym.max 155 .extra2 = &xfs_params.inherit_nosym.max
178 }, 156 },
179 { 157 {
180 .ctl_name = XFS_ROTORSTEP,
181 .procname = "rotorstep", 158 .procname = "rotorstep",
182 .data = &xfs_params.rotorstep.val, 159 .data = &xfs_params.rotorstep.val,
183 .maxlen = sizeof(int), 160 .maxlen = sizeof(int),
184 .mode = 0644, 161 .mode = 0644,
185 .proc_handler = &proc_dointvec_minmax, 162 .proc_handler = &proc_dointvec_minmax,
186 .strategy = &sysctl_intvec,
187 .extra1 = &xfs_params.rotorstep.min, 163 .extra1 = &xfs_params.rotorstep.min,
188 .extra2 = &xfs_params.rotorstep.max 164 .extra2 = &xfs_params.rotorstep.max
189 }, 165 },
190 { 166 {
191 .ctl_name = XFS_INHERIT_NODFRG,
192 .procname = "inherit_nodefrag", 167 .procname = "inherit_nodefrag",
193 .data = &xfs_params.inherit_nodfrg.val, 168 .data = &xfs_params.inherit_nodfrg.val,
194 .maxlen = sizeof(int), 169 .maxlen = sizeof(int),
195 .mode = 0644, 170 .mode = 0644,
196 .proc_handler = &proc_dointvec_minmax, 171 .proc_handler = &proc_dointvec_minmax,
197 .strategy = &sysctl_intvec,
198 .extra1 = &xfs_params.inherit_nodfrg.min, 172 .extra1 = &xfs_params.inherit_nodfrg.min,
199 .extra2 = &xfs_params.inherit_nodfrg.max 173 .extra2 = &xfs_params.inherit_nodfrg.max
200 }, 174 },
201 { 175 {
202 .ctl_name = XFS_FILESTREAM_TIMER,
203 .procname = "filestream_centisecs", 176 .procname = "filestream_centisecs",
204 .data = &xfs_params.fstrm_timer.val, 177 .data = &xfs_params.fstrm_timer.val,
205 .maxlen = sizeof(int), 178 .maxlen = sizeof(int),
206 .mode = 0644, 179 .mode = 0644,
207 .proc_handler = &proc_dointvec_minmax, 180 .proc_handler = &proc_dointvec_minmax,
208 .strategy = &sysctl_intvec,
209 .extra1 = &xfs_params.fstrm_timer.min, 181 .extra1 = &xfs_params.fstrm_timer.min,
210 .extra2 = &xfs_params.fstrm_timer.max, 182 .extra2 = &xfs_params.fstrm_timer.max,
211 }, 183 },
212 /* please keep this the last entry */ 184 /* please keep this the last entry */
213#ifdef CONFIG_PROC_FS 185#ifdef CONFIG_PROC_FS
214 { 186 {
215 .ctl_name = XFS_STATS_CLEAR,
216 .procname = "stats_clear", 187 .procname = "stats_clear",
217 .data = &xfs_params.stats_clear.val, 188 .data = &xfs_params.stats_clear.val,
218 .maxlen = sizeof(int), 189 .maxlen = sizeof(int),
219 .mode = 0644, 190 .mode = 0644,
220 .proc_handler = &xfs_stats_clear_proc_handler, 191 .proc_handler = &xfs_stats_clear_proc_handler,
221 .strategy = &sysctl_intvec,
222 .extra1 = &xfs_params.stats_clear.min, 192 .extra1 = &xfs_params.stats_clear.min,
223 .extra2 = &xfs_params.stats_clear.max 193 .extra2 = &xfs_params.stats_clear.max
224 }, 194 },
@@ -229,7 +199,6 @@ static ctl_table xfs_table[] = {
229 199
230static ctl_table xfs_dir_table[] = { 200static ctl_table xfs_dir_table[] = {
231 { 201 {
232 .ctl_name = FS_XFS,
233 .procname = "xfs", 202 .procname = "xfs",
234 .mode = 0555, 203 .mode = 0555,
235 .child = xfs_table 204 .child = xfs_table
@@ -239,7 +208,6 @@ static ctl_table xfs_dir_table[] = {
239 208
240static ctl_table xfs_root_table[] = { 209static ctl_table xfs_root_table[] = {
241 { 210 {
242 .ctl_name = CTL_FS,
243 .procname = "fs", 211 .procname = "fs",
244 .mode = 0555, 212 .mode = 0555,
245 .child = xfs_dir_table 213 .child = xfs_dir_table
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 1e4743ee6831..4e40442777cf 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -996,10 +996,6 @@ extern int proc_doulongvec_minmax(struct ctl_table *, int,
996extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int, 996extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int,
997 void __user *, size_t *, loff_t *); 997 void __user *, size_t *, loff_t *);
998 998
999extern int do_sysctl (int __user *name, int nlen,
1000 void __user *oldval, size_t __user *oldlenp,
1001 void __user *newval, size_t newlen);
1002
1003extern ctl_handler sysctl_data; 999extern ctl_handler sysctl_data;
1004extern ctl_handler sysctl_string; 1000extern ctl_handler sysctl_string;
1005extern ctl_handler sysctl_intvec; 1001extern ctl_handler sysctl_intvec;
@@ -1009,8 +1005,8 @@ extern ctl_handler sysctl_ms_jiffies;
1009 1005
1010/* 1006/*
1011 * Register a set of sysctl names by calling register_sysctl_table 1007 * Register a set of sysctl names by calling register_sysctl_table
1012 * with an initialised array of struct ctl_table's. An entry with zero 1008 * with an initialised array of struct ctl_table's. An entry with
1013 * ctl_name and NULL procname terminates the table. table->de will be 1009 * NULL procname terminates the table. table->de will be
1014 * set up by the registration and need not be initialised in advance. 1010 * set up by the registration and need not be initialised in advance.
1015 * 1011 *
1016 * sysctl names can be mirrored automatically under /proc/sys. The 1012 * sysctl names can be mirrored automatically under /proc/sys. The
@@ -1023,24 +1019,11 @@ extern ctl_handler sysctl_ms_jiffies;
1023 * under /proc; non-leaf nodes will be represented by directories. A 1019 * under /proc; non-leaf nodes will be represented by directories. A
1024 * null procname disables /proc mirroring at this node. 1020 * null procname disables /proc mirroring at this node.
1025 * 1021 *
1026 * sysctl entries with a zero ctl_name will not be available through
1027 * the binary sysctl interface.
1028 *
1029 * sysctl(2) can automatically manage read and write requests through 1022 * sysctl(2) can automatically manage read and write requests through
1030 * the sysctl table. The data and maxlen fields of the ctl_table 1023 * the sysctl table. The data and maxlen fields of the ctl_table
1031 * struct enable minimal validation of the values being written to be 1024 * struct enable minimal validation of the values being written to be
1032 * performed, and the mode field allows minimal authentication. 1025 * performed, and the mode field allows minimal authentication.
1033 * 1026 *
1034 * More sophisticated management can be enabled by the provision of a
1035 * strategy routine with the table entry. This will be called before
1036 * any automatic read or write of the data is performed.
1037 *
1038 * The strategy routine may return:
1039 * <0: Error occurred (error is passed to user process)
1040 * 0: OK - proceed with automatic read or write.
1041 * >0: OK - read or write has been done by the strategy routine, so
1042 * return immediately.
1043 *
1044 * There must be a proc_handler routine for any terminal nodes 1027 * There must be a proc_handler routine for any terminal nodes
1045 * mirrored under /proc/sys (non-terminals are handled by a built-in 1028 * mirrored under /proc/sys (non-terminals are handled by a built-in
1046 * directory handler). Several default handlers are available to 1029 * directory handler). Several default handlers are available to
@@ -1050,7 +1033,6 @@ extern ctl_handler sysctl_ms_jiffies;
1050/* A sysctl table is an array of struct ctl_table: */ 1033/* A sysctl table is an array of struct ctl_table: */
1051struct ctl_table 1034struct ctl_table
1052{ 1035{
1053 int ctl_name; /* Binary ID */
1054 const char *procname; /* Text ID for /proc/sys, or zero */ 1036 const char *procname; /* Text ID for /proc/sys, or zero */
1055 void *data; 1037 void *data;
1056 int maxlen; 1038 int maxlen;
@@ -1058,7 +1040,6 @@ struct ctl_table
1058 struct ctl_table *child; 1040 struct ctl_table *child;
1059 struct ctl_table *parent; /* Automatically set */ 1041 struct ctl_table *parent; /* Automatically set */
1060 proc_handler *proc_handler; /* Callback for text formatting */ 1042 proc_handler *proc_handler; /* Callback for text formatting */
1061 ctl_handler *strategy; /* Callback function for all r/w */
1062 void *extra1; 1043 void *extra1;
1063 void *extra2; 1044 void *extra2;
1064}; 1045};
@@ -1092,7 +1073,6 @@ struct ctl_table_header
1092/* struct ctl_path describes where in the hierarchy a table is added */ 1073/* struct ctl_path describes where in the hierarchy a table is added */
1093struct ctl_path { 1074struct ctl_path {
1094 const char *procname; 1075 const char *procname;
1095 int ctl_name;
1096}; 1076};
1097 1077
1098void register_sysctl_root(struct ctl_table_root *root); 1078void register_sysctl_root(struct ctl_table_root *root);
diff --git a/include/net/dn_dev.h b/include/net/dn_dev.h
index cee46821dc53..3f781a4cafbe 100644
--- a/include/net/dn_dev.h
+++ b/include/net/dn_dev.h
@@ -75,7 +75,6 @@ struct dn_dev_parms {
75 unsigned long t3; /* Default value of t3 */ 75 unsigned long t3; /* Default value of t3 */
76 int priority; /* Priority to be a router */ 76 int priority; /* Priority to be a router */
77 char *name; /* Name for sysctl */ 77 char *name; /* Name for sysctl */
78 int ctl_name; /* Index for sysctl */
79 int (*up)(struct net_device *); 78 int (*up)(struct net_device *);
80 void (*down)(struct net_device *); 79 void (*down)(struct net_device *);
81 void (*timer3)(struct net_device *, struct dn_ifaddr *ifa); 80 void (*timer3)(struct net_device *, struct dn_ifaddr *ifa);
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 3817fda82a80..da99fdd63cf5 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -264,8 +264,7 @@ extern int neigh_sysctl_register(struct net_device *dev,
264 struct neigh_parms *p, 264 struct neigh_parms *p,
265 int p_id, int pdev_id, 265 int p_id, int pdev_id,
266 char *p_name, 266 char *p_name,
267 proc_handler *proc_handler, 267 proc_handler *proc_handler);
268 ctl_handler *strategy);
269extern void neigh_sysctl_unregister(struct neigh_parms *p); 268extern void neigh_sysctl_unregister(struct neigh_parms *p);
270 269
271static inline void __neigh_parms_put(struct neigh_parms *parms) 270static inline void __neigh_parms_put(struct neigh_parms *parms)
diff --git a/init/Kconfig b/init/Kconfig
index 9e03ef8b311e..e50c63fb8839 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -754,6 +754,7 @@ config UID16
754 754
755config SYSCTL_SYSCALL 755config SYSCTL_SYSCALL
756 bool "Sysctl syscall support" if EMBEDDED 756 bool "Sysctl syscall support" if EMBEDDED
757 depends on PROC_SYSCTL
757 default y 758 default y
758 select SYSCTL 759 select SYSCTL
759 ---help--- 760 ---help---
diff --git a/ipc/ipc_sysctl.c b/ipc/ipc_sysctl.c
index 7d3704750efc..56410faa4550 100644
--- a/ipc/ipc_sysctl.c
+++ b/ipc/ipc_sysctl.c
@@ -129,136 +129,60 @@ static int proc_ipcauto_dointvec_minmax(ctl_table *table, int write,
129#define proc_ipcauto_dointvec_minmax NULL 129#define proc_ipcauto_dointvec_minmax NULL
130#endif 130#endif
131 131
132#ifdef CONFIG_SYSCTL_SYSCALL
133/* The generic sysctl ipc data routine. */
134static int sysctl_ipc_data(ctl_table *table,
135 void __user *oldval, size_t __user *oldlenp,
136 void __user *newval, size_t newlen)
137{
138 size_t len;
139 void *data;
140
141 /* Get out of I don't have a variable */
142 if (!table->data || !table->maxlen)
143 return -ENOTDIR;
144
145 data = get_ipc(table);
146 if (!data)
147 return -ENOTDIR;
148
149 if (oldval && oldlenp) {
150 if (get_user(len, oldlenp))
151 return -EFAULT;
152 if (len) {
153 if (len > table->maxlen)
154 len = table->maxlen;
155 if (copy_to_user(oldval, data, len))
156 return -EFAULT;
157 if (put_user(len, oldlenp))
158 return -EFAULT;
159 }
160 }
161
162 if (newval && newlen) {
163 if (newlen > table->maxlen)
164 newlen = table->maxlen;
165
166 if (copy_from_user(data, newval, newlen))
167 return -EFAULT;
168 }
169 return 1;
170}
171
172static int sysctl_ipc_registered_data(ctl_table *table,
173 void __user *oldval, size_t __user *oldlenp,
174 void __user *newval, size_t newlen)
175{
176 int rc;
177
178 rc = sysctl_ipc_data(table, oldval, oldlenp, newval, newlen);
179
180 if (newval && newlen && rc > 0)
181 /*
182 * Tunable has successfully been changed from userland
183 */
184 unregister_ipcns_notifier(current->nsproxy->ipc_ns);
185
186 return rc;
187}
188#else
189#define sysctl_ipc_data NULL
190#define sysctl_ipc_registered_data NULL
191#endif
192
193static int zero; 132static int zero;
194static int one = 1; 133static int one = 1;
195 134
196static struct ctl_table ipc_kern_table[] = { 135static struct ctl_table ipc_kern_table[] = {
197 { 136 {
198 .ctl_name = KERN_SHMMAX,
199 .procname = "shmmax", 137 .procname = "shmmax",
200 .data = &init_ipc_ns.shm_ctlmax, 138 .data = &init_ipc_ns.shm_ctlmax,
201 .maxlen = sizeof (init_ipc_ns.shm_ctlmax), 139 .maxlen = sizeof (init_ipc_ns.shm_ctlmax),
202 .mode = 0644, 140 .mode = 0644,
203 .proc_handler = proc_ipc_doulongvec_minmax, 141 .proc_handler = proc_ipc_doulongvec_minmax,
204 .strategy = sysctl_ipc_data,
205 }, 142 },
206 { 143 {
207 .ctl_name = KERN_SHMALL,
208 .procname = "shmall", 144 .procname = "shmall",
209 .data = &init_ipc_ns.shm_ctlall, 145 .data = &init_ipc_ns.shm_ctlall,
210 .maxlen = sizeof (init_ipc_ns.shm_ctlall), 146 .maxlen = sizeof (init_ipc_ns.shm_ctlall),
211 .mode = 0644, 147 .mode = 0644,
212 .proc_handler = proc_ipc_doulongvec_minmax, 148 .proc_handler = proc_ipc_doulongvec_minmax,
213 .strategy = sysctl_ipc_data,
214 }, 149 },
215 { 150 {
216 .ctl_name = KERN_SHMMNI,
217 .procname = "shmmni", 151 .procname = "shmmni",
218 .data = &init_ipc_ns.shm_ctlmni, 152 .data = &init_ipc_ns.shm_ctlmni,
219 .maxlen = sizeof (init_ipc_ns.shm_ctlmni), 153 .maxlen = sizeof (init_ipc_ns.shm_ctlmni),
220 .mode = 0644, 154 .mode = 0644,
221 .proc_handler = proc_ipc_dointvec, 155 .proc_handler = proc_ipc_dointvec,
222 .strategy = sysctl_ipc_data,
223 }, 156 },
224 { 157 {
225 .ctl_name = KERN_MSGMAX,
226 .procname = "msgmax", 158 .procname = "msgmax",
227 .data = &init_ipc_ns.msg_ctlmax, 159 .data = &init_ipc_ns.msg_ctlmax,
228 .maxlen = sizeof (init_ipc_ns.msg_ctlmax), 160 .maxlen = sizeof (init_ipc_ns.msg_ctlmax),
229 .mode = 0644, 161 .mode = 0644,
230 .proc_handler = proc_ipc_dointvec, 162 .proc_handler = proc_ipc_dointvec,
231 .strategy = sysctl_ipc_data,
232 }, 163 },
233 { 164 {
234 .ctl_name = KERN_MSGMNI,
235 .procname = "msgmni", 165 .procname = "msgmni",
236 .data = &init_ipc_ns.msg_ctlmni, 166 .data = &init_ipc_ns.msg_ctlmni,
237 .maxlen = sizeof (init_ipc_ns.msg_ctlmni), 167 .maxlen = sizeof (init_ipc_ns.msg_ctlmni),
238 .mode = 0644, 168 .mode = 0644,
239 .proc_handler = proc_ipc_callback_dointvec, 169 .proc_handler = proc_ipc_callback_dointvec,
240 .strategy = sysctl_ipc_registered_data,
241 }, 170 },
242 { 171 {
243 .ctl_name = KERN_MSGMNB,
244 .procname = "msgmnb", 172 .procname = "msgmnb",
245 .data = &init_ipc_ns.msg_ctlmnb, 173 .data = &init_ipc_ns.msg_ctlmnb,
246 .maxlen = sizeof (init_ipc_ns.msg_ctlmnb), 174 .maxlen = sizeof (init_ipc_ns.msg_ctlmnb),
247 .mode = 0644, 175 .mode = 0644,
248 .proc_handler = proc_ipc_dointvec, 176 .proc_handler = proc_ipc_dointvec,
249 .strategy = sysctl_ipc_data,
250 }, 177 },
251 { 178 {
252 .ctl_name = KERN_SEM,
253 .procname = "sem", 179 .procname = "sem",
254 .data = &init_ipc_ns.sem_ctls, 180 .data = &init_ipc_ns.sem_ctls,
255 .maxlen = 4*sizeof (int), 181 .maxlen = 4*sizeof (int),
256 .mode = 0644, 182 .mode = 0644,
257 .proc_handler = proc_ipc_dointvec, 183 .proc_handler = proc_ipc_dointvec,
258 .strategy = sysctl_ipc_data,
259 }, 184 },
260 { 185 {
261 .ctl_name = CTL_UNNUMBERED,
262 .procname = "auto_msgmni", 186 .procname = "auto_msgmni",
263 .data = &init_ipc_ns.auto_msgmni, 187 .data = &init_ipc_ns.auto_msgmni,
264 .maxlen = sizeof(int), 188 .maxlen = sizeof(int),
@@ -272,7 +196,6 @@ static struct ctl_table ipc_kern_table[] = {
272 196
273static struct ctl_table ipc_root_table[] = { 197static struct ctl_table ipc_root_table[] = {
274 { 198 {
275 .ctl_name = CTL_KERN,
276 .procname = "kernel", 199 .procname = "kernel",
277 .mode = 0555, 200 .mode = 0555,
278 .child = ipc_kern_table, 201 .child = ipc_kern_table,
diff --git a/ipc/mq_sysctl.c b/ipc/mq_sysctl.c
index 8a058711fc10..0c09366b96f3 100644
--- a/ipc/mq_sysctl.c
+++ b/ipc/mq_sysctl.c
@@ -88,7 +88,7 @@ static ctl_table mq_sysctls[] = {
88 .extra1 = &msg_maxsize_limit_min, 88 .extra1 = &msg_maxsize_limit_min,
89 .extra2 = &msg_maxsize_limit_max, 89 .extra2 = &msg_maxsize_limit_max,
90 }, 90 },
91 { .ctl_name = 0 } 91 {}
92}; 92};
93 93
94static ctl_table mq_sysctl_dir[] = { 94static ctl_table mq_sysctl_dir[] = {
@@ -97,17 +97,16 @@ static ctl_table mq_sysctl_dir[] = {
97 .mode = 0555, 97 .mode = 0555,
98 .child = mq_sysctls, 98 .child = mq_sysctls,
99 }, 99 },
100 { .ctl_name = 0 } 100 {}
101}; 101};
102 102
103static ctl_table mq_sysctl_root[] = { 103static ctl_table mq_sysctl_root[] = {
104 { 104 {
105 .ctl_name = CTL_FS,
106 .procname = "fs", 105 .procname = "fs",
107 .mode = 0555, 106 .mode = 0555,
108 .child = mq_sysctl_dir, 107 .child = mq_sysctl_dir,
109 }, 108 },
110 { .ctl_name = 0 } 109 {}
111}; 110};
112 111
113struct ctl_table_header *mq_register_sysctl_table(void) 112struct ctl_table_header *mq_register_sysctl_table(void)
diff --git a/kernel/Makefile b/kernel/Makefile
index b8d4cd8ac0b9..986a5c197346 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -4,7 +4,7 @@
4 4
5obj-y = sched.o fork.o exec_domain.o panic.o printk.o \ 5obj-y = sched.o fork.o exec_domain.o panic.o printk.o \
6 cpu.o exit.o itimer.o time.o softirq.o resource.o \ 6 cpu.o exit.o itimer.o time.o softirq.o resource.o \
7 sysctl.o capability.o ptrace.o timer.o user.o \ 7 sysctl.o sysctl_binary.o capability.o ptrace.o timer.o user.o \
8 signal.o sys.o kmod.o workqueue.o pid.o \ 8 signal.o sys.o kmod.o workqueue.o pid.o \
9 rcupdate.o extable.o params.o posix-timers.o \ 9 rcupdate.o extable.o params.o posix-timers.o \
10 kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \ 10 kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \
diff --git a/kernel/sched.c b/kernel/sched.c
index 3c11ae0a948d..b60ba7475574 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -7406,17 +7406,16 @@ static struct ctl_table sd_ctl_dir[] = {
7406 .procname = "sched_domain", 7406 .procname = "sched_domain",
7407 .mode = 0555, 7407 .mode = 0555,
7408 }, 7408 },
7409 {0, }, 7409 {}
7410}; 7410};
7411 7411
7412static struct ctl_table sd_ctl_root[] = { 7412static struct ctl_table sd_ctl_root[] = {
7413 { 7413 {
7414 .ctl_name = CTL_KERN,
7415 .procname = "kernel", 7414 .procname = "kernel",
7416 .mode = 0555, 7415 .mode = 0555,
7417 .child = sd_ctl_dir, 7416 .child = sd_ctl_dir,
7418 }, 7417 },
7419 {0, }, 7418 {}
7420}; 7419};
7421 7420
7422static struct ctl_table *sd_alloc_ctl_entry(int n) 7421static struct ctl_table *sd_alloc_ctl_entry(int n)
diff --git a/kernel/slow-work.c b/kernel/slow-work.c
index 0d31135efbf4..0134b15b38d8 100644
--- a/kernel/slow-work.c
+++ b/kernel/slow-work.c
@@ -52,7 +52,6 @@ static const int slow_work_max_vslow = 99;
52 52
53ctl_table slow_work_sysctls[] = { 53ctl_table slow_work_sysctls[] = {
54 { 54 {
55 .ctl_name = CTL_UNNUMBERED,
56 .procname = "min-threads", 55 .procname = "min-threads",
57 .data = &slow_work_min_threads, 56 .data = &slow_work_min_threads,
58 .maxlen = sizeof(unsigned), 57 .maxlen = sizeof(unsigned),
@@ -62,7 +61,6 @@ ctl_table slow_work_sysctls[] = {
62 .extra2 = &slow_work_max_threads, 61 .extra2 = &slow_work_max_threads,
63 }, 62 },
64 { 63 {
65 .ctl_name = CTL_UNNUMBERED,
66 .procname = "max-threads", 64 .procname = "max-threads",
67 .data = &slow_work_max_threads, 65 .data = &slow_work_max_threads,
68 .maxlen = sizeof(unsigned), 66 .maxlen = sizeof(unsigned),
@@ -72,7 +70,6 @@ ctl_table slow_work_sysctls[] = {
72 .extra2 = (void *) &slow_work_max_max_threads, 70 .extra2 = (void *) &slow_work_max_max_threads,
73 }, 71 },
74 { 72 {
75 .ctl_name = CTL_UNNUMBERED,
76 .procname = "vslow-percentage", 73 .procname = "vslow-percentage",
77 .data = &vslow_work_proportion, 74 .data = &vslow_work_proportion,
78 .maxlen = sizeof(unsigned), 75 .maxlen = sizeof(unsigned),
@@ -81,7 +78,7 @@ ctl_table slow_work_sysctls[] = {
81 .extra1 = (void *) &slow_work_min_vslow, 78 .extra1 = (void *) &slow_work_min_vslow,
82 .extra2 = (void *) &slow_work_max_vslow, 79 .extra2 = (void *) &slow_work_max_vslow,
83 }, 80 },
84 { .ctl_name = 0 } 81 {}
85}; 82};
86#endif 83#endif
87 84
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c
index e06d0b8d1951..de5bf1448238 100644
--- a/kernel/sys_ni.c
+++ b/kernel/sys_ni.c
@@ -139,7 +139,6 @@ cond_syscall(sys_pciconfig_read);
139cond_syscall(sys_pciconfig_write); 139cond_syscall(sys_pciconfig_write);
140cond_syscall(sys_pciconfig_iobase); 140cond_syscall(sys_pciconfig_iobase);
141cond_syscall(sys32_ipc); 141cond_syscall(sys32_ipc);
142cond_syscall(sys32_sysctl);
143cond_syscall(ppc_rtas); 142cond_syscall(ppc_rtas);
144cond_syscall(sys_spu_run); 143cond_syscall(sys_spu_run);
145cond_syscall(sys_spu_create); 144cond_syscall(sys_spu_create);
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 0d949c517412..b4a5763d6dc8 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -27,7 +27,6 @@
27#include <linux/security.h> 27#include <linux/security.h>
28#include <linux/ctype.h> 28#include <linux/ctype.h>
29#include <linux/kmemcheck.h> 29#include <linux/kmemcheck.h>
30#include <linux/smp_lock.h>
31#include <linux/fs.h> 30#include <linux/fs.h>
32#include <linux/init.h> 31#include <linux/init.h>
33#include <linux/kernel.h> 32#include <linux/kernel.h>
@@ -60,7 +59,6 @@
60#include <asm/io.h> 59#include <asm/io.h>
61#endif 60#endif
62 61
63static int deprecated_sysctl_warning(struct __sysctl_args *args);
64 62
65#if defined(CONFIG_SYSCTL) 63#if defined(CONFIG_SYSCTL)
66 64
@@ -207,31 +205,26 @@ extern int lock_stat;
207 205
208static struct ctl_table root_table[] = { 206static struct ctl_table root_table[] = {
209 { 207 {
210 .ctl_name = CTL_KERN,
211 .procname = "kernel", 208 .procname = "kernel",
212 .mode = 0555, 209 .mode = 0555,
213 .child = kern_table, 210 .child = kern_table,
214 }, 211 },
215 { 212 {
216 .ctl_name = CTL_VM,
217 .procname = "vm", 213 .procname = "vm",
218 .mode = 0555, 214 .mode = 0555,
219 .child = vm_table, 215 .child = vm_table,
220 }, 216 },
221 { 217 {
222 .ctl_name = CTL_FS,
223 .procname = "fs", 218 .procname = "fs",
224 .mode = 0555, 219 .mode = 0555,
225 .child = fs_table, 220 .child = fs_table,
226 }, 221 },
227 { 222 {
228 .ctl_name = CTL_DEBUG,
229 .procname = "debug", 223 .procname = "debug",
230 .mode = 0555, 224 .mode = 0555,
231 .child = debug_table, 225 .child = debug_table,
232 }, 226 },
233 { 227 {
234 .ctl_name = CTL_DEV,
235 .procname = "dev", 228 .procname = "dev",
236 .mode = 0555, 229 .mode = 0555,
237 .child = dev_table, 230 .child = dev_table,
@@ -240,7 +233,7 @@ static struct ctl_table root_table[] = {
240 * NOTE: do not add new entries to this table unless you have read 233 * NOTE: do not add new entries to this table unless you have read
241 * Documentation/sysctl/ctl_unnumbered.txt 234 * Documentation/sysctl/ctl_unnumbered.txt
242 */ 235 */
243 { .ctl_name = 0 } 236 { }
244}; 237};
245 238
246#ifdef CONFIG_SCHED_DEBUG 239#ifdef CONFIG_SCHED_DEBUG
@@ -252,7 +245,6 @@ static int max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */
252 245
253static struct ctl_table kern_table[] = { 246static struct ctl_table kern_table[] = {
254 { 247 {
255 .ctl_name = CTL_UNNUMBERED,
256 .procname = "sched_child_runs_first", 248 .procname = "sched_child_runs_first",
257 .data = &sysctl_sched_child_runs_first, 249 .data = &sysctl_sched_child_runs_first,
258 .maxlen = sizeof(unsigned int), 250 .maxlen = sizeof(unsigned int),
@@ -261,40 +253,33 @@ static struct ctl_table kern_table[] = {
261 }, 253 },
262#ifdef CONFIG_SCHED_DEBUG 254#ifdef CONFIG_SCHED_DEBUG
263 { 255 {
264 .ctl_name = CTL_UNNUMBERED,
265 .procname = "sched_min_granularity_ns", 256 .procname = "sched_min_granularity_ns",
266 .data = &sysctl_sched_min_granularity, 257 .data = &sysctl_sched_min_granularity,
267 .maxlen = sizeof(unsigned int), 258 .maxlen = sizeof(unsigned int),
268 .mode = 0644, 259 .mode = 0644,
269 .proc_handler = &sched_nr_latency_handler, 260 .proc_handler = &sched_nr_latency_handler,
270 .strategy = &sysctl_intvec,
271 .extra1 = &min_sched_granularity_ns, 261 .extra1 = &min_sched_granularity_ns,
272 .extra2 = &max_sched_granularity_ns, 262 .extra2 = &max_sched_granularity_ns,
273 }, 263 },
274 { 264 {
275 .ctl_name = CTL_UNNUMBERED,
276 .procname = "sched_latency_ns", 265 .procname = "sched_latency_ns",
277 .data = &sysctl_sched_latency, 266 .data = &sysctl_sched_latency,
278 .maxlen = sizeof(unsigned int), 267 .maxlen = sizeof(unsigned int),
279 .mode = 0644, 268 .mode = 0644,
280 .proc_handler = &sched_nr_latency_handler, 269 .proc_handler = &sched_nr_latency_handler,
281 .strategy = &sysctl_intvec,
282 .extra1 = &min_sched_granularity_ns, 270 .extra1 = &min_sched_granularity_ns,
283 .extra2 = &max_sched_granularity_ns, 271 .extra2 = &max_sched_granularity_ns,
284 }, 272 },
285 { 273 {
286 .ctl_name = CTL_UNNUMBERED,
287 .procname = "sched_wakeup_granularity_ns", 274 .procname = "sched_wakeup_granularity_ns",
288 .data = &sysctl_sched_wakeup_granularity, 275 .data = &sysctl_sched_wakeup_granularity,
289 .maxlen = sizeof(unsigned int), 276 .maxlen = sizeof(unsigned int),
290 .mode = 0644, 277 .mode = 0644,
291 .proc_handler = &proc_dointvec_minmax, 278 .proc_handler = &proc_dointvec_minmax,
292 .strategy = &sysctl_intvec,
293 .extra1 = &min_wakeup_granularity_ns, 279 .extra1 = &min_wakeup_granularity_ns,
294 .extra2 = &max_wakeup_granularity_ns, 280 .extra2 = &max_wakeup_granularity_ns,
295 }, 281 },
296 { 282 {
297 .ctl_name = CTL_UNNUMBERED,
298 .procname = "sched_shares_ratelimit", 283 .procname = "sched_shares_ratelimit",
299 .data = &sysctl_sched_shares_ratelimit, 284 .data = &sysctl_sched_shares_ratelimit,
300 .maxlen = sizeof(unsigned int), 285 .maxlen = sizeof(unsigned int),
@@ -302,17 +287,14 @@ static struct ctl_table kern_table[] = {
302 .proc_handler = &proc_dointvec, 287 .proc_handler = &proc_dointvec,
303 }, 288 },
304 { 289 {
305 .ctl_name = CTL_UNNUMBERED,
306 .procname = "sched_shares_thresh", 290 .procname = "sched_shares_thresh",
307 .data = &sysctl_sched_shares_thresh, 291 .data = &sysctl_sched_shares_thresh,
308 .maxlen = sizeof(unsigned int), 292 .maxlen = sizeof(unsigned int),
309 .mode = 0644, 293 .mode = 0644,
310 .proc_handler = &proc_dointvec_minmax, 294 .proc_handler = &proc_dointvec_minmax,
311 .strategy = &sysctl_intvec,
312 .extra1 = &zero, 295 .extra1 = &zero,
313 }, 296 },
314 { 297 {
315 .ctl_name = CTL_UNNUMBERED,
316 .procname = "sched_features", 298 .procname = "sched_features",
317 .data = &sysctl_sched_features, 299 .data = &sysctl_sched_features,
318 .maxlen = sizeof(unsigned int), 300 .maxlen = sizeof(unsigned int),
@@ -320,7 +302,6 @@ static struct ctl_table kern_table[] = {
320 .proc_handler = &proc_dointvec, 302 .proc_handler = &proc_dointvec,
321 }, 303 },
322 { 304 {
323 .ctl_name = CTL_UNNUMBERED,
324 .procname = "sched_migration_cost", 305 .procname = "sched_migration_cost",
325 .data = &sysctl_sched_migration_cost, 306 .data = &sysctl_sched_migration_cost,
326 .maxlen = sizeof(unsigned int), 307 .maxlen = sizeof(unsigned int),
@@ -328,7 +309,6 @@ static struct ctl_table kern_table[] = {
328 .proc_handler = &proc_dointvec, 309 .proc_handler = &proc_dointvec,
329 }, 310 },
330 { 311 {
331 .ctl_name = CTL_UNNUMBERED,
332 .procname = "sched_nr_migrate", 312 .procname = "sched_nr_migrate",
333 .data = &sysctl_sched_nr_migrate, 313 .data = &sysctl_sched_nr_migrate,
334 .maxlen = sizeof(unsigned int), 314 .maxlen = sizeof(unsigned int),
@@ -336,7 +316,6 @@ static struct ctl_table kern_table[] = {
336 .proc_handler = &proc_dointvec, 316 .proc_handler = &proc_dointvec,
337 }, 317 },
338 { 318 {
339 .ctl_name = CTL_UNNUMBERED,
340 .procname = "sched_time_avg", 319 .procname = "sched_time_avg",
341 .data = &sysctl_sched_time_avg, 320 .data = &sysctl_sched_time_avg,
342 .maxlen = sizeof(unsigned int), 321 .maxlen = sizeof(unsigned int),
@@ -344,19 +323,16 @@ static struct ctl_table kern_table[] = {
344 .proc_handler = &proc_dointvec, 323 .proc_handler = &proc_dointvec,
345 }, 324 },
346 { 325 {
347 .ctl_name = CTL_UNNUMBERED,
348 .procname = "timer_migration", 326 .procname = "timer_migration",
349 .data = &sysctl_timer_migration, 327 .data = &sysctl_timer_migration,
350 .maxlen = sizeof(unsigned int), 328 .maxlen = sizeof(unsigned int),
351 .mode = 0644, 329 .mode = 0644,
352 .proc_handler = &proc_dointvec_minmax, 330 .proc_handler = &proc_dointvec_minmax,
353 .strategy = &sysctl_intvec,
354 .extra1 = &zero, 331 .extra1 = &zero,
355 .extra2 = &one, 332 .extra2 = &one,
356 }, 333 },
357#endif 334#endif
358 { 335 {
359 .ctl_name = CTL_UNNUMBERED,
360 .procname = "sched_rt_period_us", 336 .procname = "sched_rt_period_us",
361 .data = &sysctl_sched_rt_period, 337 .data = &sysctl_sched_rt_period,
362 .maxlen = sizeof(unsigned int), 338 .maxlen = sizeof(unsigned int),
@@ -364,7 +340,6 @@ static struct ctl_table kern_table[] = {
364 .proc_handler = &sched_rt_handler, 340 .proc_handler = &sched_rt_handler,
365 }, 341 },
366 { 342 {
367 .ctl_name = CTL_UNNUMBERED,
368 .procname = "sched_rt_runtime_us", 343 .procname = "sched_rt_runtime_us",
369 .data = &sysctl_sched_rt_runtime, 344 .data = &sysctl_sched_rt_runtime,
370 .maxlen = sizeof(int), 345 .maxlen = sizeof(int),
@@ -372,7 +347,6 @@ static struct ctl_table kern_table[] = {
372 .proc_handler = &sched_rt_handler, 347 .proc_handler = &sched_rt_handler,
373 }, 348 },
374 { 349 {
375 .ctl_name = CTL_UNNUMBERED,
376 .procname = "sched_compat_yield", 350 .procname = "sched_compat_yield",
377 .data = &sysctl_sched_compat_yield, 351 .data = &sysctl_sched_compat_yield,
378 .maxlen = sizeof(unsigned int), 352 .maxlen = sizeof(unsigned int),
@@ -381,7 +355,6 @@ static struct ctl_table kern_table[] = {
381 }, 355 },
382#ifdef CONFIG_PROVE_LOCKING 356#ifdef CONFIG_PROVE_LOCKING
383 { 357 {
384 .ctl_name = CTL_UNNUMBERED,
385 .procname = "prove_locking", 358 .procname = "prove_locking",
386 .data = &prove_locking, 359 .data = &prove_locking,
387 .maxlen = sizeof(int), 360 .maxlen = sizeof(int),
@@ -391,7 +364,6 @@ static struct ctl_table kern_table[] = {
391#endif 364#endif
392#ifdef CONFIG_LOCK_STAT 365#ifdef CONFIG_LOCK_STAT
393 { 366 {
394 .ctl_name = CTL_UNNUMBERED,
395 .procname = "lock_stat", 367 .procname = "lock_stat",
396 .data = &lock_stat, 368 .data = &lock_stat,
397 .maxlen = sizeof(int), 369 .maxlen = sizeof(int),
@@ -400,7 +372,6 @@ static struct ctl_table kern_table[] = {
400 }, 372 },
401#endif 373#endif
402 { 374 {
403 .ctl_name = KERN_PANIC,
404 .procname = "panic", 375 .procname = "panic",
405 .data = &panic_timeout, 376 .data = &panic_timeout,
406 .maxlen = sizeof(int), 377 .maxlen = sizeof(int),
@@ -408,7 +379,6 @@ static struct ctl_table kern_table[] = {
408 .proc_handler = &proc_dointvec, 379 .proc_handler = &proc_dointvec,
409 }, 380 },
410 { 381 {
411 .ctl_name = KERN_CORE_USES_PID,
412 .procname = "core_uses_pid", 382 .procname = "core_uses_pid",
413 .data = &core_uses_pid, 383 .data = &core_uses_pid,
414 .maxlen = sizeof(int), 384 .maxlen = sizeof(int),
@@ -416,16 +386,13 @@ static struct ctl_table kern_table[] = {
416 .proc_handler = &proc_dointvec, 386 .proc_handler = &proc_dointvec,
417 }, 387 },
418 { 388 {
419 .ctl_name = KERN_CORE_PATTERN,
420 .procname = "core_pattern", 389 .procname = "core_pattern",
421 .data = core_pattern, 390 .data = core_pattern,
422 .maxlen = CORENAME_MAX_SIZE, 391 .maxlen = CORENAME_MAX_SIZE,
423 .mode = 0644, 392 .mode = 0644,
424 .proc_handler = &proc_dostring, 393 .proc_handler = &proc_dostring,
425 .strategy = &sysctl_string,
426 }, 394 },
427 { 395 {
428 .ctl_name = CTL_UNNUMBERED,
429 .procname = "core_pipe_limit", 396 .procname = "core_pipe_limit",
430 .data = &core_pipe_limit, 397 .data = &core_pipe_limit,
431 .maxlen = sizeof(unsigned int), 398 .maxlen = sizeof(unsigned int),
@@ -451,7 +418,6 @@ static struct ctl_table kern_table[] = {
451#endif 418#endif
452#ifdef CONFIG_BLK_DEV_INITRD 419#ifdef CONFIG_BLK_DEV_INITRD
453 { 420 {
454 .ctl_name = KERN_REALROOTDEV,
455 .procname = "real-root-dev", 421 .procname = "real-root-dev",
456 .data = &real_root_dev, 422 .data = &real_root_dev,
457 .maxlen = sizeof(int), 423 .maxlen = sizeof(int),
@@ -460,7 +426,6 @@ static struct ctl_table kern_table[] = {
460 }, 426 },
461#endif 427#endif
462 { 428 {
463 .ctl_name = CTL_UNNUMBERED,
464 .procname = "print-fatal-signals", 429 .procname = "print-fatal-signals",
465 .data = &print_fatal_signals, 430 .data = &print_fatal_signals,
466 .maxlen = sizeof(int), 431 .maxlen = sizeof(int),
@@ -469,16 +434,13 @@ static struct ctl_table kern_table[] = {
469 }, 434 },
470#ifdef CONFIG_SPARC 435#ifdef CONFIG_SPARC
471 { 436 {
472 .ctl_name = KERN_SPARC_REBOOT,
473 .procname = "reboot-cmd", 437 .procname = "reboot-cmd",
474 .data = reboot_command, 438 .data = reboot_command,
475 .maxlen = 256, 439 .maxlen = 256,
476 .mode = 0644, 440 .mode = 0644,
477 .proc_handler = &proc_dostring, 441 .proc_handler = &proc_dostring,
478 .strategy = &sysctl_string,
479 }, 442 },
480 { 443 {
481 .ctl_name = KERN_SPARC_STOP_A,
482 .procname = "stop-a", 444 .procname = "stop-a",
483 .data = &stop_a_enabled, 445 .data = &stop_a_enabled,
484 .maxlen = sizeof (int), 446 .maxlen = sizeof (int),
@@ -486,7 +448,6 @@ static struct ctl_table kern_table[] = {
486 .proc_handler = &proc_dointvec, 448 .proc_handler = &proc_dointvec,
487 }, 449 },
488 { 450 {
489 .ctl_name = KERN_SPARC_SCONS_PWROFF,
490 .procname = "scons-poweroff", 451 .procname = "scons-poweroff",
491 .data = &scons_pwroff, 452 .data = &scons_pwroff,
492 .maxlen = sizeof (int), 453 .maxlen = sizeof (int),
@@ -496,7 +457,6 @@ static struct ctl_table kern_table[] = {
496#endif 457#endif
497#ifdef CONFIG_SPARC64 458#ifdef CONFIG_SPARC64
498 { 459 {
499 .ctl_name = CTL_UNNUMBERED,
500 .procname = "tsb-ratio", 460 .procname = "tsb-ratio",
501 .data = &sysctl_tsb_ratio, 461 .data = &sysctl_tsb_ratio,
502 .maxlen = sizeof (int), 462 .maxlen = sizeof (int),
@@ -506,7 +466,6 @@ static struct ctl_table kern_table[] = {
506#endif 466#endif
507#ifdef __hppa__ 467#ifdef __hppa__
508 { 468 {
509 .ctl_name = KERN_HPPA_PWRSW,
510 .procname = "soft-power", 469 .procname = "soft-power",
511 .data = &pwrsw_enabled, 470 .data = &pwrsw_enabled,
512 .maxlen = sizeof (int), 471 .maxlen = sizeof (int),
@@ -514,7 +473,6 @@ static struct ctl_table kern_table[] = {
514 .proc_handler = &proc_dointvec, 473 .proc_handler = &proc_dointvec,
515 }, 474 },
516 { 475 {
517 .ctl_name = KERN_HPPA_UNALIGNED,
518 .procname = "unaligned-trap", 476 .procname = "unaligned-trap",
519 .data = &unaligned_enabled, 477 .data = &unaligned_enabled,
520 .maxlen = sizeof (int), 478 .maxlen = sizeof (int),
@@ -523,7 +481,6 @@ static struct ctl_table kern_table[] = {
523 }, 481 },
524#endif 482#endif
525 { 483 {
526 .ctl_name = KERN_CTLALTDEL,
527 .procname = "ctrl-alt-del", 484 .procname = "ctrl-alt-del",
528 .data = &C_A_D, 485 .data = &C_A_D,
529 .maxlen = sizeof(int), 486 .maxlen = sizeof(int),
@@ -532,7 +489,6 @@ static struct ctl_table kern_table[] = {
532 }, 489 },
533#ifdef CONFIG_FUNCTION_TRACER 490#ifdef CONFIG_FUNCTION_TRACER
534 { 491 {
535 .ctl_name = CTL_UNNUMBERED,
536 .procname = "ftrace_enabled", 492 .procname = "ftrace_enabled",
537 .data = &ftrace_enabled, 493 .data = &ftrace_enabled,
538 .maxlen = sizeof(int), 494 .maxlen = sizeof(int),
@@ -542,7 +498,6 @@ static struct ctl_table kern_table[] = {
542#endif 498#endif
543#ifdef CONFIG_STACK_TRACER 499#ifdef CONFIG_STACK_TRACER
544 { 500 {
545 .ctl_name = CTL_UNNUMBERED,
546 .procname = "stack_tracer_enabled", 501 .procname = "stack_tracer_enabled",
547 .data = &stack_tracer_enabled, 502 .data = &stack_tracer_enabled,
548 .maxlen = sizeof(int), 503 .maxlen = sizeof(int),
@@ -552,7 +507,6 @@ static struct ctl_table kern_table[] = {
552#endif 507#endif
553#ifdef CONFIG_TRACING 508#ifdef CONFIG_TRACING
554 { 509 {
555 .ctl_name = CTL_UNNUMBERED,
556 .procname = "ftrace_dump_on_oops", 510 .procname = "ftrace_dump_on_oops",
557 .data = &ftrace_dump_on_oops, 511 .data = &ftrace_dump_on_oops,
558 .maxlen = sizeof(int), 512 .maxlen = sizeof(int),
@@ -562,16 +516,13 @@ static struct ctl_table kern_table[] = {
562#endif 516#endif
563#ifdef CONFIG_MODULES 517#ifdef CONFIG_MODULES
564 { 518 {
565 .ctl_name = KERN_MODPROBE,
566 .procname = "modprobe", 519 .procname = "modprobe",
567 .data = &modprobe_path, 520 .data = &modprobe_path,
568 .maxlen = KMOD_PATH_LEN, 521 .maxlen = KMOD_PATH_LEN,
569 .mode = 0644, 522 .mode = 0644,
570 .proc_handler = &proc_dostring, 523 .proc_handler = &proc_dostring,
571 .strategy = &sysctl_string,
572 }, 524 },
573 { 525 {
574 .ctl_name = CTL_UNNUMBERED,
575 .procname = "modules_disabled", 526 .procname = "modules_disabled",
576 .data = &modules_disabled, 527 .data = &modules_disabled,
577 .maxlen = sizeof(int), 528 .maxlen = sizeof(int),
@@ -584,18 +535,15 @@ static struct ctl_table kern_table[] = {
584#endif 535#endif
585#if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET) 536#if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET)
586 { 537 {
587 .ctl_name = KERN_HOTPLUG,
588 .procname = "hotplug", 538 .procname = "hotplug",
589 .data = &uevent_helper, 539 .data = &uevent_helper,
590 .maxlen = UEVENT_HELPER_PATH_LEN, 540 .maxlen = UEVENT_HELPER_PATH_LEN,
591 .mode = 0644, 541 .mode = 0644,
592 .proc_handler = &proc_dostring, 542 .proc_handler = &proc_dostring,
593 .strategy = &sysctl_string,
594 }, 543 },
595#endif 544#endif
596#ifdef CONFIG_CHR_DEV_SG 545#ifdef CONFIG_CHR_DEV_SG
597 { 546 {
598 .ctl_name = KERN_SG_BIG_BUFF,
599 .procname = "sg-big-buff", 547 .procname = "sg-big-buff",
600 .data = &sg_big_buff, 548 .data = &sg_big_buff,
601 .maxlen = sizeof (int), 549 .maxlen = sizeof (int),
@@ -605,7 +553,6 @@ static struct ctl_table kern_table[] = {
605#endif 553#endif
606#ifdef CONFIG_BSD_PROCESS_ACCT 554#ifdef CONFIG_BSD_PROCESS_ACCT
607 { 555 {
608 .ctl_name = KERN_ACCT,
609 .procname = "acct", 556 .procname = "acct",
610 .data = &acct_parm, 557 .data = &acct_parm,
611 .maxlen = 3*sizeof(int), 558 .maxlen = 3*sizeof(int),
@@ -615,7 +562,6 @@ static struct ctl_table kern_table[] = {
615#endif 562#endif
616#ifdef CONFIG_MAGIC_SYSRQ 563#ifdef CONFIG_MAGIC_SYSRQ
617 { 564 {
618 .ctl_name = KERN_SYSRQ,
619 .procname = "sysrq", 565 .procname = "sysrq",
620 .data = &__sysrq_enabled, 566 .data = &__sysrq_enabled,
621 .maxlen = sizeof (int), 567 .maxlen = sizeof (int),
@@ -633,7 +579,6 @@ static struct ctl_table kern_table[] = {
633 }, 579 },
634#endif 580#endif
635 { 581 {
636 .ctl_name = KERN_MAX_THREADS,
637 .procname = "threads-max", 582 .procname = "threads-max",
638 .data = &max_threads, 583 .data = &max_threads,
639 .maxlen = sizeof(int), 584 .maxlen = sizeof(int),
@@ -641,37 +586,31 @@ static struct ctl_table kern_table[] = {
641 .proc_handler = &proc_dointvec, 586 .proc_handler = &proc_dointvec,
642 }, 587 },
643 { 588 {
644 .ctl_name = KERN_RANDOM,
645 .procname = "random", 589 .procname = "random",
646 .mode = 0555, 590 .mode = 0555,
647 .child = random_table, 591 .child = random_table,
648 }, 592 },
649 { 593 {
650 .ctl_name = KERN_OVERFLOWUID,
651 .procname = "overflowuid", 594 .procname = "overflowuid",
652 .data = &overflowuid, 595 .data = &overflowuid,
653 .maxlen = sizeof(int), 596 .maxlen = sizeof(int),
654 .mode = 0644, 597 .mode = 0644,
655 .proc_handler = &proc_dointvec_minmax, 598 .proc_handler = &proc_dointvec_minmax,
656 .strategy = &sysctl_intvec,
657 .extra1 = &minolduid, 599 .extra1 = &minolduid,
658 .extra2 = &maxolduid, 600 .extra2 = &maxolduid,
659 }, 601 },
660 { 602 {
661 .ctl_name = KERN_OVERFLOWGID,
662 .procname = "overflowgid", 603 .procname = "overflowgid",
663 .data = &overflowgid, 604 .data = &overflowgid,
664 .maxlen = sizeof(int), 605 .maxlen = sizeof(int),
665 .mode = 0644, 606 .mode = 0644,
666 .proc_handler = &proc_dointvec_minmax, 607 .proc_handler = &proc_dointvec_minmax,
667 .strategy = &sysctl_intvec,
668 .extra1 = &minolduid, 608 .extra1 = &minolduid,
669 .extra2 = &maxolduid, 609 .extra2 = &maxolduid,
670 }, 610 },
671#ifdef CONFIG_S390 611#ifdef CONFIG_S390
672#ifdef CONFIG_MATHEMU 612#ifdef CONFIG_MATHEMU
673 { 613 {
674 .ctl_name = KERN_IEEE_EMULATION_WARNINGS,
675 .procname = "ieee_emulation_warnings", 614 .procname = "ieee_emulation_warnings",
676 .data = &sysctl_ieee_emulation_warnings, 615 .data = &sysctl_ieee_emulation_warnings,
677 .maxlen = sizeof(int), 616 .maxlen = sizeof(int),
@@ -680,7 +619,6 @@ static struct ctl_table kern_table[] = {
680 }, 619 },
681#endif 620#endif
682 { 621 {
683 .ctl_name = KERN_S390_USER_DEBUG_LOGGING,
684 .procname = "userprocess_debug", 622 .procname = "userprocess_debug",
685 .data = &sysctl_userprocess_debug, 623 .data = &sysctl_userprocess_debug,
686 .maxlen = sizeof(int), 624 .maxlen = sizeof(int),
@@ -689,18 +627,15 @@ static struct ctl_table kern_table[] = {
689 }, 627 },
690#endif 628#endif
691 { 629 {
692 .ctl_name = KERN_PIDMAX,
693 .procname = "pid_max", 630 .procname = "pid_max",
694 .data = &pid_max, 631 .data = &pid_max,
695 .maxlen = sizeof (int), 632 .maxlen = sizeof (int),
696 .mode = 0644, 633 .mode = 0644,
697 .proc_handler = &proc_dointvec_minmax, 634 .proc_handler = &proc_dointvec_minmax,
698 .strategy = sysctl_intvec,
699 .extra1 = &pid_max_min, 635 .extra1 = &pid_max_min,
700 .extra2 = &pid_max_max, 636 .extra2 = &pid_max_max,
701 }, 637 },
702 { 638 {
703 .ctl_name = KERN_PANIC_ON_OOPS,
704 .procname = "panic_on_oops", 639 .procname = "panic_on_oops",
705 .data = &panic_on_oops, 640 .data = &panic_on_oops,
706 .maxlen = sizeof(int), 641 .maxlen = sizeof(int),
@@ -709,7 +644,6 @@ static struct ctl_table kern_table[] = {
709 }, 644 },
710#if defined CONFIG_PRINTK 645#if defined CONFIG_PRINTK
711 { 646 {
712 .ctl_name = KERN_PRINTK,
713 .procname = "printk", 647 .procname = "printk",
714 .data = &console_loglevel, 648 .data = &console_loglevel,
715 .maxlen = 4*sizeof(int), 649 .maxlen = 4*sizeof(int),
@@ -717,16 +651,13 @@ static struct ctl_table kern_table[] = {
717 .proc_handler = &proc_dointvec, 651 .proc_handler = &proc_dointvec,
718 }, 652 },
719 { 653 {
720 .ctl_name = KERN_PRINTK_RATELIMIT,
721 .procname = "printk_ratelimit", 654 .procname = "printk_ratelimit",
722 .data = &printk_ratelimit_state.interval, 655 .data = &printk_ratelimit_state.interval,
723 .maxlen = sizeof(int), 656 .maxlen = sizeof(int),
724 .mode = 0644, 657 .mode = 0644,
725 .proc_handler = &proc_dointvec_jiffies, 658 .proc_handler = &proc_dointvec_jiffies,
726 .strategy = &sysctl_jiffies,
727 }, 659 },
728 { 660 {
729 .ctl_name = KERN_PRINTK_RATELIMIT_BURST,
730 .procname = "printk_ratelimit_burst", 661 .procname = "printk_ratelimit_burst",
731 .data = &printk_ratelimit_state.burst, 662 .data = &printk_ratelimit_state.burst,
732 .maxlen = sizeof(int), 663 .maxlen = sizeof(int),
@@ -734,19 +665,16 @@ static struct ctl_table kern_table[] = {
734 .proc_handler = &proc_dointvec, 665 .proc_handler = &proc_dointvec,
735 }, 666 },
736 { 667 {
737 .ctl_name = CTL_UNNUMBERED,
738 .procname = "printk_delay", 668 .procname = "printk_delay",
739 .data = &printk_delay_msec, 669 .data = &printk_delay_msec,
740 .maxlen = sizeof(int), 670 .maxlen = sizeof(int),
741 .mode = 0644, 671 .mode = 0644,
742 .proc_handler = &proc_dointvec_minmax, 672 .proc_handler = &proc_dointvec_minmax,
743 .strategy = &sysctl_intvec,
744 .extra1 = &zero, 673 .extra1 = &zero,
745 .extra2 = &ten_thousand, 674 .extra2 = &ten_thousand,
746 }, 675 },
747#endif 676#endif
748 { 677 {
749 .ctl_name = KERN_NGROUPS_MAX,
750 .procname = "ngroups_max", 678 .procname = "ngroups_max",
751 .data = &ngroups_max, 679 .data = &ngroups_max,
752 .maxlen = sizeof (int), 680 .maxlen = sizeof (int),
@@ -755,7 +683,6 @@ static struct ctl_table kern_table[] = {
755 }, 683 },
756#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86) 684#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86)
757 { 685 {
758 .ctl_name = KERN_UNKNOWN_NMI_PANIC,
759 .procname = "unknown_nmi_panic", 686 .procname = "unknown_nmi_panic",
760 .data = &unknown_nmi_panic, 687 .data = &unknown_nmi_panic,
761 .maxlen = sizeof (int), 688 .maxlen = sizeof (int),
@@ -772,7 +699,6 @@ static struct ctl_table kern_table[] = {
772#endif 699#endif
773#if defined(CONFIG_X86) 700#if defined(CONFIG_X86)
774 { 701 {
775 .ctl_name = KERN_PANIC_ON_NMI,
776 .procname = "panic_on_unrecovered_nmi", 702 .procname = "panic_on_unrecovered_nmi",
777 .data = &panic_on_unrecovered_nmi, 703 .data = &panic_on_unrecovered_nmi,
778 .maxlen = sizeof(int), 704 .maxlen = sizeof(int),
@@ -780,7 +706,6 @@ static struct ctl_table kern_table[] = {
780 .proc_handler = &proc_dointvec, 706 .proc_handler = &proc_dointvec,
781 }, 707 },
782 { 708 {
783 .ctl_name = CTL_UNNUMBERED,
784 .procname = "panic_on_io_nmi", 709 .procname = "panic_on_io_nmi",
785 .data = &panic_on_io_nmi, 710 .data = &panic_on_io_nmi,
786 .maxlen = sizeof(int), 711 .maxlen = sizeof(int),
@@ -788,7 +713,6 @@ static struct ctl_table kern_table[] = {
788 .proc_handler = &proc_dointvec, 713 .proc_handler = &proc_dointvec,
789 }, 714 },
790 { 715 {
791 .ctl_name = KERN_BOOTLOADER_TYPE,
792 .procname = "bootloader_type", 716 .procname = "bootloader_type",
793 .data = &bootloader_type, 717 .data = &bootloader_type,
794 .maxlen = sizeof (int), 718 .maxlen = sizeof (int),
@@ -796,7 +720,6 @@ static struct ctl_table kern_table[] = {
796 .proc_handler = &proc_dointvec, 720 .proc_handler = &proc_dointvec,
797 }, 721 },
798 { 722 {
799 .ctl_name = CTL_UNNUMBERED,
800 .procname = "bootloader_version", 723 .procname = "bootloader_version",
801 .data = &bootloader_version, 724 .data = &bootloader_version,
802 .maxlen = sizeof (int), 725 .maxlen = sizeof (int),
@@ -804,7 +727,6 @@ static struct ctl_table kern_table[] = {
804 .proc_handler = &proc_dointvec, 727 .proc_handler = &proc_dointvec,
805 }, 728 },
806 { 729 {
807 .ctl_name = CTL_UNNUMBERED,
808 .procname = "kstack_depth_to_print", 730 .procname = "kstack_depth_to_print",
809 .data = &kstack_depth_to_print, 731 .data = &kstack_depth_to_print,
810 .maxlen = sizeof(int), 732 .maxlen = sizeof(int),
@@ -812,7 +734,6 @@ static struct ctl_table kern_table[] = {
812 .proc_handler = &proc_dointvec, 734 .proc_handler = &proc_dointvec,
813 }, 735 },
814 { 736 {
815 .ctl_name = CTL_UNNUMBERED,
816 .procname = "io_delay_type", 737 .procname = "io_delay_type",
817 .data = &io_delay_type, 738 .data = &io_delay_type,
818 .maxlen = sizeof(int), 739 .maxlen = sizeof(int),
@@ -822,7 +743,6 @@ static struct ctl_table kern_table[] = {
822#endif 743#endif
823#if defined(CONFIG_MMU) 744#if defined(CONFIG_MMU)
824 { 745 {
825 .ctl_name = KERN_RANDOMIZE,
826 .procname = "randomize_va_space", 746 .procname = "randomize_va_space",
827 .data = &randomize_va_space, 747 .data = &randomize_va_space,
828 .maxlen = sizeof(int), 748 .maxlen = sizeof(int),
@@ -832,7 +752,6 @@ static struct ctl_table kern_table[] = {
832#endif 752#endif
833#if defined(CONFIG_S390) && defined(CONFIG_SMP) 753#if defined(CONFIG_S390) && defined(CONFIG_SMP)
834 { 754 {
835 .ctl_name = KERN_SPIN_RETRY,
836 .procname = "spin_retry", 755 .procname = "spin_retry",
837 .data = &spin_retry, 756 .data = &spin_retry,
838 .maxlen = sizeof (int), 757 .maxlen = sizeof (int),
@@ -851,7 +770,6 @@ static struct ctl_table kern_table[] = {
851#endif 770#endif
852#ifdef CONFIG_IA64 771#ifdef CONFIG_IA64
853 { 772 {
854 .ctl_name = KERN_IA64_UNALIGNED,
855 .procname = "ignore-unaligned-usertrap", 773 .procname = "ignore-unaligned-usertrap",
856 .data = &no_unaligned_warning, 774 .data = &no_unaligned_warning,
857 .maxlen = sizeof (int), 775 .maxlen = sizeof (int),
@@ -859,7 +777,6 @@ static struct ctl_table kern_table[] = {
859 .proc_handler = &proc_dointvec, 777 .proc_handler = &proc_dointvec,
860 }, 778 },
861 { 779 {
862 .ctl_name = CTL_UNNUMBERED,
863 .procname = "unaligned-dump-stack", 780 .procname = "unaligned-dump-stack",
864 .data = &unaligned_dump_stack, 781 .data = &unaligned_dump_stack,
865 .maxlen = sizeof (int), 782 .maxlen = sizeof (int),
@@ -869,71 +786,58 @@ static struct ctl_table kern_table[] = {
869#endif 786#endif
870#ifdef CONFIG_DETECT_SOFTLOCKUP 787#ifdef CONFIG_DETECT_SOFTLOCKUP
871 { 788 {
872 .ctl_name = CTL_UNNUMBERED,
873 .procname = "softlockup_panic", 789 .procname = "softlockup_panic",
874 .data = &softlockup_panic, 790 .data = &softlockup_panic,
875 .maxlen = sizeof(int), 791 .maxlen = sizeof(int),
876 .mode = 0644, 792 .mode = 0644,
877 .proc_handler = &proc_dointvec_minmax, 793 .proc_handler = &proc_dointvec_minmax,
878 .strategy = &sysctl_intvec,
879 .extra1 = &zero, 794 .extra1 = &zero,
880 .extra2 = &one, 795 .extra2 = &one,
881 }, 796 },
882 { 797 {
883 .ctl_name = CTL_UNNUMBERED,
884 .procname = "softlockup_thresh", 798 .procname = "softlockup_thresh",
885 .data = &softlockup_thresh, 799 .data = &softlockup_thresh,
886 .maxlen = sizeof(int), 800 .maxlen = sizeof(int),
887 .mode = 0644, 801 .mode = 0644,
888 .proc_handler = &proc_dosoftlockup_thresh, 802 .proc_handler = &proc_dosoftlockup_thresh,
889 .strategy = &sysctl_intvec,
890 .extra1 = &neg_one, 803 .extra1 = &neg_one,
891 .extra2 = &sixty, 804 .extra2 = &sixty,
892 }, 805 },
893#endif 806#endif
894#ifdef CONFIG_DETECT_HUNG_TASK 807#ifdef CONFIG_DETECT_HUNG_TASK
895 { 808 {
896 .ctl_name = CTL_UNNUMBERED,
897 .procname = "hung_task_panic", 809 .procname = "hung_task_panic",
898 .data = &sysctl_hung_task_panic, 810 .data = &sysctl_hung_task_panic,
899 .maxlen = sizeof(int), 811 .maxlen = sizeof(int),
900 .mode = 0644, 812 .mode = 0644,
901 .proc_handler = &proc_dointvec_minmax, 813 .proc_handler = &proc_dointvec_minmax,
902 .strategy = &sysctl_intvec,
903 .extra1 = &zero, 814 .extra1 = &zero,
904 .extra2 = &one, 815 .extra2 = &one,
905 }, 816 },
906 { 817 {
907 .ctl_name = CTL_UNNUMBERED,
908 .procname = "hung_task_check_count", 818 .procname = "hung_task_check_count",
909 .data = &sysctl_hung_task_check_count, 819 .data = &sysctl_hung_task_check_count,
910 .maxlen = sizeof(unsigned long), 820 .maxlen = sizeof(unsigned long),
911 .mode = 0644, 821 .mode = 0644,
912 .proc_handler = &proc_doulongvec_minmax, 822 .proc_handler = &proc_doulongvec_minmax,
913 .strategy = &sysctl_intvec,
914 }, 823 },
915 { 824 {
916 .ctl_name = CTL_UNNUMBERED,
917 .procname = "hung_task_timeout_secs", 825 .procname = "hung_task_timeout_secs",
918 .data = &sysctl_hung_task_timeout_secs, 826 .data = &sysctl_hung_task_timeout_secs,
919 .maxlen = sizeof(unsigned long), 827 .maxlen = sizeof(unsigned long),
920 .mode = 0644, 828 .mode = 0644,
921 .proc_handler = &proc_dohung_task_timeout_secs, 829 .proc_handler = &proc_dohung_task_timeout_secs,
922 .strategy = &sysctl_intvec,
923 }, 830 },
924 { 831 {
925 .ctl_name = CTL_UNNUMBERED,
926 .procname = "hung_task_warnings", 832 .procname = "hung_task_warnings",
927 .data = &sysctl_hung_task_warnings, 833 .data = &sysctl_hung_task_warnings,
928 .maxlen = sizeof(unsigned long), 834 .maxlen = sizeof(unsigned long),
929 .mode = 0644, 835 .mode = 0644,
930 .proc_handler = &proc_doulongvec_minmax, 836 .proc_handler = &proc_doulongvec_minmax,
931 .strategy = &sysctl_intvec,
932 }, 837 },
933#endif 838#endif
934#ifdef CONFIG_COMPAT 839#ifdef CONFIG_COMPAT
935 { 840 {
936 .ctl_name = KERN_COMPAT_LOG,
937 .procname = "compat-log", 841 .procname = "compat-log",
938 .data = &compat_log, 842 .data = &compat_log,
939 .maxlen = sizeof (int), 843 .maxlen = sizeof (int),
@@ -943,7 +847,6 @@ static struct ctl_table kern_table[] = {
943#endif 847#endif
944#ifdef CONFIG_RT_MUTEXES 848#ifdef CONFIG_RT_MUTEXES
945 { 849 {
946 .ctl_name = KERN_MAX_LOCK_DEPTH,
947 .procname = "max_lock_depth", 850 .procname = "max_lock_depth",
948 .data = &max_lock_depth, 851 .data = &max_lock_depth,
949 .maxlen = sizeof(int), 852 .maxlen = sizeof(int),
@@ -952,17 +855,14 @@ static struct ctl_table kern_table[] = {
952 }, 855 },
953#endif 856#endif
954 { 857 {
955 .ctl_name = CTL_UNNUMBERED,
956 .procname = "poweroff_cmd", 858 .procname = "poweroff_cmd",
957 .data = &poweroff_cmd, 859 .data = &poweroff_cmd,
958 .maxlen = POWEROFF_CMD_PATH_LEN, 860 .maxlen = POWEROFF_CMD_PATH_LEN,
959 .mode = 0644, 861 .mode = 0644,
960 .proc_handler = &proc_dostring, 862 .proc_handler = &proc_dostring,
961 .strategy = &sysctl_string,
962 }, 863 },
963#ifdef CONFIG_KEYS 864#ifdef CONFIG_KEYS
964 { 865 {
965 .ctl_name = CTL_UNNUMBERED,
966 .procname = "keys", 866 .procname = "keys",
967 .mode = 0555, 867 .mode = 0555,
968 .child = key_sysctls, 868 .child = key_sysctls,
@@ -970,7 +870,6 @@ static struct ctl_table kern_table[] = {
970#endif 870#endif
971#ifdef CONFIG_RCU_TORTURE_TEST 871#ifdef CONFIG_RCU_TORTURE_TEST
972 { 872 {
973 .ctl_name = CTL_UNNUMBERED,
974 .procname = "rcutorture_runnable", 873 .procname = "rcutorture_runnable",
975 .data = &rcutorture_runnable, 874 .data = &rcutorture_runnable,
976 .maxlen = sizeof(int), 875 .maxlen = sizeof(int),
@@ -980,7 +879,6 @@ static struct ctl_table kern_table[] = {
980#endif 879#endif
981#ifdef CONFIG_SLOW_WORK 880#ifdef CONFIG_SLOW_WORK
982 { 881 {
983 .ctl_name = CTL_UNNUMBERED,
984 .procname = "slow-work", 882 .procname = "slow-work",
985 .mode = 0555, 883 .mode = 0555,
986 .child = slow_work_sysctls, 884 .child = slow_work_sysctls,
@@ -988,7 +886,6 @@ static struct ctl_table kern_table[] = {
988#endif 886#endif
989#ifdef CONFIG_PERF_EVENTS 887#ifdef CONFIG_PERF_EVENTS
990 { 888 {
991 .ctl_name = CTL_UNNUMBERED,
992 .procname = "perf_event_paranoid", 889 .procname = "perf_event_paranoid",
993 .data = &sysctl_perf_event_paranoid, 890 .data = &sysctl_perf_event_paranoid,
994 .maxlen = sizeof(sysctl_perf_event_paranoid), 891 .maxlen = sizeof(sysctl_perf_event_paranoid),
@@ -996,7 +893,6 @@ static struct ctl_table kern_table[] = {
996 .proc_handler = &proc_dointvec, 893 .proc_handler = &proc_dointvec,
997 }, 894 },
998 { 895 {
999 .ctl_name = CTL_UNNUMBERED,
1000 .procname = "perf_event_mlock_kb", 896 .procname = "perf_event_mlock_kb",
1001 .data = &sysctl_perf_event_mlock, 897 .data = &sysctl_perf_event_mlock,
1002 .maxlen = sizeof(sysctl_perf_event_mlock), 898 .maxlen = sizeof(sysctl_perf_event_mlock),
@@ -1004,7 +900,6 @@ static struct ctl_table kern_table[] = {
1004 .proc_handler = &proc_dointvec, 900 .proc_handler = &proc_dointvec,
1005 }, 901 },
1006 { 902 {
1007 .ctl_name = CTL_UNNUMBERED,
1008 .procname = "perf_event_max_sample_rate", 903 .procname = "perf_event_max_sample_rate",
1009 .data = &sysctl_perf_event_sample_rate, 904 .data = &sysctl_perf_event_sample_rate,
1010 .maxlen = sizeof(sysctl_perf_event_sample_rate), 905 .maxlen = sizeof(sysctl_perf_event_sample_rate),
@@ -1014,7 +909,6 @@ static struct ctl_table kern_table[] = {
1014#endif 909#endif
1015#ifdef CONFIG_KMEMCHECK 910#ifdef CONFIG_KMEMCHECK
1016 { 911 {
1017 .ctl_name = CTL_UNNUMBERED,
1018 .procname = "kmemcheck", 912 .procname = "kmemcheck",
1019 .data = &kmemcheck_enabled, 913 .data = &kmemcheck_enabled,
1020 .maxlen = sizeof(int), 914 .maxlen = sizeof(int),
@@ -1024,7 +918,6 @@ static struct ctl_table kern_table[] = {
1024#endif 918#endif
1025#ifdef CONFIG_BLOCK 919#ifdef CONFIG_BLOCK
1026 { 920 {
1027 .ctl_name = CTL_UNNUMBERED,
1028 .procname = "blk_iopoll", 921 .procname = "blk_iopoll",
1029 .data = &blk_iopoll_enabled, 922 .data = &blk_iopoll_enabled,
1030 .maxlen = sizeof(int), 923 .maxlen = sizeof(int),
@@ -1036,12 +929,11 @@ static struct ctl_table kern_table[] = {
1036 * NOTE: do not add new entries to this table unless you have read 929 * NOTE: do not add new entries to this table unless you have read
1037 * Documentation/sysctl/ctl_unnumbered.txt 930 * Documentation/sysctl/ctl_unnumbered.txt
1038 */ 931 */
1039 { .ctl_name = 0 } 932 { }
1040}; 933};
1041 934
1042static struct ctl_table vm_table[] = { 935static struct ctl_table vm_table[] = {
1043 { 936 {
1044 .ctl_name = VM_OVERCOMMIT_MEMORY,
1045 .procname = "overcommit_memory", 937 .procname = "overcommit_memory",
1046 .data = &sysctl_overcommit_memory, 938 .data = &sysctl_overcommit_memory,
1047 .maxlen = sizeof(sysctl_overcommit_memory), 939 .maxlen = sizeof(sysctl_overcommit_memory),
@@ -1049,7 +941,6 @@ static struct ctl_table vm_table[] = {
1049 .proc_handler = &proc_dointvec, 941 .proc_handler = &proc_dointvec,
1050 }, 942 },
1051 { 943 {
1052 .ctl_name = VM_PANIC_ON_OOM,
1053 .procname = "panic_on_oom", 944 .procname = "panic_on_oom",
1054 .data = &sysctl_panic_on_oom, 945 .data = &sysctl_panic_on_oom,
1055 .maxlen = sizeof(sysctl_panic_on_oom), 946 .maxlen = sizeof(sysctl_panic_on_oom),
@@ -1057,7 +948,6 @@ static struct ctl_table vm_table[] = {
1057 .proc_handler = &proc_dointvec, 948 .proc_handler = &proc_dointvec,
1058 }, 949 },
1059 { 950 {
1060 .ctl_name = CTL_UNNUMBERED,
1061 .procname = "oom_kill_allocating_task", 951 .procname = "oom_kill_allocating_task",
1062 .data = &sysctl_oom_kill_allocating_task, 952 .data = &sysctl_oom_kill_allocating_task,
1063 .maxlen = sizeof(sysctl_oom_kill_allocating_task), 953 .maxlen = sizeof(sysctl_oom_kill_allocating_task),
@@ -1065,7 +955,6 @@ static struct ctl_table vm_table[] = {
1065 .proc_handler = &proc_dointvec, 955 .proc_handler = &proc_dointvec,
1066 }, 956 },
1067 { 957 {
1068 .ctl_name = CTL_UNNUMBERED,
1069 .procname = "oom_dump_tasks", 958 .procname = "oom_dump_tasks",
1070 .data = &sysctl_oom_dump_tasks, 959 .data = &sysctl_oom_dump_tasks,
1071 .maxlen = sizeof(sysctl_oom_dump_tasks), 960 .maxlen = sizeof(sysctl_oom_dump_tasks),
@@ -1073,7 +962,6 @@ static struct ctl_table vm_table[] = {
1073 .proc_handler = &proc_dointvec, 962 .proc_handler = &proc_dointvec,
1074 }, 963 },
1075 { 964 {
1076 .ctl_name = VM_OVERCOMMIT_RATIO,
1077 .procname = "overcommit_ratio", 965 .procname = "overcommit_ratio",
1078 .data = &sysctl_overcommit_ratio, 966 .data = &sysctl_overcommit_ratio,
1079 .maxlen = sizeof(sysctl_overcommit_ratio), 967 .maxlen = sizeof(sysctl_overcommit_ratio),
@@ -1081,7 +969,6 @@ static struct ctl_table vm_table[] = {
1081 .proc_handler = &proc_dointvec, 969 .proc_handler = &proc_dointvec,
1082 }, 970 },
1083 { 971 {
1084 .ctl_name = VM_PAGE_CLUSTER,
1085 .procname = "page-cluster", 972 .procname = "page-cluster",
1086 .data = &page_cluster, 973 .data = &page_cluster,
1087 .maxlen = sizeof(int), 974 .maxlen = sizeof(int),
@@ -1089,45 +976,37 @@ static struct ctl_table vm_table[] = {
1089 .proc_handler = &proc_dointvec, 976 .proc_handler = &proc_dointvec,
1090 }, 977 },
1091 { 978 {
1092 .ctl_name = VM_DIRTY_BACKGROUND,
1093 .procname = "dirty_background_ratio", 979 .procname = "dirty_background_ratio",
1094 .data = &dirty_background_ratio, 980 .data = &dirty_background_ratio,
1095 .maxlen = sizeof(dirty_background_ratio), 981 .maxlen = sizeof(dirty_background_ratio),
1096 .mode = 0644, 982 .mode = 0644,
1097 .proc_handler = &dirty_background_ratio_handler, 983 .proc_handler = &dirty_background_ratio_handler,
1098 .strategy = &sysctl_intvec,
1099 .extra1 = &zero, 984 .extra1 = &zero,
1100 .extra2 = &one_hundred, 985 .extra2 = &one_hundred,
1101 }, 986 },
1102 { 987 {
1103 .ctl_name = CTL_UNNUMBERED,
1104 .procname = "dirty_background_bytes", 988 .procname = "dirty_background_bytes",
1105 .data = &dirty_background_bytes, 989 .data = &dirty_background_bytes,
1106 .maxlen = sizeof(dirty_background_bytes), 990 .maxlen = sizeof(dirty_background_bytes),
1107 .mode = 0644, 991 .mode = 0644,
1108 .proc_handler = &dirty_background_bytes_handler, 992 .proc_handler = &dirty_background_bytes_handler,
1109 .strategy = &sysctl_intvec,
1110 .extra1 = &one_ul, 993 .extra1 = &one_ul,
1111 }, 994 },
1112 { 995 {
1113 .ctl_name = VM_DIRTY_RATIO,
1114 .procname = "dirty_ratio", 996 .procname = "dirty_ratio",
1115 .data = &vm_dirty_ratio, 997 .data = &vm_dirty_ratio,
1116 .maxlen = sizeof(vm_dirty_ratio), 998 .maxlen = sizeof(vm_dirty_ratio),
1117 .mode = 0644, 999 .mode = 0644,
1118 .proc_handler = &dirty_ratio_handler, 1000 .proc_handler = &dirty_ratio_handler,
1119 .strategy = &sysctl_intvec,
1120 .extra1 = &zero, 1001 .extra1 = &zero,
1121 .extra2 = &one_hundred, 1002 .extra2 = &one_hundred,
1122 }, 1003 },
1123 { 1004 {
1124 .ctl_name = CTL_UNNUMBERED,
1125 .procname = "dirty_bytes", 1005 .procname = "dirty_bytes",
1126 .data = &vm_dirty_bytes, 1006 .data = &vm_dirty_bytes,
1127 .maxlen = sizeof(vm_dirty_bytes), 1007 .maxlen = sizeof(vm_dirty_bytes),
1128 .mode = 0644, 1008 .mode = 0644,
1129 .proc_handler = &dirty_bytes_handler, 1009 .proc_handler = &dirty_bytes_handler,
1130 .strategy = &sysctl_intvec,
1131 .extra1 = &dirty_bytes_min, 1010 .extra1 = &dirty_bytes_min,
1132 }, 1011 },
1133 { 1012 {
@@ -1145,7 +1024,6 @@ static struct ctl_table vm_table[] = {
1145 .proc_handler = &proc_dointvec, 1024 .proc_handler = &proc_dointvec,
1146 }, 1025 },
1147 { 1026 {
1148 .ctl_name = VM_NR_PDFLUSH_THREADS,
1149 .procname = "nr_pdflush_threads", 1027 .procname = "nr_pdflush_threads",
1150 .data = &nr_pdflush_threads, 1028 .data = &nr_pdflush_threads,
1151 .maxlen = sizeof nr_pdflush_threads, 1029 .maxlen = sizeof nr_pdflush_threads,
@@ -1153,13 +1031,11 @@ static struct ctl_table vm_table[] = {
1153 .proc_handler = &proc_dointvec, 1031 .proc_handler = &proc_dointvec,
1154 }, 1032 },
1155 { 1033 {
1156 .ctl_name = VM_SWAPPINESS,
1157 .procname = "swappiness", 1034 .procname = "swappiness",
1158 .data = &vm_swappiness, 1035 .data = &vm_swappiness,
1159 .maxlen = sizeof(vm_swappiness), 1036 .maxlen = sizeof(vm_swappiness),
1160 .mode = 0644, 1037 .mode = 0644,
1161 .proc_handler = &proc_dointvec_minmax, 1038 .proc_handler = &proc_dointvec_minmax,
1162 .strategy = &sysctl_intvec,
1163 .extra1 = &zero, 1039 .extra1 = &zero,
1164 .extra2 = &one_hundred, 1040 .extra2 = &one_hundred,
1165 }, 1041 },
@@ -1174,7 +1050,6 @@ static struct ctl_table vm_table[] = {
1174 .extra2 = (void *)&hugetlb_infinity, 1050 .extra2 = (void *)&hugetlb_infinity,
1175 }, 1051 },
1176 { 1052 {
1177 .ctl_name = VM_HUGETLB_GROUP,
1178 .procname = "hugetlb_shm_group", 1053 .procname = "hugetlb_shm_group",
1179 .data = &sysctl_hugetlb_shm_group, 1054 .data = &sysctl_hugetlb_shm_group,
1180 .maxlen = sizeof(gid_t), 1055 .maxlen = sizeof(gid_t),
@@ -1182,7 +1057,6 @@ static struct ctl_table vm_table[] = {
1182 .proc_handler = &proc_dointvec, 1057 .proc_handler = &proc_dointvec,
1183 }, 1058 },
1184 { 1059 {
1185 .ctl_name = CTL_UNNUMBERED,
1186 .procname = "hugepages_treat_as_movable", 1060 .procname = "hugepages_treat_as_movable",
1187 .data = &hugepages_treat_as_movable, 1061 .data = &hugepages_treat_as_movable,
1188 .maxlen = sizeof(int), 1062 .maxlen = sizeof(int),
@@ -1190,7 +1064,6 @@ static struct ctl_table vm_table[] = {
1190 .proc_handler = &hugetlb_treat_movable_handler, 1064 .proc_handler = &hugetlb_treat_movable_handler,
1191 }, 1065 },
1192 { 1066 {
1193 .ctl_name = CTL_UNNUMBERED,
1194 .procname = "nr_overcommit_hugepages", 1067 .procname = "nr_overcommit_hugepages",
1195 .data = NULL, 1068 .data = NULL,
1196 .maxlen = sizeof(unsigned long), 1069 .maxlen = sizeof(unsigned long),
@@ -1201,46 +1074,37 @@ static struct ctl_table vm_table[] = {
1201 }, 1074 },
1202#endif 1075#endif
1203 { 1076 {
1204 .ctl_name = VM_LOWMEM_RESERVE_RATIO,
1205 .procname = "lowmem_reserve_ratio", 1077 .procname = "lowmem_reserve_ratio",
1206 .data = &sysctl_lowmem_reserve_ratio, 1078 .data = &sysctl_lowmem_reserve_ratio,
1207 .maxlen = sizeof(sysctl_lowmem_reserve_ratio), 1079 .maxlen = sizeof(sysctl_lowmem_reserve_ratio),
1208 .mode = 0644, 1080 .mode = 0644,
1209 .proc_handler = &lowmem_reserve_ratio_sysctl_handler, 1081 .proc_handler = &lowmem_reserve_ratio_sysctl_handler,
1210 .strategy = &sysctl_intvec,
1211 }, 1082 },
1212 { 1083 {
1213 .ctl_name = VM_DROP_PAGECACHE,
1214 .procname = "drop_caches", 1084 .procname = "drop_caches",
1215 .data = &sysctl_drop_caches, 1085 .data = &sysctl_drop_caches,
1216 .maxlen = sizeof(int), 1086 .maxlen = sizeof(int),
1217 .mode = 0644, 1087 .mode = 0644,
1218 .proc_handler = drop_caches_sysctl_handler, 1088 .proc_handler = drop_caches_sysctl_handler,
1219 .strategy = &sysctl_intvec,
1220 }, 1089 },
1221 { 1090 {
1222 .ctl_name = VM_MIN_FREE_KBYTES,
1223 .procname = "min_free_kbytes", 1091 .procname = "min_free_kbytes",
1224 .data = &min_free_kbytes, 1092 .data = &min_free_kbytes,
1225 .maxlen = sizeof(min_free_kbytes), 1093 .maxlen = sizeof(min_free_kbytes),
1226 .mode = 0644, 1094 .mode = 0644,
1227 .proc_handler = &min_free_kbytes_sysctl_handler, 1095 .proc_handler = &min_free_kbytes_sysctl_handler,
1228 .strategy = &sysctl_intvec,
1229 .extra1 = &zero, 1096 .extra1 = &zero,
1230 }, 1097 },
1231 { 1098 {
1232 .ctl_name = VM_PERCPU_PAGELIST_FRACTION,
1233 .procname = "percpu_pagelist_fraction", 1099 .procname = "percpu_pagelist_fraction",
1234 .data = &percpu_pagelist_fraction, 1100 .data = &percpu_pagelist_fraction,
1235 .maxlen = sizeof(percpu_pagelist_fraction), 1101 .maxlen = sizeof(percpu_pagelist_fraction),
1236 .mode = 0644, 1102 .mode = 0644,
1237 .proc_handler = &percpu_pagelist_fraction_sysctl_handler, 1103 .proc_handler = &percpu_pagelist_fraction_sysctl_handler,
1238 .strategy = &sysctl_intvec,
1239 .extra1 = &min_percpu_pagelist_fract, 1104 .extra1 = &min_percpu_pagelist_fract,
1240 }, 1105 },
1241#ifdef CONFIG_MMU 1106#ifdef CONFIG_MMU
1242 { 1107 {
1243 .ctl_name = VM_MAX_MAP_COUNT,
1244 .procname = "max_map_count", 1108 .procname = "max_map_count",
1245 .data = &sysctl_max_map_count, 1109 .data = &sysctl_max_map_count,
1246 .maxlen = sizeof(sysctl_max_map_count), 1110 .maxlen = sizeof(sysctl_max_map_count),
@@ -1249,104 +1113,85 @@ static struct ctl_table vm_table[] = {
1249 }, 1113 },
1250#else 1114#else
1251 { 1115 {
1252 .ctl_name = CTL_UNNUMBERED,
1253 .procname = "nr_trim_pages", 1116 .procname = "nr_trim_pages",
1254 .data = &sysctl_nr_trim_pages, 1117 .data = &sysctl_nr_trim_pages,
1255 .maxlen = sizeof(sysctl_nr_trim_pages), 1118 .maxlen = sizeof(sysctl_nr_trim_pages),
1256 .mode = 0644, 1119 .mode = 0644,
1257 .proc_handler = &proc_dointvec_minmax, 1120 .proc_handler = &proc_dointvec_minmax,
1258 .strategy = &sysctl_intvec,
1259 .extra1 = &zero, 1121 .extra1 = &zero,
1260 }, 1122 },
1261#endif 1123#endif
1262 { 1124 {
1263 .ctl_name = VM_LAPTOP_MODE,
1264 .procname = "laptop_mode", 1125 .procname = "laptop_mode",
1265 .data = &laptop_mode, 1126 .data = &laptop_mode,
1266 .maxlen = sizeof(laptop_mode), 1127 .maxlen = sizeof(laptop_mode),
1267 .mode = 0644, 1128 .mode = 0644,
1268 .proc_handler = &proc_dointvec_jiffies, 1129 .proc_handler = &proc_dointvec_jiffies,
1269 .strategy = &sysctl_jiffies,
1270 }, 1130 },
1271 { 1131 {
1272 .ctl_name = VM_BLOCK_DUMP,
1273 .procname = "block_dump", 1132 .procname = "block_dump",
1274 .data = &block_dump, 1133 .data = &block_dump,
1275 .maxlen = sizeof(block_dump), 1134 .maxlen = sizeof(block_dump),
1276 .mode = 0644, 1135 .mode = 0644,
1277 .proc_handler = &proc_dointvec, 1136 .proc_handler = &proc_dointvec,
1278 .strategy = &sysctl_intvec,
1279 .extra1 = &zero, 1137 .extra1 = &zero,
1280 }, 1138 },
1281 { 1139 {
1282 .ctl_name = VM_VFS_CACHE_PRESSURE,
1283 .procname = "vfs_cache_pressure", 1140 .procname = "vfs_cache_pressure",
1284 .data = &sysctl_vfs_cache_pressure, 1141 .data = &sysctl_vfs_cache_pressure,
1285 .maxlen = sizeof(sysctl_vfs_cache_pressure), 1142 .maxlen = sizeof(sysctl_vfs_cache_pressure),
1286 .mode = 0644, 1143 .mode = 0644,
1287 .proc_handler = &proc_dointvec, 1144 .proc_handler = &proc_dointvec,
1288 .strategy = &sysctl_intvec,
1289 .extra1 = &zero, 1145 .extra1 = &zero,
1290 }, 1146 },
1291#ifdef HAVE_ARCH_PICK_MMAP_LAYOUT 1147#ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
1292 { 1148 {
1293 .ctl_name = VM_LEGACY_VA_LAYOUT,
1294 .procname = "legacy_va_layout", 1149 .procname = "legacy_va_layout",
1295 .data = &sysctl_legacy_va_layout, 1150 .data = &sysctl_legacy_va_layout,
1296 .maxlen = sizeof(sysctl_legacy_va_layout), 1151 .maxlen = sizeof(sysctl_legacy_va_layout),
1297 .mode = 0644, 1152 .mode = 0644,
1298 .proc_handler = &proc_dointvec, 1153 .proc_handler = &proc_dointvec,
1299 .strategy = &sysctl_intvec,
1300 .extra1 = &zero, 1154 .extra1 = &zero,
1301 }, 1155 },
1302#endif 1156#endif
1303#ifdef CONFIG_NUMA 1157#ifdef CONFIG_NUMA
1304 { 1158 {
1305 .ctl_name = VM_ZONE_RECLAIM_MODE,
1306 .procname = "zone_reclaim_mode", 1159 .procname = "zone_reclaim_mode",
1307 .data = &zone_reclaim_mode, 1160 .data = &zone_reclaim_mode,
1308 .maxlen = sizeof(zone_reclaim_mode), 1161 .maxlen = sizeof(zone_reclaim_mode),
1309 .mode = 0644, 1162 .mode = 0644,
1310 .proc_handler = &proc_dointvec, 1163 .proc_handler = &proc_dointvec,
1311 .strategy = &sysctl_intvec,
1312 .extra1 = &zero, 1164 .extra1 = &zero,
1313 }, 1165 },
1314 { 1166 {
1315 .ctl_name = VM_MIN_UNMAPPED,
1316 .procname = "min_unmapped_ratio", 1167 .procname = "min_unmapped_ratio",
1317 .data = &sysctl_min_unmapped_ratio, 1168 .data = &sysctl_min_unmapped_ratio,
1318 .maxlen = sizeof(sysctl_min_unmapped_ratio), 1169 .maxlen = sizeof(sysctl_min_unmapped_ratio),
1319 .mode = 0644, 1170 .mode = 0644,
1320 .proc_handler = &sysctl_min_unmapped_ratio_sysctl_handler, 1171 .proc_handler = &sysctl_min_unmapped_ratio_sysctl_handler,
1321 .strategy = &sysctl_intvec,
1322 .extra1 = &zero, 1172 .extra1 = &zero,
1323 .extra2 = &one_hundred, 1173 .extra2 = &one_hundred,
1324 }, 1174 },
1325 { 1175 {
1326 .ctl_name = VM_MIN_SLAB,
1327 .procname = "min_slab_ratio", 1176 .procname = "min_slab_ratio",
1328 .data = &sysctl_min_slab_ratio, 1177 .data = &sysctl_min_slab_ratio,
1329 .maxlen = sizeof(sysctl_min_slab_ratio), 1178 .maxlen = sizeof(sysctl_min_slab_ratio),
1330 .mode = 0644, 1179 .mode = 0644,
1331 .proc_handler = &sysctl_min_slab_ratio_sysctl_handler, 1180 .proc_handler = &sysctl_min_slab_ratio_sysctl_handler,
1332 .strategy = &sysctl_intvec,
1333 .extra1 = &zero, 1181 .extra1 = &zero,
1334 .extra2 = &one_hundred, 1182 .extra2 = &one_hundred,
1335 }, 1183 },
1336#endif 1184#endif
1337#ifdef CONFIG_SMP 1185#ifdef CONFIG_SMP
1338 { 1186 {
1339 .ctl_name = CTL_UNNUMBERED,
1340 .procname = "stat_interval", 1187 .procname = "stat_interval",
1341 .data = &sysctl_stat_interval, 1188 .data = &sysctl_stat_interval,
1342 .maxlen = sizeof(sysctl_stat_interval), 1189 .maxlen = sizeof(sysctl_stat_interval),
1343 .mode = 0644, 1190 .mode = 0644,
1344 .proc_handler = &proc_dointvec_jiffies, 1191 .proc_handler = &proc_dointvec_jiffies,
1345 .strategy = &sysctl_jiffies,
1346 }, 1192 },
1347#endif 1193#endif
1348 { 1194 {
1349 .ctl_name = CTL_UNNUMBERED,
1350 .procname = "mmap_min_addr", 1195 .procname = "mmap_min_addr",
1351 .data = &dac_mmap_min_addr, 1196 .data = &dac_mmap_min_addr,
1352 .maxlen = sizeof(unsigned long), 1197 .maxlen = sizeof(unsigned long),
@@ -1355,43 +1200,36 @@ static struct ctl_table vm_table[] = {
1355 }, 1200 },
1356#ifdef CONFIG_NUMA 1201#ifdef CONFIG_NUMA
1357 { 1202 {
1358 .ctl_name = CTL_UNNUMBERED,
1359 .procname = "numa_zonelist_order", 1203 .procname = "numa_zonelist_order",
1360 .data = &numa_zonelist_order, 1204 .data = &numa_zonelist_order,
1361 .maxlen = NUMA_ZONELIST_ORDER_LEN, 1205 .maxlen = NUMA_ZONELIST_ORDER_LEN,
1362 .mode = 0644, 1206 .mode = 0644,
1363 .proc_handler = &numa_zonelist_order_handler, 1207 .proc_handler = &numa_zonelist_order_handler,
1364 .strategy = &sysctl_string,
1365 }, 1208 },
1366#endif 1209#endif
1367#if (defined(CONFIG_X86_32) && !defined(CONFIG_UML))|| \ 1210#if (defined(CONFIG_X86_32) && !defined(CONFIG_UML))|| \
1368 (defined(CONFIG_SUPERH) && defined(CONFIG_VSYSCALL)) 1211 (defined(CONFIG_SUPERH) && defined(CONFIG_VSYSCALL))
1369 { 1212 {
1370 .ctl_name = VM_VDSO_ENABLED,
1371 .procname = "vdso_enabled", 1213 .procname = "vdso_enabled",
1372 .data = &vdso_enabled, 1214 .data = &vdso_enabled,
1373 .maxlen = sizeof(vdso_enabled), 1215 .maxlen = sizeof(vdso_enabled),
1374 .mode = 0644, 1216 .mode = 0644,
1375 .proc_handler = &proc_dointvec, 1217 .proc_handler = &proc_dointvec,
1376 .strategy = &sysctl_intvec,
1377 .extra1 = &zero, 1218 .extra1 = &zero,
1378 }, 1219 },
1379#endif 1220#endif
1380#ifdef CONFIG_HIGHMEM 1221#ifdef CONFIG_HIGHMEM
1381 { 1222 {
1382 .ctl_name = CTL_UNNUMBERED,
1383 .procname = "highmem_is_dirtyable", 1223 .procname = "highmem_is_dirtyable",
1384 .data = &vm_highmem_is_dirtyable, 1224 .data = &vm_highmem_is_dirtyable,
1385 .maxlen = sizeof(vm_highmem_is_dirtyable), 1225 .maxlen = sizeof(vm_highmem_is_dirtyable),
1386 .mode = 0644, 1226 .mode = 0644,
1387 .proc_handler = &proc_dointvec_minmax, 1227 .proc_handler = &proc_dointvec_minmax,
1388 .strategy = &sysctl_intvec,
1389 .extra1 = &zero, 1228 .extra1 = &zero,
1390 .extra2 = &one, 1229 .extra2 = &one,
1391 }, 1230 },
1392#endif 1231#endif
1393 { 1232 {
1394 .ctl_name = CTL_UNNUMBERED,
1395 .procname = "scan_unevictable_pages", 1233 .procname = "scan_unevictable_pages",
1396 .data = &scan_unevictable_pages, 1234 .data = &scan_unevictable_pages,
1397 .maxlen = sizeof(scan_unevictable_pages), 1235 .maxlen = sizeof(scan_unevictable_pages),
@@ -1400,24 +1238,20 @@ static struct ctl_table vm_table[] = {
1400 }, 1238 },
1401#ifdef CONFIG_MEMORY_FAILURE 1239#ifdef CONFIG_MEMORY_FAILURE
1402 { 1240 {
1403 .ctl_name = CTL_UNNUMBERED,
1404 .procname = "memory_failure_early_kill", 1241 .procname = "memory_failure_early_kill",
1405 .data = &sysctl_memory_failure_early_kill, 1242 .data = &sysctl_memory_failure_early_kill,
1406 .maxlen = sizeof(sysctl_memory_failure_early_kill), 1243 .maxlen = sizeof(sysctl_memory_failure_early_kill),
1407 .mode = 0644, 1244 .mode = 0644,
1408 .proc_handler = &proc_dointvec_minmax, 1245 .proc_handler = &proc_dointvec_minmax,
1409 .strategy = &sysctl_intvec,
1410 .extra1 = &zero, 1246 .extra1 = &zero,
1411 .extra2 = &one, 1247 .extra2 = &one,
1412 }, 1248 },
1413 { 1249 {
1414 .ctl_name = CTL_UNNUMBERED,
1415 .procname = "memory_failure_recovery", 1250 .procname = "memory_failure_recovery",
1416 .data = &sysctl_memory_failure_recovery, 1251 .data = &sysctl_memory_failure_recovery,
1417 .maxlen = sizeof(sysctl_memory_failure_recovery), 1252 .maxlen = sizeof(sysctl_memory_failure_recovery),
1418 .mode = 0644, 1253 .mode = 0644,
1419 .proc_handler = &proc_dointvec_minmax, 1254 .proc_handler = &proc_dointvec_minmax,
1420 .strategy = &sysctl_intvec,
1421 .extra1 = &zero, 1255 .extra1 = &zero,
1422 .extra2 = &one, 1256 .extra2 = &one,
1423 }, 1257 },
@@ -1427,18 +1261,17 @@ static struct ctl_table vm_table[] = {
1427 * NOTE: do not add new entries to this table unless you have read 1261 * NOTE: do not add new entries to this table unless you have read
1428 * Documentation/sysctl/ctl_unnumbered.txt 1262 * Documentation/sysctl/ctl_unnumbered.txt
1429 */ 1263 */
1430 { .ctl_name = 0 } 1264 { }
1431}; 1265};
1432 1266
1433#if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE) 1267#if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE)
1434static struct ctl_table binfmt_misc_table[] = { 1268static struct ctl_table binfmt_misc_table[] = {
1435 { .ctl_name = 0 } 1269 { }
1436}; 1270};
1437#endif 1271#endif
1438 1272
1439static struct ctl_table fs_table[] = { 1273static struct ctl_table fs_table[] = {
1440 { 1274 {
1441 .ctl_name = FS_NRINODE,
1442 .procname = "inode-nr", 1275 .procname = "inode-nr",
1443 .data = &inodes_stat, 1276 .data = &inodes_stat,
1444 .maxlen = 2*sizeof(int), 1277 .maxlen = 2*sizeof(int),
@@ -1446,7 +1279,6 @@ static struct ctl_table fs_table[] = {
1446 .proc_handler = &proc_dointvec, 1279 .proc_handler = &proc_dointvec,
1447 }, 1280 },
1448 { 1281 {
1449 .ctl_name = FS_STATINODE,
1450 .procname = "inode-state", 1282 .procname = "inode-state",
1451 .data = &inodes_stat, 1283 .data = &inodes_stat,
1452 .maxlen = 7*sizeof(int), 1284 .maxlen = 7*sizeof(int),
@@ -1461,7 +1293,6 @@ static struct ctl_table fs_table[] = {
1461 .proc_handler = &proc_nr_files, 1293 .proc_handler = &proc_nr_files,
1462 }, 1294 },
1463 { 1295 {
1464 .ctl_name = FS_MAXFILE,
1465 .procname = "file-max", 1296 .procname = "file-max",
1466 .data = &files_stat.max_files, 1297 .data = &files_stat.max_files,
1467 .maxlen = sizeof(int), 1298 .maxlen = sizeof(int),
@@ -1469,7 +1300,6 @@ static struct ctl_table fs_table[] = {
1469 .proc_handler = &proc_dointvec, 1300 .proc_handler = &proc_dointvec,
1470 }, 1301 },
1471 { 1302 {
1472 .ctl_name = CTL_UNNUMBERED,
1473 .procname = "nr_open", 1303 .procname = "nr_open",
1474 .data = &sysctl_nr_open, 1304 .data = &sysctl_nr_open,
1475 .maxlen = sizeof(int), 1305 .maxlen = sizeof(int),
@@ -1479,7 +1309,6 @@ static struct ctl_table fs_table[] = {
1479 .extra2 = &sysctl_nr_open_max, 1309 .extra2 = &sysctl_nr_open_max,
1480 }, 1310 },
1481 { 1311 {
1482 .ctl_name = FS_DENTRY,
1483 .procname = "dentry-state", 1312 .procname = "dentry-state",
1484 .data = &dentry_stat, 1313 .data = &dentry_stat,
1485 .maxlen = 6*sizeof(int), 1314 .maxlen = 6*sizeof(int),
@@ -1487,30 +1316,25 @@ static struct ctl_table fs_table[] = {
1487 .proc_handler = &proc_dointvec, 1316 .proc_handler = &proc_dointvec,
1488 }, 1317 },
1489 { 1318 {
1490 .ctl_name = FS_OVERFLOWUID,
1491 .procname = "overflowuid", 1319 .procname = "overflowuid",
1492 .data = &fs_overflowuid, 1320 .data = &fs_overflowuid,
1493 .maxlen = sizeof(int), 1321 .maxlen = sizeof(int),
1494 .mode = 0644, 1322 .mode = 0644,
1495 .proc_handler = &proc_dointvec_minmax, 1323 .proc_handler = &proc_dointvec_minmax,
1496 .strategy = &sysctl_intvec,
1497 .extra1 = &minolduid, 1324 .extra1 = &minolduid,
1498 .extra2 = &maxolduid, 1325 .extra2 = &maxolduid,
1499 }, 1326 },
1500 { 1327 {
1501 .ctl_name = FS_OVERFLOWGID,
1502 .procname = "overflowgid", 1328 .procname = "overflowgid",
1503 .data = &fs_overflowgid, 1329 .data = &fs_overflowgid,
1504 .maxlen = sizeof(int), 1330 .maxlen = sizeof(int),
1505 .mode = 0644, 1331 .mode = 0644,
1506 .proc_handler = &proc_dointvec_minmax, 1332 .proc_handler = &proc_dointvec_minmax,
1507 .strategy = &sysctl_intvec,
1508 .extra1 = &minolduid, 1333 .extra1 = &minolduid,
1509 .extra2 = &maxolduid, 1334 .extra2 = &maxolduid,
1510 }, 1335 },
1511#ifdef CONFIG_FILE_LOCKING 1336#ifdef CONFIG_FILE_LOCKING
1512 { 1337 {
1513 .ctl_name = FS_LEASES,
1514 .procname = "leases-enable", 1338 .procname = "leases-enable",
1515 .data = &leases_enable, 1339 .data = &leases_enable,
1516 .maxlen = sizeof(int), 1340 .maxlen = sizeof(int),
@@ -1520,7 +1344,6 @@ static struct ctl_table fs_table[] = {
1520#endif 1344#endif
1521#ifdef CONFIG_DNOTIFY 1345#ifdef CONFIG_DNOTIFY
1522 { 1346 {
1523 .ctl_name = FS_DIR_NOTIFY,
1524 .procname = "dir-notify-enable", 1347 .procname = "dir-notify-enable",
1525 .data = &dir_notify_enable, 1348 .data = &dir_notify_enable,
1526 .maxlen = sizeof(int), 1349 .maxlen = sizeof(int),
@@ -1531,7 +1354,6 @@ static struct ctl_table fs_table[] = {
1531#ifdef CONFIG_MMU 1354#ifdef CONFIG_MMU
1532#ifdef CONFIG_FILE_LOCKING 1355#ifdef CONFIG_FILE_LOCKING
1533 { 1356 {
1534 .ctl_name = FS_LEASE_TIME,
1535 .procname = "lease-break-time", 1357 .procname = "lease-break-time",
1536 .data = &lease_break_time, 1358 .data = &lease_break_time,
1537 .maxlen = sizeof(int), 1359 .maxlen = sizeof(int),
@@ -1557,7 +1379,6 @@ static struct ctl_table fs_table[] = {
1557#endif /* CONFIG_AIO */ 1379#endif /* CONFIG_AIO */
1558#ifdef CONFIG_INOTIFY_USER 1380#ifdef CONFIG_INOTIFY_USER
1559 { 1381 {
1560 .ctl_name = FS_INOTIFY,
1561 .procname = "inotify", 1382 .procname = "inotify",
1562 .mode = 0555, 1383 .mode = 0555,
1563 .child = inotify_table, 1384 .child = inotify_table,
@@ -1572,19 +1393,16 @@ static struct ctl_table fs_table[] = {
1572#endif 1393#endif
1573#endif 1394#endif
1574 { 1395 {
1575 .ctl_name = KERN_SETUID_DUMPABLE,
1576 .procname = "suid_dumpable", 1396 .procname = "suid_dumpable",
1577 .data = &suid_dumpable, 1397 .data = &suid_dumpable,
1578 .maxlen = sizeof(int), 1398 .maxlen = sizeof(int),
1579 .mode = 0644, 1399 .mode = 0644,
1580 .proc_handler = &proc_dointvec_minmax, 1400 .proc_handler = &proc_dointvec_minmax,
1581 .strategy = &sysctl_intvec,
1582 .extra1 = &zero, 1401 .extra1 = &zero,
1583 .extra2 = &two, 1402 .extra2 = &two,
1584 }, 1403 },
1585#if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE) 1404#if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE)
1586 { 1405 {
1587 .ctl_name = CTL_UNNUMBERED,
1588 .procname = "binfmt_misc", 1406 .procname = "binfmt_misc",
1589 .mode = 0555, 1407 .mode = 0555,
1590 .child = binfmt_misc_table, 1408 .child = binfmt_misc_table,
@@ -1594,13 +1412,12 @@ static struct ctl_table fs_table[] = {
1594 * NOTE: do not add new entries to this table unless you have read 1412 * NOTE: do not add new entries to this table unless you have read
1595 * Documentation/sysctl/ctl_unnumbered.txt 1413 * Documentation/sysctl/ctl_unnumbered.txt
1596 */ 1414 */
1597 { .ctl_name = 0 } 1415 { }
1598}; 1416};
1599 1417
1600static struct ctl_table debug_table[] = { 1418static struct ctl_table debug_table[] = {
1601#if defined(CONFIG_X86) || defined(CONFIG_PPC) 1419#if defined(CONFIG_X86) || defined(CONFIG_PPC)
1602 { 1420 {
1603 .ctl_name = CTL_UNNUMBERED,
1604 .procname = "exception-trace", 1421 .procname = "exception-trace",
1605 .data = &show_unhandled_signals, 1422 .data = &show_unhandled_signals,
1606 .maxlen = sizeof(int), 1423 .maxlen = sizeof(int),
@@ -1608,11 +1425,11 @@ static struct ctl_table debug_table[] = {
1608 .proc_handler = proc_dointvec 1425 .proc_handler = proc_dointvec
1609 }, 1426 },
1610#endif 1427#endif
1611 { .ctl_name = 0 } 1428 { }
1612}; 1429};
1613 1430
1614static struct ctl_table dev_table[] = { 1431static struct ctl_table dev_table[] = {
1615 { .ctl_name = 0 } 1432 { }
1616}; 1433};
1617 1434
1618static DEFINE_SPINLOCK(sysctl_lock); 1435static DEFINE_SPINLOCK(sysctl_lock);
@@ -1766,122 +1583,6 @@ void register_sysctl_root(struct ctl_table_root *root)
1766 spin_unlock(&sysctl_lock); 1583 spin_unlock(&sysctl_lock);
1767} 1584}
1768 1585
1769#ifdef CONFIG_SYSCTL_SYSCALL
1770/* Perform the actual read/write of a sysctl table entry. */
1771static int do_sysctl_strategy(struct ctl_table_root *root,
1772 struct ctl_table *table,
1773 void __user *oldval, size_t __user *oldlenp,
1774 void __user *newval, size_t newlen)
1775{
1776 int op = 0, rc;
1777
1778 if (oldval)
1779 op |= MAY_READ;
1780 if (newval)
1781 op |= MAY_WRITE;
1782 if (sysctl_perm(root, table, op))
1783 return -EPERM;
1784
1785 if (table->strategy) {
1786 rc = table->strategy(table, oldval, oldlenp, newval, newlen);
1787 if (rc < 0)
1788 return rc;
1789 if (rc > 0)
1790 return 0;
1791 }
1792
1793 /* If there is no strategy routine, or if the strategy returns
1794 * zero, proceed with automatic r/w */
1795 if (table->data && table->maxlen) {
1796 rc = sysctl_data(table, oldval, oldlenp, newval, newlen);
1797 if (rc < 0)
1798 return rc;
1799 }
1800 return 0;
1801}
1802
1803static int parse_table(int __user *name, int nlen,
1804 void __user *oldval, size_t __user *oldlenp,
1805 void __user *newval, size_t newlen,
1806 struct ctl_table_root *root,
1807 struct ctl_table *table)
1808{
1809 int n;
1810repeat:
1811 if (!nlen)
1812 return -ENOTDIR;
1813 if (get_user(n, name))
1814 return -EFAULT;
1815 for ( ; table->ctl_name || table->procname; table++) {
1816 if (!table->ctl_name)
1817 continue;
1818 if (n == table->ctl_name) {
1819 int error;
1820 if (table->child) {
1821 if (sysctl_perm(root, table, MAY_EXEC))
1822 return -EPERM;
1823 name++;
1824 nlen--;
1825 table = table->child;
1826 goto repeat;
1827 }
1828 error = do_sysctl_strategy(root, table,
1829 oldval, oldlenp,
1830 newval, newlen);
1831 return error;
1832 }
1833 }
1834 return -ENOTDIR;
1835}
1836
1837int do_sysctl(int __user *name, int nlen, void __user *oldval, size_t __user *oldlenp,
1838 void __user *newval, size_t newlen)
1839{
1840 struct ctl_table_header *head;
1841 int error = -ENOTDIR;
1842
1843 if (nlen <= 0 || nlen >= CTL_MAXNAME)
1844 return -ENOTDIR;
1845 if (oldval) {
1846 int old_len;
1847 if (!oldlenp || get_user(old_len, oldlenp))
1848 return -EFAULT;
1849 }
1850
1851 for (head = sysctl_head_next(NULL); head;
1852 head = sysctl_head_next(head)) {
1853 error = parse_table(name, nlen, oldval, oldlenp,
1854 newval, newlen,
1855 head->root, head->ctl_table);
1856 if (error != -ENOTDIR) {
1857 sysctl_head_finish(head);
1858 break;
1859 }
1860 }
1861 return error;
1862}
1863
1864SYSCALL_DEFINE1(sysctl, struct __sysctl_args __user *, args)
1865{
1866 struct __sysctl_args tmp;
1867 int error;
1868
1869 if (copy_from_user(&tmp, args, sizeof(tmp)))
1870 return -EFAULT;
1871
1872 error = deprecated_sysctl_warning(&tmp);
1873 if (error)
1874 goto out;
1875
1876 lock_kernel();
1877 error = do_sysctl(tmp.name, tmp.nlen, tmp.oldval, tmp.oldlenp,
1878 tmp.newval, tmp.newlen);
1879 unlock_kernel();
1880out:
1881 return error;
1882}
1883#endif /* CONFIG_SYSCTL_SYSCALL */
1884
1885/* 1586/*
1886 * sysctl_perm does NOT grant the superuser all rights automatically, because 1587 * sysctl_perm does NOT grant the superuser all rights automatically, because
1887 * some sysctl variables are readonly even to root. 1588 * some sysctl variables are readonly even to root.
@@ -1917,7 +1618,7 @@ int sysctl_perm(struct ctl_table_root *root, struct ctl_table *table, int op)
1917 1618
1918static void sysctl_set_parent(struct ctl_table *parent, struct ctl_table *table) 1619static void sysctl_set_parent(struct ctl_table *parent, struct ctl_table *table)
1919{ 1620{
1920 for (; table->ctl_name || table->procname; table++) { 1621 for (; table->procname; table++) {
1921 table->parent = parent; 1622 table->parent = parent;
1922 if (table->child) 1623 if (table->child)
1923 sysctl_set_parent(table, table->child); 1624 sysctl_set_parent(table, table->child);
@@ -1949,11 +1650,11 @@ static struct ctl_table *is_branch_in(struct ctl_table *branch,
1949 return NULL; 1650 return NULL;
1950 1651
1951 /* ... and nothing else */ 1652 /* ... and nothing else */
1952 if (branch[1].procname || branch[1].ctl_name) 1653 if (branch[1].procname)
1953 return NULL; 1654 return NULL;
1954 1655
1955 /* table should contain subdirectory with the same name */ 1656 /* table should contain subdirectory with the same name */
1956 for (p = table; p->procname || p->ctl_name; p++) { 1657 for (p = table; p->procname; p++) {
1957 if (!p->child) 1658 if (!p->child)
1958 continue; 1659 continue;
1959 if (p->procname && strcmp(p->procname, s) == 0) 1660 if (p->procname && strcmp(p->procname, s) == 0)
@@ -1998,9 +1699,6 @@ static void try_attach(struct ctl_table_header *p, struct ctl_table_header *q)
1998 * 1699 *
1999 * The members of the &struct ctl_table structure are used as follows: 1700 * The members of the &struct ctl_table structure are used as follows:
2000 * 1701 *
2001 * ctl_name - This is the numeric sysctl value used by sysctl(2). The number
2002 * must be unique within that level of sysctl
2003 *
2004 * procname - the name of the sysctl file under /proc/sys. Set to %NULL to not 1702 * procname - the name of the sysctl file under /proc/sys. Set to %NULL to not
2005 * enter a sysctl file 1703 * enter a sysctl file
2006 * 1704 *
@@ -2015,8 +1713,6 @@ static void try_attach(struct ctl_table_header *p, struct ctl_table_header *q)
2015 * 1713 *
2016 * proc_handler - the text handler routine (described below) 1714 * proc_handler - the text handler routine (described below)
2017 * 1715 *
2018 * strategy - the strategy routine (described below)
2019 *
2020 * de - for internal use by the sysctl routines 1716 * de - for internal use by the sysctl routines
2021 * 1717 *
2022 * extra1, extra2 - extra pointers usable by the proc handler routines 1718 * extra1, extra2 - extra pointers usable by the proc handler routines
@@ -2029,19 +1725,6 @@ static void try_attach(struct ctl_table_header *p, struct ctl_table_header *q)
2029 * struct enable minimal validation of the values being written to be 1725 * struct enable minimal validation of the values being written to be
2030 * performed, and the mode field allows minimal authentication. 1726 * performed, and the mode field allows minimal authentication.
2031 * 1727 *
2032 * More sophisticated management can be enabled by the provision of a
2033 * strategy routine with the table entry. This will be called before
2034 * any automatic read or write of the data is performed.
2035 *
2036 * The strategy routine may return
2037 *
2038 * < 0 - Error occurred (error is passed to user process)
2039 *
2040 * 0 - OK - proceed with automatic read or write.
2041 *
2042 * > 0 - OK - read or write has been done by the strategy routine, so
2043 * return immediately.
2044 *
2045 * There must be a proc_handler routine for any terminal nodes 1728 * There must be a proc_handler routine for any terminal nodes
2046 * mirrored under /proc/sys (non-terminals are handled by a built-in 1729 * mirrored under /proc/sys (non-terminals are handled by a built-in
2047 * directory handler). Several default handlers are available to 1730 * directory handler). Several default handlers are available to
@@ -2068,13 +1751,13 @@ struct ctl_table_header *__register_sysctl_paths(
2068 struct ctl_table_set *set; 1751 struct ctl_table_set *set;
2069 1752
2070 /* Count the path components */ 1753 /* Count the path components */
2071 for (npath = 0; path[npath].ctl_name || path[npath].procname; ++npath) 1754 for (npath = 0; path[npath].procname; ++npath)
2072 ; 1755 ;
2073 1756
2074 /* 1757 /*
2075 * For each path component, allocate a 2-element ctl_table array. 1758 * For each path component, allocate a 2-element ctl_table array.
2076 * The first array element will be filled with the sysctl entry 1759 * The first array element will be filled with the sysctl entry
2077 * for this, the second will be the sentinel (ctl_name == 0). 1760 * for this, the second will be the sentinel (procname == 0).
2078 * 1761 *
2079 * We allocate everything in one go so that we don't have to 1762 * We allocate everything in one go so that we don't have to
2080 * worry about freeing additional memory in unregister_sysctl_table. 1763 * worry about freeing additional memory in unregister_sysctl_table.
@@ -2091,7 +1774,6 @@ struct ctl_table_header *__register_sysctl_paths(
2091 for (n = 0; n < npath; ++n, ++path) { 1774 for (n = 0; n < npath; ++n, ++path) {
2092 /* Copy the procname */ 1775 /* Copy the procname */
2093 new->procname = path->procname; 1776 new->procname = path->procname;
2094 new->ctl_name = path->ctl_name;
2095 new->mode = 0555; 1777 new->mode = 0555;
2096 1778
2097 *prevp = new; 1779 *prevp = new;
@@ -2953,286 +2635,6 @@ int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,
2953 2635
2954#endif /* CONFIG_PROC_FS */ 2636#endif /* CONFIG_PROC_FS */
2955 2637
2956
2957#ifdef CONFIG_SYSCTL_SYSCALL
2958/*
2959 * General sysctl support routines
2960 */
2961
2962/* The generic sysctl data routine (used if no strategy routine supplied) */
2963int sysctl_data(struct ctl_table *table,
2964 void __user *oldval, size_t __user *oldlenp,
2965 void __user *newval, size_t newlen)
2966{
2967 size_t len;
2968
2969 /* Get out of I don't have a variable */
2970 if (!table->data || !table->maxlen)
2971 return -ENOTDIR;
2972
2973 if (oldval && oldlenp) {
2974 if (get_user(len, oldlenp))
2975 return -EFAULT;
2976 if (len) {
2977 if (len > table->maxlen)
2978 len = table->maxlen;
2979 if (copy_to_user(oldval, table->data, len))
2980 return -EFAULT;
2981 if (put_user(len, oldlenp))
2982 return -EFAULT;
2983 }
2984 }
2985
2986 if (newval && newlen) {
2987 if (newlen > table->maxlen)
2988 newlen = table->maxlen;
2989
2990 if (copy_from_user(table->data, newval, newlen))
2991 return -EFAULT;
2992 }
2993 return 1;
2994}
2995
2996/* The generic string strategy routine: */
2997int sysctl_string(struct ctl_table *table,
2998 void __user *oldval, size_t __user *oldlenp,
2999 void __user *newval, size_t newlen)
3000{
3001 if (!table->data || !table->maxlen)
3002 return -ENOTDIR;
3003
3004 if (oldval && oldlenp) {
3005 size_t bufsize;
3006 if (get_user(bufsize, oldlenp))
3007 return -EFAULT;
3008 if (bufsize) {
3009 size_t len = strlen(table->data), copied;
3010
3011 /* This shouldn't trigger for a well-formed sysctl */
3012 if (len > table->maxlen)
3013 len = table->maxlen;
3014
3015 /* Copy up to a max of bufsize-1 bytes of the string */
3016 copied = (len >= bufsize) ? bufsize - 1 : len;
3017
3018 if (copy_to_user(oldval, table->data, copied) ||
3019 put_user(0, (char __user *)(oldval + copied)))
3020 return -EFAULT;
3021 if (put_user(len, oldlenp))
3022 return -EFAULT;
3023 }
3024 }
3025 if (newval && newlen) {
3026 size_t len = newlen;
3027 if (len > table->maxlen)
3028 len = table->maxlen;
3029 if(copy_from_user(table->data, newval, len))
3030 return -EFAULT;
3031 if (len == table->maxlen)
3032 len--;
3033 ((char *) table->data)[len] = 0;
3034 }
3035 return 1;
3036}
3037
3038/*
3039 * This function makes sure that all of the integers in the vector
3040 * are between the minimum and maximum values given in the arrays
3041 * table->extra1 and table->extra2, respectively.
3042 */
3043int sysctl_intvec(struct ctl_table *table,
3044 void __user *oldval, size_t __user *oldlenp,
3045 void __user *newval, size_t newlen)
3046{
3047
3048 if (newval && newlen) {
3049 int __user *vec = (int __user *) newval;
3050 int *min = (int *) table->extra1;
3051 int *max = (int *) table->extra2;
3052 size_t length;
3053 int i;
3054
3055 if (newlen % sizeof(int) != 0)
3056 return -EINVAL;
3057
3058 if (!table->extra1 && !table->extra2)
3059 return 0;
3060
3061 if (newlen > table->maxlen)
3062 newlen = table->maxlen;
3063 length = newlen / sizeof(int);
3064
3065 for (i = 0; i < length; i++) {
3066 int value;
3067 if (get_user(value, vec + i))
3068 return -EFAULT;
3069 if (min && value < min[i])
3070 return -EINVAL;
3071 if (max && value > max[i])
3072 return -EINVAL;
3073 }
3074 }
3075 return 0;
3076}
3077
3078/* Strategy function to convert jiffies to seconds */
3079int sysctl_jiffies(struct ctl_table *table,
3080 void __user *oldval, size_t __user *oldlenp,
3081 void __user *newval, size_t newlen)
3082{
3083 if (oldval && oldlenp) {
3084 size_t olen;
3085
3086 if (get_user(olen, oldlenp))
3087 return -EFAULT;
3088 if (olen) {
3089 int val;
3090
3091 if (olen < sizeof(int))
3092 return -EINVAL;
3093
3094 val = *(int *)(table->data) / HZ;
3095 if (put_user(val, (int __user *)oldval))
3096 return -EFAULT;
3097 if (put_user(sizeof(int), oldlenp))
3098 return -EFAULT;
3099 }
3100 }
3101 if (newval && newlen) {
3102 int new;
3103 if (newlen != sizeof(int))
3104 return -EINVAL;
3105 if (get_user(new, (int __user *)newval))
3106 return -EFAULT;
3107 *(int *)(table->data) = new*HZ;
3108 }
3109 return 1;
3110}
3111
3112/* Strategy function to convert jiffies to seconds */
3113int sysctl_ms_jiffies(struct ctl_table *table,
3114 void __user *oldval, size_t __user *oldlenp,
3115 void __user *newval, size_t newlen)
3116{
3117 if (oldval && oldlenp) {
3118 size_t olen;
3119
3120 if (get_user(olen, oldlenp))
3121 return -EFAULT;
3122 if (olen) {
3123 int val;
3124
3125 if (olen < sizeof(int))
3126 return -EINVAL;
3127
3128 val = jiffies_to_msecs(*(int *)(table->data));
3129 if (put_user(val, (int __user *)oldval))
3130 return -EFAULT;
3131 if (put_user(sizeof(int), oldlenp))
3132 return -EFAULT;
3133 }
3134 }
3135 if (newval && newlen) {
3136 int new;
3137 if (newlen != sizeof(int))
3138 return -EINVAL;
3139 if (get_user(new, (int __user *)newval))
3140 return -EFAULT;
3141 *(int *)(table->data) = msecs_to_jiffies(new);
3142 }
3143 return 1;
3144}
3145
3146
3147
3148#else /* CONFIG_SYSCTL_SYSCALL */
3149
3150
3151SYSCALL_DEFINE1(sysctl, struct __sysctl_args __user *, args)
3152{
3153 struct __sysctl_args tmp;
3154 int error;
3155
3156 if (copy_from_user(&tmp, args, sizeof(tmp)))
3157 return -EFAULT;
3158
3159 error = deprecated_sysctl_warning(&tmp);
3160
3161 /* If no error reading the parameters then just -ENOSYS ... */
3162 if (!error)
3163 error = -ENOSYS;
3164
3165 return error;
3166}
3167
3168int sysctl_data(struct ctl_table *table,
3169 void __user *oldval, size_t __user *oldlenp,
3170 void __user *newval, size_t newlen)
3171{
3172 return -ENOSYS;
3173}
3174
3175int sysctl_string(struct ctl_table *table,
3176 void __user *oldval, size_t __user *oldlenp,
3177 void __user *newval, size_t newlen)
3178{
3179 return -ENOSYS;
3180}
3181
3182int sysctl_intvec(struct ctl_table *table,
3183 void __user *oldval, size_t __user *oldlenp,
3184 void __user *newval, size_t newlen)
3185{
3186 return -ENOSYS;
3187}
3188
3189int sysctl_jiffies(struct ctl_table *table,
3190 void __user *oldval, size_t __user *oldlenp,
3191 void __user *newval, size_t newlen)
3192{
3193 return -ENOSYS;
3194}
3195
3196int sysctl_ms_jiffies(struct ctl_table *table,
3197 void __user *oldval, size_t __user *oldlenp,
3198 void __user *newval, size_t newlen)
3199{
3200 return -ENOSYS;
3201}
3202
3203#endif /* CONFIG_SYSCTL_SYSCALL */
3204
3205static int deprecated_sysctl_warning(struct __sysctl_args *args)
3206{
3207 static int msg_count;
3208 int name[CTL_MAXNAME];
3209 int i;
3210
3211 /* Check args->nlen. */
3212 if (args->nlen < 0 || args->nlen > CTL_MAXNAME)
3213 return -ENOTDIR;
3214
3215 /* Read in the sysctl name for better debug message logging */
3216 for (i = 0; i < args->nlen; i++)
3217 if (get_user(name[i], args->name + i))
3218 return -EFAULT;
3219
3220 /* Ignore accesses to kernel.version */
3221 if ((args->nlen == 2) && (name[0] == CTL_KERN) && (name[1] == KERN_VERSION))
3222 return 0;
3223
3224 if (msg_count < 5) {
3225 msg_count++;
3226 printk(KERN_INFO
3227 "warning: process `%s' used the deprecated sysctl "
3228 "system call with ", current->comm);
3229 for (i = 0; i < args->nlen; i++)
3230 printk("%d.", name[i]);
3231 printk("\n");
3232 }
3233 return 0;
3234}
3235
3236/* 2638/*
3237 * No sense putting this after each symbol definition, twice, 2639 * No sense putting this after each symbol definition, twice,
3238 * exception granted :-) 2640 * exception granted :-)
@@ -3247,9 +2649,4 @@ EXPORT_SYMBOL(proc_doulongvec_minmax);
3247EXPORT_SYMBOL(proc_doulongvec_ms_jiffies_minmax); 2649EXPORT_SYMBOL(proc_doulongvec_ms_jiffies_minmax);
3248EXPORT_SYMBOL(register_sysctl_table); 2650EXPORT_SYMBOL(register_sysctl_table);
3249EXPORT_SYMBOL(register_sysctl_paths); 2651EXPORT_SYMBOL(register_sysctl_paths);
3250EXPORT_SYMBOL(sysctl_intvec);
3251EXPORT_SYMBOL(sysctl_jiffies);
3252EXPORT_SYMBOL(sysctl_ms_jiffies);
3253EXPORT_SYMBOL(sysctl_string);
3254EXPORT_SYMBOL(sysctl_data);
3255EXPORT_SYMBOL(unregister_sysctl_table); 2652EXPORT_SYMBOL(unregister_sysctl_table);
diff --git a/kernel/sysctl_binary.c b/kernel/sysctl_binary.c
new file mode 100644
index 000000000000..b75dbf40f573
--- /dev/null
+++ b/kernel/sysctl_binary.c
@@ -0,0 +1,1507 @@
1#include <linux/stat.h>
2#include <linux/sysctl.h>
3#include "../fs/xfs/linux-2.6/xfs_sysctl.h"
4#include <linux/sunrpc/debug.h>
5#include <linux/string.h>
6#include <net/ip_vs.h>
7#include <linux/syscalls.h>
8#include <linux/namei.h>
9#include <linux/mount.h>
10#include <linux/fs.h>
11#include <linux/nsproxy.h>
12#include <linux/pid_namespace.h>
13#include <linux/file.h>
14#include <linux/ctype.h>
15#include <linux/netdevice.h>
16
17#ifdef CONFIG_SYSCTL_SYSCALL
18
19struct bin_table;
20typedef ssize_t bin_convert_t(struct file *file,
21 void __user *oldval, size_t oldlen, void __user *newval, size_t newlen);
22
23static bin_convert_t bin_dir;
24static bin_convert_t bin_string;
25static bin_convert_t bin_intvec;
26static bin_convert_t bin_ulongvec;
27static bin_convert_t bin_uuid;
28static bin_convert_t bin_dn_node_address;
29
30#define CTL_DIR bin_dir
31#define CTL_STR bin_string
32#define CTL_INT bin_intvec
33#define CTL_ULONG bin_ulongvec
34#define CTL_UUID bin_uuid
35#define CTL_DNADR bin_dn_node_address
36
37#define BUFSZ 256
38
39struct bin_table {
40 bin_convert_t *convert;
41 int ctl_name;
42 const char *procname;
43 const struct bin_table *child;
44};
45
46static const struct bin_table bin_random_table[] = {
47 { CTL_INT, RANDOM_POOLSIZE, "poolsize" },
48 { CTL_INT, RANDOM_ENTROPY_COUNT, "entropy_avail" },
49 { CTL_INT, RANDOM_READ_THRESH, "read_wakeup_threshold" },
50 { CTL_INT, RANDOM_WRITE_THRESH, "write_wakeup_threshold" },
51 { CTL_UUID, RANDOM_BOOT_ID, "boot_id" },
52 { CTL_UUID, RANDOM_UUID, "uuid" },
53 {}
54};
55
56static const struct bin_table bin_pty_table[] = {
57 { CTL_INT, PTY_MAX, "max" },
58 { CTL_INT, PTY_NR, "nr" },
59 {}
60};
61
62static const struct bin_table bin_kern_table[] = {
63 { CTL_STR, KERN_OSTYPE, "ostype" },
64 { CTL_STR, KERN_OSRELEASE, "osrelease" },
65 /* KERN_OSREV not used */
66 { CTL_STR, KERN_VERSION, "version" },
67 /* KERN_SECUREMASK not used */
68 /* KERN_PROF not used */
69 { CTL_STR, KERN_NODENAME, "hostname" },
70 { CTL_STR, KERN_DOMAINNAME, "domainname" },
71
72 { CTL_INT, KERN_PANIC, "panic" },
73 { CTL_INT, KERN_REALROOTDEV, "real-root-dev" },
74
75 { CTL_STR, KERN_SPARC_REBOOT, "reboot-cmd" },
76 { CTL_INT, KERN_CTLALTDEL, "ctrl-alt-del" },
77 { CTL_INT, KERN_PRINTK, "printk" },
78
79 /* KERN_NAMETRANS not used */
80 /* KERN_PPC_HTABRECLAIM not used */
81 /* KERN_PPC_ZEROPAGED not used */
82 { CTL_INT, KERN_PPC_POWERSAVE_NAP, "powersave-nap" },
83
84 { CTL_STR, KERN_MODPROBE, "modprobe" },
85 { CTL_INT, KERN_SG_BIG_BUFF, "sg-big-buff" },
86 { CTL_INT, KERN_ACCT, "acct" },
87 /* KERN_PPC_L2CR "l2cr" no longer used */
88
89 /* KERN_RTSIGNR not used */
90 /* KERN_RTSIGMAX not used */
91
92 { CTL_ULONG, KERN_SHMMAX, "shmmax" },
93 { CTL_INT, KERN_MSGMAX, "msgmax" },
94 { CTL_INT, KERN_MSGMNB, "msgmnb" },
95 /* KERN_MSGPOOL not used*/
96 { CTL_INT, KERN_SYSRQ, "sysrq" },
97 { CTL_INT, KERN_MAX_THREADS, "threads-max" },
98 { CTL_DIR, KERN_RANDOM, "random", bin_random_table },
99 { CTL_ULONG, KERN_SHMALL, "shmall" },
100 { CTL_INT, KERN_MSGMNI, "msgmni" },
101 { CTL_INT, KERN_SEM, "sem" },
102 { CTL_INT, KERN_SPARC_STOP_A, "stop-a" },
103 { CTL_INT, KERN_SHMMNI, "shmmni" },
104
105 { CTL_INT, KERN_OVERFLOWUID, "overflowuid" },
106 { CTL_INT, KERN_OVERFLOWGID, "overflowgid" },
107
108 { CTL_STR, KERN_HOTPLUG, "hotplug", },
109 { CTL_INT, KERN_IEEE_EMULATION_WARNINGS, "ieee_emulation_warnings" },
110
111 { CTL_INT, KERN_S390_USER_DEBUG_LOGGING, "userprocess_debug" },
112 { CTL_INT, KERN_CORE_USES_PID, "core_uses_pid" },
113 /* KERN_TAINTED "tainted" no longer used */
114 { CTL_INT, KERN_CADPID, "cad_pid" },
115 { CTL_INT, KERN_PIDMAX, "pid_max" },
116 { CTL_STR, KERN_CORE_PATTERN, "core_pattern" },
117 { CTL_INT, KERN_PANIC_ON_OOPS, "panic_on_oops" },
118 { CTL_INT, KERN_HPPA_PWRSW, "soft-power" },
119 { CTL_INT, KERN_HPPA_UNALIGNED, "unaligned-trap" },
120
121 { CTL_INT, KERN_PRINTK_RATELIMIT, "printk_ratelimit" },
122 { CTL_INT, KERN_PRINTK_RATELIMIT_BURST, "printk_ratelimit_burst" },
123
124 { CTL_DIR, KERN_PTY, "pty", bin_pty_table },
125 { CTL_INT, KERN_NGROUPS_MAX, "ngroups_max" },
126 { CTL_INT, KERN_SPARC_SCONS_PWROFF, "scons-poweroff" },
127 /* KERN_HZ_TIMER "hz_timer" no longer used */
128 { CTL_INT, KERN_UNKNOWN_NMI_PANIC, "unknown_nmi_panic" },
129 { CTL_INT, KERN_BOOTLOADER_TYPE, "bootloader_type" },
130 { CTL_INT, KERN_RANDOMIZE, "randomize_va_space" },
131
132 { CTL_INT, KERN_SPIN_RETRY, "spin_retry" },
133 /* KERN_ACPI_VIDEO_FLAGS "acpi_video_flags" no longer used */
134 { CTL_INT, KERN_IA64_UNALIGNED, "ignore-unaligned-usertrap" },
135 { CTL_INT, KERN_COMPAT_LOG, "compat-log" },
136 { CTL_INT, KERN_MAX_LOCK_DEPTH, "max_lock_depth" },
137 { CTL_INT, KERN_NMI_WATCHDOG, "nmi_watchdog" },
138 { CTL_INT, KERN_PANIC_ON_NMI, "panic_on_unrecovered_nmi" },
139 {}
140};
141
142static const struct bin_table bin_vm_table[] = {
143 { CTL_INT, VM_OVERCOMMIT_MEMORY, "overcommit_memory" },
144 { CTL_INT, VM_PAGE_CLUSTER, "page-cluster" },
145 { CTL_INT, VM_DIRTY_BACKGROUND, "dirty_background_ratio" },
146 { CTL_INT, VM_DIRTY_RATIO, "dirty_ratio" },
147 /* VM_DIRTY_WB_CS "dirty_writeback_centisecs" no longer used */
148 /* VM_DIRTY_EXPIRE_CS "dirty_expire_centisecs" no longer used */
149 { CTL_INT, VM_NR_PDFLUSH_THREADS, "nr_pdflush_threads" },
150 { CTL_INT, VM_OVERCOMMIT_RATIO, "overcommit_ratio" },
151 /* VM_PAGEBUF unused */
152 /* VM_HUGETLB_PAGES "nr_hugepages" no longer used */
153 { CTL_INT, VM_SWAPPINESS, "swappiness" },
154 { CTL_INT, VM_LOWMEM_RESERVE_RATIO, "lowmem_reserve_ratio" },
155 { CTL_INT, VM_MIN_FREE_KBYTES, "min_free_kbytes" },
156 { CTL_INT, VM_MAX_MAP_COUNT, "max_map_count" },
157 { CTL_INT, VM_LAPTOP_MODE, "laptop_mode" },
158 { CTL_INT, VM_BLOCK_DUMP, "block_dump" },
159 { CTL_INT, VM_HUGETLB_GROUP, "hugetlb_shm_group" },
160 { CTL_INT, VM_VFS_CACHE_PRESSURE, "vfs_cache_pressure" },
161 { CTL_INT, VM_LEGACY_VA_LAYOUT, "legacy_va_layout" },
162 /* VM_SWAP_TOKEN_TIMEOUT unused */
163 { CTL_INT, VM_DROP_PAGECACHE, "drop_caches" },
164 { CTL_INT, VM_PERCPU_PAGELIST_FRACTION, "percpu_pagelist_fraction" },
165 { CTL_INT, VM_ZONE_RECLAIM_MODE, "zone_reclaim_mode" },
166 { CTL_INT, VM_MIN_UNMAPPED, "min_unmapped_ratio" },
167 { CTL_INT, VM_PANIC_ON_OOM, "panic_on_oom" },
168 { CTL_INT, VM_VDSO_ENABLED, "vdso_enabled" },
169 { CTL_INT, VM_MIN_SLAB, "min_slab_ratio" },
170
171 {}
172};
173
174static const struct bin_table bin_net_core_table[] = {
175 { CTL_INT, NET_CORE_WMEM_MAX, "wmem_max" },
176 { CTL_INT, NET_CORE_RMEM_MAX, "rmem_max" },
177 { CTL_INT, NET_CORE_WMEM_DEFAULT, "wmem_default" },
178 { CTL_INT, NET_CORE_RMEM_DEFAULT, "rmem_default" },
179 /* NET_CORE_DESTROY_DELAY unused */
180 { CTL_INT, NET_CORE_MAX_BACKLOG, "netdev_max_backlog" },
181 /* NET_CORE_FASTROUTE unused */
182 { CTL_INT, NET_CORE_MSG_COST, "message_cost" },
183 { CTL_INT, NET_CORE_MSG_BURST, "message_burst" },
184 { CTL_INT, NET_CORE_OPTMEM_MAX, "optmem_max" },
185 /* NET_CORE_HOT_LIST_LENGTH unused */
186 /* NET_CORE_DIVERT_VERSION unused */
187 /* NET_CORE_NO_CONG_THRESH unused */
188 /* NET_CORE_NO_CONG unused */
189 /* NET_CORE_LO_CONG unused */
190 /* NET_CORE_MOD_CONG unused */
191 { CTL_INT, NET_CORE_DEV_WEIGHT, "dev_weight" },
192 { CTL_INT, NET_CORE_SOMAXCONN, "somaxconn" },
193 { CTL_INT, NET_CORE_BUDGET, "netdev_budget" },
194 { CTL_INT, NET_CORE_AEVENT_ETIME, "xfrm_aevent_etime" },
195 { CTL_INT, NET_CORE_AEVENT_RSEQTH, "xfrm_aevent_rseqth" },
196 { CTL_INT, NET_CORE_WARNINGS, "warnings" },
197 {},
198};
199
200static const struct bin_table bin_net_unix_table[] = {
201 /* NET_UNIX_DESTROY_DELAY unused */
202 /* NET_UNIX_DELETE_DELAY unused */
203 { CTL_INT, NET_UNIX_MAX_DGRAM_QLEN, "max_dgram_qlen" },
204 {}
205};
206
207static const struct bin_table bin_net_ipv4_route_table[] = {
208 { CTL_INT, NET_IPV4_ROUTE_FLUSH, "flush" },
209 /* NET_IPV4_ROUTE_MIN_DELAY "min_delay" no longer used */
210 /* NET_IPV4_ROUTE_MAX_DELAY "max_delay" no longer used */
211 { CTL_INT, NET_IPV4_ROUTE_GC_THRESH, "gc_thresh" },
212 { CTL_INT, NET_IPV4_ROUTE_MAX_SIZE, "max_size" },
213 { CTL_INT, NET_IPV4_ROUTE_GC_MIN_INTERVAL, "gc_min_interval" },
214 { CTL_INT, NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS, "gc_min_interval_ms" },
215 { CTL_INT, NET_IPV4_ROUTE_GC_TIMEOUT, "gc_timeout" },
216 { CTL_INT, NET_IPV4_ROUTE_GC_INTERVAL, "gc_interval" },
217 { CTL_INT, NET_IPV4_ROUTE_REDIRECT_LOAD, "redirect_load" },
218 { CTL_INT, NET_IPV4_ROUTE_REDIRECT_NUMBER, "redirect_number" },
219 { CTL_INT, NET_IPV4_ROUTE_REDIRECT_SILENCE, "redirect_silence" },
220 { CTL_INT, NET_IPV4_ROUTE_ERROR_COST, "error_cost" },
221 { CTL_INT, NET_IPV4_ROUTE_ERROR_BURST, "error_burst" },
222 { CTL_INT, NET_IPV4_ROUTE_GC_ELASTICITY, "gc_elasticity" },
223 { CTL_INT, NET_IPV4_ROUTE_MTU_EXPIRES, "mtu_expires" },
224 { CTL_INT, NET_IPV4_ROUTE_MIN_PMTU, "min_pmtu" },
225 { CTL_INT, NET_IPV4_ROUTE_MIN_ADVMSS, "min_adv_mss" },
226 { CTL_INT, NET_IPV4_ROUTE_SECRET_INTERVAL, "secret_interval" },
227 {}
228};
229
230static const struct bin_table bin_net_ipv4_conf_vars_table[] = {
231 { CTL_INT, NET_IPV4_CONF_FORWARDING, "forwarding" },
232 { CTL_INT, NET_IPV4_CONF_MC_FORWARDING, "mc_forwarding" },
233
234 { CTL_INT, NET_IPV4_CONF_ACCEPT_REDIRECTS, "accept_redirects" },
235 { CTL_INT, NET_IPV4_CONF_SECURE_REDIRECTS, "secure_redirects" },
236 { CTL_INT, NET_IPV4_CONF_SEND_REDIRECTS, "send_redirects" },
237 { CTL_INT, NET_IPV4_CONF_SHARED_MEDIA, "shared_media" },
238 { CTL_INT, NET_IPV4_CONF_RP_FILTER, "rp_filter" },
239 { CTL_INT, NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE, "accept_source_route" },
240 { CTL_INT, NET_IPV4_CONF_PROXY_ARP, "proxy_arp" },
241 { CTL_INT, NET_IPV4_CONF_MEDIUM_ID, "medium_id" },
242 { CTL_INT, NET_IPV4_CONF_BOOTP_RELAY, "bootp_relay" },
243 { CTL_INT, NET_IPV4_CONF_LOG_MARTIANS, "log_martians" },
244 { CTL_INT, NET_IPV4_CONF_TAG, "tag" },
245 { CTL_INT, NET_IPV4_CONF_ARPFILTER, "arp_filter" },
246 { CTL_INT, NET_IPV4_CONF_ARP_ANNOUNCE, "arp_announce" },
247 { CTL_INT, NET_IPV4_CONF_ARP_IGNORE, "arp_ignore" },
248 { CTL_INT, NET_IPV4_CONF_ARP_ACCEPT, "arp_accept" },
249 { CTL_INT, NET_IPV4_CONF_ARP_NOTIFY, "arp_notify" },
250
251 { CTL_INT, NET_IPV4_CONF_NOXFRM, "disable_xfrm" },
252 { CTL_INT, NET_IPV4_CONF_NOPOLICY, "disable_policy" },
253 { CTL_INT, NET_IPV4_CONF_FORCE_IGMP_VERSION, "force_igmp_version" },
254 { CTL_INT, NET_IPV4_CONF_PROMOTE_SECONDARIES, "promote_secondaries" },
255 {}
256};
257
258static const struct bin_table bin_net_ipv4_conf_table[] = {
259 { CTL_DIR, NET_PROTO_CONF_ALL, "all", bin_net_ipv4_conf_vars_table },
260 { CTL_DIR, NET_PROTO_CONF_DEFAULT, "default", bin_net_ipv4_conf_vars_table },
261 { CTL_DIR, 0, NULL, bin_net_ipv4_conf_vars_table },
262 {}
263};
264
265static const struct bin_table bin_net_neigh_vars_table[] = {
266 { CTL_INT, NET_NEIGH_MCAST_SOLICIT, "mcast_solicit" },
267 { CTL_INT, NET_NEIGH_UCAST_SOLICIT, "ucast_solicit" },
268 { CTL_INT, NET_NEIGH_APP_SOLICIT, "app_solicit" },
269 /* NET_NEIGH_RETRANS_TIME "retrans_time" no longer used */
270 { CTL_INT, NET_NEIGH_REACHABLE_TIME, "base_reachable_time" },
271 { CTL_INT, NET_NEIGH_DELAY_PROBE_TIME, "delay_first_probe_time" },
272 { CTL_INT, NET_NEIGH_GC_STALE_TIME, "gc_stale_time" },
273 { CTL_INT, NET_NEIGH_UNRES_QLEN, "unres_qlen" },
274 { CTL_INT, NET_NEIGH_PROXY_QLEN, "proxy_qlen" },
275 /* NET_NEIGH_ANYCAST_DELAY "anycast_delay" no longer used */
276 /* NET_NEIGH_PROXY_DELAY "proxy_delay" no longer used */
277 /* NET_NEIGH_LOCKTIME "locktime" no longer used */
278 { CTL_INT, NET_NEIGH_GC_INTERVAL, "gc_interval" },
279 { CTL_INT, NET_NEIGH_GC_THRESH1, "gc_thresh1" },
280 { CTL_INT, NET_NEIGH_GC_THRESH2, "gc_thresh2" },
281 { CTL_INT, NET_NEIGH_GC_THRESH3, "gc_thresh3" },
282 { CTL_INT, NET_NEIGH_RETRANS_TIME_MS, "retrans_time_ms" },
283 { CTL_INT, NET_NEIGH_REACHABLE_TIME_MS, "base_reachable_time_ms" },
284 {}
285};
286
287static const struct bin_table bin_net_neigh_table[] = {
288 { CTL_DIR, NET_PROTO_CONF_DEFAULT, "default", bin_net_neigh_vars_table },
289 { CTL_DIR, 0, NULL, bin_net_neigh_vars_table },
290 {}
291};
292
293static const struct bin_table bin_net_ipv4_netfilter_table[] = {
294 { CTL_INT, NET_IPV4_NF_CONNTRACK_MAX, "ip_conntrack_max" },
295
296 /* NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT "ip_conntrack_tcp_timeout_syn_sent" no longer used */
297 /* NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV "ip_conntrack_tcp_timeout_syn_recv" no longer used */
298 /* NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED "ip_conntrack_tcp_timeout_established" no longer used */
299 /* NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT "ip_conntrack_tcp_timeout_fin_wait" no longer used */
300 /* NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT "ip_conntrack_tcp_timeout_close_wait" no longer used */
301 /* NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK "ip_conntrack_tcp_timeout_last_ack" no longer used */
302 /* NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT "ip_conntrack_tcp_timeout_time_wait" no longer used */
303 /* NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE "ip_conntrack_tcp_timeout_close" no longer used */
304
305 /* NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT "ip_conntrack_udp_timeout" no longer used */
306 /* NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT_STREAM "ip_conntrack_udp_timeout_stream" no longer used */
307 /* NET_IPV4_NF_CONNTRACK_ICMP_TIMEOUT "ip_conntrack_icmp_timeout" no longer used */
308 /* NET_IPV4_NF_CONNTRACK_GENERIC_TIMEOUT "ip_conntrack_generic_timeout" no longer used */
309
310 { CTL_INT, NET_IPV4_NF_CONNTRACK_BUCKETS, "ip_conntrack_buckets" },
311 { CTL_INT, NET_IPV4_NF_CONNTRACK_LOG_INVALID, "ip_conntrack_log_invalid" },
312 /* NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS "ip_conntrack_tcp_timeout_max_retrans" no longer used */
313 { CTL_INT, NET_IPV4_NF_CONNTRACK_TCP_LOOSE, "ip_conntrack_tcp_loose" },
314 { CTL_INT, NET_IPV4_NF_CONNTRACK_TCP_BE_LIBERAL, "ip_conntrack_tcp_be_liberal" },
315 { CTL_INT, NET_IPV4_NF_CONNTRACK_TCP_MAX_RETRANS, "ip_conntrack_tcp_max_retrans" },
316
317 /* NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED "ip_conntrack_sctp_timeout_closed" no longer used */
318 /* NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT "ip_conntrack_sctp_timeout_cookie_wait" no longer used */
319 /* NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED "ip_conntrack_sctp_timeout_cookie_echoed" no longer used */
320 /* NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED "ip_conntrack_sctp_timeout_established" no longer used */
321 /* NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT "ip_conntrack_sctp_timeout_shutdown_sent" no longer used */
322 /* NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD "ip_conntrack_sctp_timeout_shutdown_recd" no longer used */
323 /* NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT "ip_conntrack_sctp_timeout_shutdown_ack_sent" no longer used */
324
325 { CTL_INT, NET_IPV4_NF_CONNTRACK_COUNT, "ip_conntrack_count" },
326 { CTL_INT, NET_IPV4_NF_CONNTRACK_CHECKSUM, "ip_conntrack_checksum" },
327 {}
328};
329
330static const struct bin_table bin_net_ipv4_table[] = {
331 {CTL_INT, NET_IPV4_FORWARD, "ip_forward" },
332
333 { CTL_DIR, NET_IPV4_CONF, "conf", bin_net_ipv4_conf_table },
334 { CTL_DIR, NET_IPV4_NEIGH, "neigh", bin_net_neigh_table },
335 { CTL_DIR, NET_IPV4_ROUTE, "route", bin_net_ipv4_route_table },
336 /* NET_IPV4_FIB_HASH unused */
337 { CTL_DIR, NET_IPV4_NETFILTER, "netfilter", bin_net_ipv4_netfilter_table },
338
339 { CTL_INT, NET_IPV4_TCP_TIMESTAMPS, "tcp_timestamps" },
340 { CTL_INT, NET_IPV4_TCP_WINDOW_SCALING, "tcp_window_scaling" },
341 { CTL_INT, NET_IPV4_TCP_SACK, "tcp_sack" },
342 { CTL_INT, NET_IPV4_TCP_RETRANS_COLLAPSE, "tcp_retrans_collapse" },
343 { CTL_INT, NET_IPV4_DEFAULT_TTL, "ip_default_ttl" },
344 /* NET_IPV4_AUTOCONFIG unused */
345 { CTL_INT, NET_IPV4_NO_PMTU_DISC, "ip_no_pmtu_disc" },
346 { CTL_INT, NET_IPV4_NONLOCAL_BIND, "ip_nonlocal_bind" },
347 { CTL_INT, NET_IPV4_TCP_SYN_RETRIES, "tcp_syn_retries" },
348 { CTL_INT, NET_TCP_SYNACK_RETRIES, "tcp_synack_retries" },
349 { CTL_INT, NET_TCP_MAX_ORPHANS, "tcp_max_orphans" },
350 { CTL_INT, NET_TCP_MAX_TW_BUCKETS, "tcp_max_tw_buckets" },
351 { CTL_INT, NET_IPV4_DYNADDR, "ip_dynaddr" },
352 { CTL_INT, NET_IPV4_TCP_KEEPALIVE_TIME, "tcp_keepalive_time" },
353 { CTL_INT, NET_IPV4_TCP_KEEPALIVE_PROBES, "tcp_keepalive_probes" },
354 { CTL_INT, NET_IPV4_TCP_KEEPALIVE_INTVL, "tcp_keepalive_intvl" },
355 { CTL_INT, NET_IPV4_TCP_RETRIES1, "tcp_retries1" },
356 { CTL_INT, NET_IPV4_TCP_RETRIES2, "tcp_retries2" },
357 { CTL_INT, NET_IPV4_TCP_FIN_TIMEOUT, "tcp_fin_timeout" },
358 { CTL_INT, NET_TCP_SYNCOOKIES, "tcp_syncookies" },
359 { CTL_INT, NET_TCP_TW_RECYCLE, "tcp_tw_recycle" },
360 { CTL_INT, NET_TCP_ABORT_ON_OVERFLOW, "tcp_abort_on_overflow" },
361 { CTL_INT, NET_TCP_STDURG, "tcp_stdurg" },
362 { CTL_INT, NET_TCP_RFC1337, "tcp_rfc1337" },
363 { CTL_INT, NET_TCP_MAX_SYN_BACKLOG, "tcp_max_syn_backlog" },
364 { CTL_INT, NET_IPV4_LOCAL_PORT_RANGE, "ip_local_port_range" },
365 { CTL_INT, NET_IPV4_IGMP_MAX_MEMBERSHIPS, "igmp_max_memberships" },
366 { CTL_INT, NET_IPV4_IGMP_MAX_MSF, "igmp_max_msf" },
367 { CTL_INT, NET_IPV4_INET_PEER_THRESHOLD, "inet_peer_threshold" },
368 { CTL_INT, NET_IPV4_INET_PEER_MINTTL, "inet_peer_minttl" },
369 { CTL_INT, NET_IPV4_INET_PEER_MAXTTL, "inet_peer_maxttl" },
370 { CTL_INT, NET_IPV4_INET_PEER_GC_MINTIME, "inet_peer_gc_mintime" },
371 { CTL_INT, NET_IPV4_INET_PEER_GC_MAXTIME, "inet_peer_gc_maxtime" },
372 { CTL_INT, NET_TCP_ORPHAN_RETRIES, "tcp_orphan_retries" },
373 { CTL_INT, NET_TCP_FACK, "tcp_fack" },
374 { CTL_INT, NET_TCP_REORDERING, "tcp_reordering" },
375 { CTL_INT, NET_TCP_ECN, "tcp_ecn" },
376 { CTL_INT, NET_TCP_DSACK, "tcp_dsack" },
377 { CTL_INT, NET_TCP_MEM, "tcp_mem" },
378 { CTL_INT, NET_TCP_WMEM, "tcp_wmem" },
379 { CTL_INT, NET_TCP_RMEM, "tcp_rmem" },
380 { CTL_INT, NET_TCP_APP_WIN, "tcp_app_win" },
381 { CTL_INT, NET_TCP_ADV_WIN_SCALE, "tcp_adv_win_scale" },
382 { CTL_INT, NET_TCP_TW_REUSE, "tcp_tw_reuse" },
383 { CTL_INT, NET_TCP_FRTO, "tcp_frto" },
384 { CTL_INT, NET_TCP_FRTO_RESPONSE, "tcp_frto_response" },
385 { CTL_INT, NET_TCP_LOW_LATENCY, "tcp_low_latency" },
386 { CTL_INT, NET_TCP_NO_METRICS_SAVE, "tcp_no_metrics_save" },
387 { CTL_INT, NET_TCP_MODERATE_RCVBUF, "tcp_moderate_rcvbuf" },
388 { CTL_INT, NET_TCP_TSO_WIN_DIVISOR, "tcp_tso_win_divisor" },
389 { CTL_STR, NET_TCP_CONG_CONTROL, "tcp_congestion_control" },
390 { CTL_INT, NET_TCP_ABC, "tcp_abc" },
391 { CTL_INT, NET_TCP_MTU_PROBING, "tcp_mtu_probing" },
392 { CTL_INT, NET_TCP_BASE_MSS, "tcp_base_mss" },
393 { CTL_INT, NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS, "tcp_workaround_signed_windows" },
394 { CTL_INT, NET_TCP_DMA_COPYBREAK, "tcp_dma_copybreak" },
395 { CTL_INT, NET_TCP_SLOW_START_AFTER_IDLE, "tcp_slow_start_after_idle" },
396 { CTL_INT, NET_CIPSOV4_CACHE_ENABLE, "cipso_cache_enable" },
397 { CTL_INT, NET_CIPSOV4_CACHE_BUCKET_SIZE, "cipso_cache_bucket_size" },
398 { CTL_INT, NET_CIPSOV4_RBM_OPTFMT, "cipso_rbm_optfmt" },
399 { CTL_INT, NET_CIPSOV4_RBM_STRICTVALID, "cipso_rbm_strictvalid" },
400 /* NET_TCP_AVAIL_CONG_CONTROL "tcp_available_congestion_control" no longer used */
401 { CTL_STR, NET_TCP_ALLOWED_CONG_CONTROL, "tcp_allowed_congestion_control" },
402 { CTL_INT, NET_TCP_MAX_SSTHRESH, "tcp_max_ssthresh" },
403
404 { CTL_INT, NET_IPV4_ICMP_ECHO_IGNORE_ALL, "icmp_echo_ignore_all" },
405 { CTL_INT, NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS, "icmp_echo_ignore_broadcasts" },
406 { CTL_INT, NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES, "icmp_ignore_bogus_error_responses" },
407 { CTL_INT, NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR, "icmp_errors_use_inbound_ifaddr" },
408 { CTL_INT, NET_IPV4_ICMP_RATELIMIT, "icmp_ratelimit" },
409 { CTL_INT, NET_IPV4_ICMP_RATEMASK, "icmp_ratemask" },
410
411 { CTL_INT, NET_IPV4_IPFRAG_HIGH_THRESH, "ipfrag_high_thresh" },
412 { CTL_INT, NET_IPV4_IPFRAG_LOW_THRESH, "ipfrag_low_thresh" },
413 { CTL_INT, NET_IPV4_IPFRAG_TIME, "ipfrag_time" },
414
415 { CTL_INT, NET_IPV4_IPFRAG_SECRET_INTERVAL, "ipfrag_secret_interval" },
416 /* NET_IPV4_IPFRAG_MAX_DIST "ipfrag_max_dist" no longer used */
417
418 { CTL_INT, 2088 /* NET_IPQ_QMAX */, "ip_queue_maxlen" },
419
420 /* NET_TCP_DEFAULT_WIN_SCALE unused */
421 /* NET_TCP_BIC_BETA unused */
422 /* NET_IPV4_TCP_MAX_KA_PROBES unused */
423 /* NET_IPV4_IP_MASQ_DEBUG unused */
424 /* NET_TCP_SYN_TAILDROP unused */
425 /* NET_IPV4_ICMP_SOURCEQUENCH_RATE unused */
426 /* NET_IPV4_ICMP_DESTUNREACH_RATE unused */
427 /* NET_IPV4_ICMP_TIMEEXCEED_RATE unused */
428 /* NET_IPV4_ICMP_PARAMPROB_RATE unused */
429 /* NET_IPV4_ICMP_ECHOREPLY_RATE unused */
430 /* NET_IPV4_ALWAYS_DEFRAG unused */
431 {}
432};
433
434static const struct bin_table bin_net_ipx_table[] = {
435 { CTL_INT, NET_IPX_PPROP_BROADCASTING, "ipx_pprop_broadcasting" },
436 /* NET_IPX_FORWARDING unused */
437 {}
438};
439
440static const struct bin_table bin_net_atalk_table[] = {
441 { CTL_INT, NET_ATALK_AARP_EXPIRY_TIME, "aarp-expiry-time" },
442 { CTL_INT, NET_ATALK_AARP_TICK_TIME, "aarp-tick-time" },
443 { CTL_INT, NET_ATALK_AARP_RETRANSMIT_LIMIT, "aarp-retransmit-limit" },
444 { CTL_INT, NET_ATALK_AARP_RESOLVE_TIME, "aarp-resolve-time" },
445 {},
446};
447
448static const struct bin_table bin_net_netrom_table[] = {
449 { CTL_INT, NET_NETROM_DEFAULT_PATH_QUALITY, "default_path_quality" },
450 { CTL_INT, NET_NETROM_OBSOLESCENCE_COUNT_INITIALISER, "obsolescence_count_initialiser" },
451 { CTL_INT, NET_NETROM_NETWORK_TTL_INITIALISER, "network_ttl_initialiser" },
452 { CTL_INT, NET_NETROM_TRANSPORT_TIMEOUT, "transport_timeout" },
453 { CTL_INT, NET_NETROM_TRANSPORT_MAXIMUM_TRIES, "transport_maximum_tries" },
454 { CTL_INT, NET_NETROM_TRANSPORT_ACKNOWLEDGE_DELAY, "transport_acknowledge_delay" },
455 { CTL_INT, NET_NETROM_TRANSPORT_BUSY_DELAY, "transport_busy_delay" },
456 { CTL_INT, NET_NETROM_TRANSPORT_REQUESTED_WINDOW_SIZE, "transport_requested_window_size" },
457 { CTL_INT, NET_NETROM_TRANSPORT_NO_ACTIVITY_TIMEOUT, "transport_no_activity_timeout" },
458 { CTL_INT, NET_NETROM_ROUTING_CONTROL, "routing_control" },
459 { CTL_INT, NET_NETROM_LINK_FAILS_COUNT, "link_fails_count" },
460 { CTL_INT, NET_NETROM_RESET, "reset" },
461 {}
462};
463
464static const struct bin_table bin_net_ax25_param_table[] = {
465 { CTL_INT, NET_AX25_IP_DEFAULT_MODE, "ip_default_mode" },
466 { CTL_INT, NET_AX25_DEFAULT_MODE, "ax25_default_mode" },
467 { CTL_INT, NET_AX25_BACKOFF_TYPE, "backoff_type" },
468 { CTL_INT, NET_AX25_CONNECT_MODE, "connect_mode" },
469 { CTL_INT, NET_AX25_STANDARD_WINDOW, "standard_window_size" },
470 { CTL_INT, NET_AX25_EXTENDED_WINDOW, "extended_window_size" },
471 { CTL_INT, NET_AX25_T1_TIMEOUT, "t1_timeout" },
472 { CTL_INT, NET_AX25_T2_TIMEOUT, "t2_timeout" },
473 { CTL_INT, NET_AX25_T3_TIMEOUT, "t3_timeout" },
474 { CTL_INT, NET_AX25_IDLE_TIMEOUT, "idle_timeout" },
475 { CTL_INT, NET_AX25_N2, "maximum_retry_count" },
476 { CTL_INT, NET_AX25_PACLEN, "maximum_packet_length" },
477 { CTL_INT, NET_AX25_PROTOCOL, "protocol" },
478 { CTL_INT, NET_AX25_DAMA_SLAVE_TIMEOUT, "dama_slave_timeout" },
479 {}
480};
481
482static const struct bin_table bin_net_ax25_table[] = {
483 { CTL_DIR, 0, NULL, bin_net_ax25_param_table },
484 {}
485};
486
487static const struct bin_table bin_net_rose_table[] = {
488 { CTL_INT, NET_ROSE_RESTART_REQUEST_TIMEOUT, "restart_request_timeout" },
489 { CTL_INT, NET_ROSE_CALL_REQUEST_TIMEOUT, "call_request_timeout" },
490 { CTL_INT, NET_ROSE_RESET_REQUEST_TIMEOUT, "reset_request_timeout" },
491 { CTL_INT, NET_ROSE_CLEAR_REQUEST_TIMEOUT, "clear_request_timeout" },
492 { CTL_INT, NET_ROSE_ACK_HOLD_BACK_TIMEOUT, "acknowledge_hold_back_timeout" },
493 { CTL_INT, NET_ROSE_ROUTING_CONTROL, "routing_control" },
494 { CTL_INT, NET_ROSE_LINK_FAIL_TIMEOUT, "link_fail_timeout" },
495 { CTL_INT, NET_ROSE_MAX_VCS, "maximum_virtual_circuits" },
496 { CTL_INT, NET_ROSE_WINDOW_SIZE, "window_size" },
497 { CTL_INT, NET_ROSE_NO_ACTIVITY_TIMEOUT, "no_activity_timeout" },
498 {}
499};
500
501static const struct bin_table bin_net_ipv6_conf_var_table[] = {
502 { CTL_INT, NET_IPV6_FORWARDING, "forwarding" },
503 { CTL_INT, NET_IPV6_HOP_LIMIT, "hop_limit" },
504 { CTL_INT, NET_IPV6_MTU, "mtu" },
505 { CTL_INT, NET_IPV6_ACCEPT_RA, "accept_ra" },
506 { CTL_INT, NET_IPV6_ACCEPT_REDIRECTS, "accept_redirects" },
507 { CTL_INT, NET_IPV6_AUTOCONF, "autoconf" },
508 { CTL_INT, NET_IPV6_DAD_TRANSMITS, "dad_transmits" },
509 { CTL_INT, NET_IPV6_RTR_SOLICITS, "router_solicitations" },
510 { CTL_INT, NET_IPV6_RTR_SOLICIT_INTERVAL, "router_solicitation_interval" },
511 { CTL_INT, NET_IPV6_RTR_SOLICIT_DELAY, "router_solicitation_delay" },
512 { CTL_INT, NET_IPV6_USE_TEMPADDR, "use_tempaddr" },
513 { CTL_INT, NET_IPV6_TEMP_VALID_LFT, "temp_valid_lft" },
514 { CTL_INT, NET_IPV6_TEMP_PREFERED_LFT, "temp_prefered_lft" },
515 { CTL_INT, NET_IPV6_REGEN_MAX_RETRY, "regen_max_retry" },
516 { CTL_INT, NET_IPV6_MAX_DESYNC_FACTOR, "max_desync_factor" },
517 { CTL_INT, NET_IPV6_MAX_ADDRESSES, "max_addresses" },
518 { CTL_INT, NET_IPV6_FORCE_MLD_VERSION, "force_mld_version" },
519 { CTL_INT, NET_IPV6_ACCEPT_RA_DEFRTR, "accept_ra_defrtr" },
520 { CTL_INT, NET_IPV6_ACCEPT_RA_PINFO, "accept_ra_pinfo" },
521 { CTL_INT, NET_IPV6_ACCEPT_RA_RTR_PREF, "accept_ra_rtr_pref" },
522 { CTL_INT, NET_IPV6_RTR_PROBE_INTERVAL, "router_probe_interval" },
523 { CTL_INT, NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN, "accept_ra_rt_info_max_plen" },
524 { CTL_INT, NET_IPV6_PROXY_NDP, "proxy_ndp" },
525 { CTL_INT, NET_IPV6_ACCEPT_SOURCE_ROUTE, "accept_source_route" },
526 {}
527};
528
529static const struct bin_table bin_net_ipv6_conf_table[] = {
530 { CTL_DIR, NET_PROTO_CONF_ALL, "all", bin_net_ipv6_conf_var_table },
531 { CTL_DIR, NET_PROTO_CONF_DEFAULT, "default", bin_net_ipv6_conf_var_table },
532 { CTL_DIR, 0, NULL, bin_net_ipv6_conf_var_table },
533 {}
534};
535
536static const struct bin_table bin_net_ipv6_route_table[] = {
537 /* NET_IPV6_ROUTE_FLUSH "flush" no longer used */
538 { CTL_INT, NET_IPV6_ROUTE_GC_THRESH, "gc_thresh" },
539 { CTL_INT, NET_IPV6_ROUTE_MAX_SIZE, "max_size" },
540 { CTL_INT, NET_IPV6_ROUTE_GC_MIN_INTERVAL, "gc_min_interval" },
541 { CTL_INT, NET_IPV6_ROUTE_GC_TIMEOUT, "gc_timeout" },
542 { CTL_INT, NET_IPV6_ROUTE_GC_INTERVAL, "gc_interval" },
543 { CTL_INT, NET_IPV6_ROUTE_GC_ELASTICITY, "gc_elasticity" },
544 { CTL_INT, NET_IPV6_ROUTE_MTU_EXPIRES, "mtu_expires" },
545 { CTL_INT, NET_IPV6_ROUTE_MIN_ADVMSS, "min_adv_mss" },
546 { CTL_INT, NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS, "gc_min_interval_ms" },
547 {}
548};
549
550static const struct bin_table bin_net_ipv6_icmp_table[] = {
551 { CTL_INT, NET_IPV6_ICMP_RATELIMIT, "ratelimit" },
552 {}
553};
554
555static const struct bin_table bin_net_ipv6_table[] = {
556 { CTL_DIR, NET_IPV6_CONF, "conf", bin_net_ipv6_conf_table },
557 { CTL_DIR, NET_IPV6_NEIGH, "neigh", bin_net_neigh_table },
558 { CTL_DIR, NET_IPV6_ROUTE, "route", bin_net_ipv6_route_table },
559 { CTL_DIR, NET_IPV6_ICMP, "icmp", bin_net_ipv6_icmp_table },
560 { CTL_INT, NET_IPV6_BINDV6ONLY, "bindv6only" },
561 { CTL_INT, NET_IPV6_IP6FRAG_HIGH_THRESH, "ip6frag_high_thresh" },
562 { CTL_INT, NET_IPV6_IP6FRAG_LOW_THRESH, "ip6frag_low_thresh" },
563 { CTL_INT, NET_IPV6_IP6FRAG_TIME, "ip6frag_time" },
564 { CTL_INT, NET_IPV6_IP6FRAG_SECRET_INTERVAL, "ip6frag_secret_interval" },
565 { CTL_INT, NET_IPV6_MLD_MAX_MSF, "mld_max_msf" },
566 { CTL_INT, 2088 /* IPQ_QMAX */, "ip6_queue_maxlen" },
567 {}
568};
569
570static const struct bin_table bin_net_x25_table[] = {
571 { CTL_INT, NET_X25_RESTART_REQUEST_TIMEOUT, "restart_request_timeout" },
572 { CTL_INT, NET_X25_CALL_REQUEST_TIMEOUT, "call_request_timeout" },
573 { CTL_INT, NET_X25_RESET_REQUEST_TIMEOUT, "reset_request_timeout" },
574 { CTL_INT, NET_X25_CLEAR_REQUEST_TIMEOUT, "clear_request_timeout" },
575 { CTL_INT, NET_X25_ACK_HOLD_BACK_TIMEOUT, "acknowledgement_hold_back_timeout" },
576 { CTL_INT, NET_X25_FORWARD, "x25_forward" },
577 {}
578};
579
580static const struct bin_table bin_net_tr_table[] = {
581 { CTL_INT, NET_TR_RIF_TIMEOUT, "rif_timeout" },
582 {}
583};
584
585
586static const struct bin_table bin_net_decnet_conf_vars[] = {
587 { CTL_INT, NET_DECNET_CONF_DEV_FORWARDING, "forwarding" },
588 { CTL_INT, NET_DECNET_CONF_DEV_PRIORITY, "priority" },
589 { CTL_INT, NET_DECNET_CONF_DEV_T2, "t2" },
590 { CTL_INT, NET_DECNET_CONF_DEV_T3, "t3" },
591 {}
592};
593
594static const struct bin_table bin_net_decnet_conf[] = {
595 { CTL_DIR, NET_DECNET_CONF_ETHER, "ethernet", bin_net_decnet_conf_vars },
596 { CTL_DIR, NET_DECNET_CONF_GRE, "ipgre", bin_net_decnet_conf_vars },
597 { CTL_DIR, NET_DECNET_CONF_X25, "x25", bin_net_decnet_conf_vars },
598 { CTL_DIR, NET_DECNET_CONF_PPP, "ppp", bin_net_decnet_conf_vars },
599 { CTL_DIR, NET_DECNET_CONF_DDCMP, "ddcmp", bin_net_decnet_conf_vars },
600 { CTL_DIR, NET_DECNET_CONF_LOOPBACK, "loopback", bin_net_decnet_conf_vars },
601 { CTL_DIR, 0, NULL, bin_net_decnet_conf_vars },
602 {}
603};
604
605static const struct bin_table bin_net_decnet_table[] = {
606 { CTL_DIR, NET_DECNET_CONF, "conf", bin_net_decnet_conf },
607 { CTL_DNADR, NET_DECNET_NODE_ADDRESS, "node_address" },
608 { CTL_STR, NET_DECNET_NODE_NAME, "node_name" },
609 { CTL_STR, NET_DECNET_DEFAULT_DEVICE, "default_device" },
610 { CTL_INT, NET_DECNET_TIME_WAIT, "time_wait" },
611 { CTL_INT, NET_DECNET_DN_COUNT, "dn_count" },
612 { CTL_INT, NET_DECNET_DI_COUNT, "di_count" },
613 { CTL_INT, NET_DECNET_DR_COUNT, "dr_count" },
614 { CTL_INT, NET_DECNET_DST_GC_INTERVAL, "dst_gc_interval" },
615 { CTL_INT, NET_DECNET_NO_FC_MAX_CWND, "no_fc_max_cwnd" },
616 { CTL_INT, NET_DECNET_MEM, "decnet_mem" },
617 { CTL_INT, NET_DECNET_RMEM, "decnet_rmem" },
618 { CTL_INT, NET_DECNET_WMEM, "decnet_wmem" },
619 { CTL_INT, NET_DECNET_DEBUG_LEVEL, "debug" },
620 {}
621};
622
623static const struct bin_table bin_net_sctp_table[] = {
624 { CTL_INT, NET_SCTP_RTO_INITIAL, "rto_initial" },
625 { CTL_INT, NET_SCTP_RTO_MIN, "rto_min" },
626 { CTL_INT, NET_SCTP_RTO_MAX, "rto_max" },
627 { CTL_INT, NET_SCTP_RTO_ALPHA, "rto_alpha_exp_divisor" },
628 { CTL_INT, NET_SCTP_RTO_BETA, "rto_beta_exp_divisor" },
629 { CTL_INT, NET_SCTP_VALID_COOKIE_LIFE, "valid_cookie_life" },
630 { CTL_INT, NET_SCTP_ASSOCIATION_MAX_RETRANS, "association_max_retrans" },
631 { CTL_INT, NET_SCTP_PATH_MAX_RETRANS, "path_max_retrans" },
632 { CTL_INT, NET_SCTP_MAX_INIT_RETRANSMITS, "max_init_retransmits" },
633 { CTL_INT, NET_SCTP_HB_INTERVAL, "hb_interval" },
634 { CTL_INT, NET_SCTP_PRESERVE_ENABLE, "cookie_preserve_enable" },
635 { CTL_INT, NET_SCTP_MAX_BURST, "max_burst" },
636 { CTL_INT, NET_SCTP_ADDIP_ENABLE, "addip_enable" },
637 { CTL_INT, NET_SCTP_PRSCTP_ENABLE, "prsctp_enable" },
638 { CTL_INT, NET_SCTP_SNDBUF_POLICY, "sndbuf_policy" },
639 { CTL_INT, NET_SCTP_SACK_TIMEOUT, "sack_timeout" },
640 { CTL_INT, NET_SCTP_RCVBUF_POLICY, "rcvbuf_policy" },
641 {}
642};
643
644static const struct bin_table bin_net_llc_llc2_timeout_table[] = {
645 { CTL_INT, NET_LLC2_ACK_TIMEOUT, "ack" },
646 { CTL_INT, NET_LLC2_P_TIMEOUT, "p" },
647 { CTL_INT, NET_LLC2_REJ_TIMEOUT, "rej" },
648 { CTL_INT, NET_LLC2_BUSY_TIMEOUT, "busy" },
649 {}
650};
651
652static const struct bin_table bin_net_llc_station_table[] = {
653 { CTL_INT, NET_LLC_STATION_ACK_TIMEOUT, "ack_timeout" },
654 {}
655};
656
657static const struct bin_table bin_net_llc_llc2_table[] = {
658 { CTL_DIR, NET_LLC2, "timeout", bin_net_llc_llc2_timeout_table },
659 {}
660};
661
662static const struct bin_table bin_net_llc_table[] = {
663 { CTL_DIR, NET_LLC2, "llc2", bin_net_llc_llc2_table },
664 { CTL_DIR, NET_LLC_STATION, "station", bin_net_llc_station_table },
665 {}
666};
667
668static const struct bin_table bin_net_netfilter_table[] = {
669 { CTL_INT, NET_NF_CONNTRACK_MAX, "nf_conntrack_max" },
670 /* NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT "nf_conntrack_tcp_timeout_syn_sent" no longer used */
671 /* NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV "nf_conntrack_tcp_timeout_syn_recv" no longer used */
672 /* NET_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED "nf_conntrack_tcp_timeout_established" no longer used */
673 /* NET_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT "nf_conntrack_tcp_timeout_fin_wait" no longer used */
674 /* NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT "nf_conntrack_tcp_timeout_close_wait" no longer used */
675 /* NET_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK "nf_conntrack_tcp_timeout_last_ack" no longer used */
676 /* NET_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT "nf_conntrack_tcp_timeout_time_wait" no longer used */
677 /* NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE "nf_conntrack_tcp_timeout_close" no longer used */
678 /* NET_NF_CONNTRACK_UDP_TIMEOUT "nf_conntrack_udp_timeout" no longer used */
679 /* NET_NF_CONNTRACK_UDP_TIMEOUT_STREAM "nf_conntrack_udp_timeout_stream" no longer used */
680 /* NET_NF_CONNTRACK_ICMP_TIMEOUT "nf_conntrack_icmp_timeout" no longer used */
681 /* NET_NF_CONNTRACK_GENERIC_TIMEOUT "nf_conntrack_generic_timeout" no longer used */
682 { CTL_INT, NET_NF_CONNTRACK_BUCKETS, "nf_conntrack_buckets" },
683 { CTL_INT, NET_NF_CONNTRACK_LOG_INVALID, "nf_conntrack_log_invalid" },
684 /* NET_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS "nf_conntrack_tcp_timeout_max_retrans" no longer used */
685 { CTL_INT, NET_NF_CONNTRACK_TCP_LOOSE, "nf_conntrack_tcp_loose" },
686 { CTL_INT, NET_NF_CONNTRACK_TCP_BE_LIBERAL, "nf_conntrack_tcp_be_liberal" },
687 { CTL_INT, NET_NF_CONNTRACK_TCP_MAX_RETRANS, "nf_conntrack_tcp_max_retrans" },
688 /* NET_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED "nf_conntrack_sctp_timeout_closed" no longer used */
689 /* NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT "nf_conntrack_sctp_timeout_cookie_wait" no longer used */
690 /* NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED "nf_conntrack_sctp_timeout_cookie_echoed" no longer used */
691 /* NET_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED "nf_conntrack_sctp_timeout_established" no longer used */
692 /* NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT "nf_conntrack_sctp_timeout_shutdown_sent" no longer used */
693 /* NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD "nf_conntrack_sctp_timeout_shutdown_recd" no longer used */
694 /* NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT "nf_conntrack_sctp_timeout_shutdown_ack_sent" no longer used */
695 { CTL_INT, NET_NF_CONNTRACK_COUNT, "nf_conntrack_count" },
696 /* NET_NF_CONNTRACK_ICMPV6_TIMEOUT "nf_conntrack_icmpv6_timeout" no longer used */
697 /* NET_NF_CONNTRACK_FRAG6_TIMEOUT "nf_conntrack_frag6_timeout" no longer used */
698 { CTL_INT, NET_NF_CONNTRACK_FRAG6_LOW_THRESH, "nf_conntrack_frag6_low_thresh" },
699 { CTL_INT, NET_NF_CONNTRACK_FRAG6_HIGH_THRESH, "nf_conntrack_frag6_high_thresh" },
700 { CTL_INT, NET_NF_CONNTRACK_CHECKSUM, "nf_conntrack_checksum" },
701
702 {}
703};
704
705static const struct bin_table bin_net_irda_table[] = {
706 { CTL_INT, NET_IRDA_DISCOVERY, "discovery" },
707 { CTL_STR, NET_IRDA_DEVNAME, "devname" },
708 { CTL_INT, NET_IRDA_DEBUG, "debug" },
709 { CTL_INT, NET_IRDA_FAST_POLL, "fast_poll_increase" },
710 { CTL_INT, NET_IRDA_DISCOVERY_SLOTS, "discovery_slots" },
711 { CTL_INT, NET_IRDA_DISCOVERY_TIMEOUT, "discovery_timeout" },
712 { CTL_INT, NET_IRDA_SLOT_TIMEOUT, "slot_timeout" },
713 { CTL_INT, NET_IRDA_MAX_BAUD_RATE, "max_baud_rate" },
714 { CTL_INT, NET_IRDA_MIN_TX_TURN_TIME, "min_tx_turn_time" },
715 { CTL_INT, NET_IRDA_MAX_TX_DATA_SIZE, "max_tx_data_size" },
716 { CTL_INT, NET_IRDA_MAX_TX_WINDOW, "max_tx_window" },
717 { CTL_INT, NET_IRDA_MAX_NOREPLY_TIME, "max_noreply_time" },
718 { CTL_INT, NET_IRDA_WARN_NOREPLY_TIME, "warn_noreply_time" },
719 { CTL_INT, NET_IRDA_LAP_KEEPALIVE_TIME, "lap_keepalive_time" },
720 {}
721};
722
723static const struct bin_table bin_net_table[] = {
724 { CTL_DIR, NET_CORE, "core", bin_net_core_table },
725 /* NET_ETHER not used */
726 /* NET_802 not used */
727 { CTL_DIR, NET_UNIX, "unix", bin_net_unix_table },
728 { CTL_DIR, NET_IPV4, "ipv4", bin_net_ipv4_table },
729 { CTL_DIR, NET_IPX, "ipx", bin_net_ipx_table },
730 { CTL_DIR, NET_ATALK, "appletalk", bin_net_atalk_table },
731 { CTL_DIR, NET_NETROM, "netrom", bin_net_netrom_table },
732 { CTL_DIR, NET_AX25, "ax25", bin_net_ax25_table },
733 /* NET_BRIDGE "bridge" no longer used */
734 { CTL_DIR, NET_ROSE, "rose", bin_net_rose_table },
735 { CTL_DIR, NET_IPV6, "ipv6", bin_net_ipv6_table },
736 { CTL_DIR, NET_X25, "x25", bin_net_x25_table },
737 { CTL_DIR, NET_TR, "token-ring", bin_net_tr_table },
738 { CTL_DIR, NET_DECNET, "decnet", bin_net_decnet_table },
739 /* NET_ECONET not used */
740 { CTL_DIR, NET_SCTP, "sctp", bin_net_sctp_table },
741 { CTL_DIR, NET_LLC, "llc", bin_net_llc_table },
742 { CTL_DIR, NET_NETFILTER, "netfilter", bin_net_netfilter_table },
743 /* NET_DCCP "dccp" no longer used */
744 { CTL_DIR, NET_IRDA, "irda", bin_net_irda_table },
745 { CTL_INT, 2089, "nf_conntrack_max" },
746 {}
747};
748
749static const struct bin_table bin_fs_quota_table[] = {
750 { CTL_INT, FS_DQ_LOOKUPS, "lookups" },
751 { CTL_INT, FS_DQ_DROPS, "drops" },
752 { CTL_INT, FS_DQ_READS, "reads" },
753 { CTL_INT, FS_DQ_WRITES, "writes" },
754 { CTL_INT, FS_DQ_CACHE_HITS, "cache_hits" },
755 { CTL_INT, FS_DQ_ALLOCATED, "allocated_dquots" },
756 { CTL_INT, FS_DQ_FREE, "free_dquots" },
757 { CTL_INT, FS_DQ_SYNCS, "syncs" },
758 { CTL_INT, FS_DQ_WARNINGS, "warnings" },
759 {}
760};
761
762static const struct bin_table bin_fs_xfs_table[] = {
763 { CTL_INT, XFS_SGID_INHERIT, "irix_sgid_inherit" },
764 { CTL_INT, XFS_SYMLINK_MODE, "irix_symlink_mode" },
765 { CTL_INT, XFS_PANIC_MASK, "panic_mask" },
766
767 { CTL_INT, XFS_ERRLEVEL, "error_level" },
768 { CTL_INT, XFS_SYNCD_TIMER, "xfssyncd_centisecs" },
769 { CTL_INT, XFS_INHERIT_SYNC, "inherit_sync" },
770 { CTL_INT, XFS_INHERIT_NODUMP, "inherit_nodump" },
771 { CTL_INT, XFS_INHERIT_NOATIME, "inherit_noatime" },
772 { CTL_INT, XFS_BUF_TIMER, "xfsbufd_centisecs" },
773 { CTL_INT, XFS_BUF_AGE, "age_buffer_centisecs" },
774 { CTL_INT, XFS_INHERIT_NOSYM, "inherit_nosymlinks" },
775 { CTL_INT, XFS_ROTORSTEP, "rotorstep" },
776 { CTL_INT, XFS_INHERIT_NODFRG, "inherit_nodefrag" },
777 { CTL_INT, XFS_FILESTREAM_TIMER, "filestream_centisecs" },
778 { CTL_INT, XFS_STATS_CLEAR, "stats_clear" },
779 {}
780};
781
782static const struct bin_table bin_fs_ocfs2_nm_table[] = {
783 { CTL_STR, 1, "hb_ctl_path" },
784 {}
785};
786
787static const struct bin_table bin_fs_ocfs2_table[] = {
788 { CTL_DIR, 1, "nm", bin_fs_ocfs2_nm_table },
789 {}
790};
791
792static const struct bin_table bin_inotify_table[] = {
793 { CTL_INT, INOTIFY_MAX_USER_INSTANCES, "max_user_instances" },
794 { CTL_INT, INOTIFY_MAX_USER_WATCHES, "max_user_watches" },
795 { CTL_INT, INOTIFY_MAX_QUEUED_EVENTS, "max_queued_events" },
796 {}
797};
798
799static const struct bin_table bin_fs_table[] = {
800 { CTL_INT, FS_NRINODE, "inode-nr" },
801 { CTL_INT, FS_STATINODE, "inode-state" },
802 /* FS_MAXINODE unused */
803 /* FS_NRDQUOT unused */
804 /* FS_MAXDQUOT unused */
805 /* FS_NRFILE "file-nr" no longer used */
806 { CTL_INT, FS_MAXFILE, "file-max" },
807 { CTL_INT, FS_DENTRY, "dentry-state" },
808 /* FS_NRSUPER unused */
809 /* FS_MAXUPSER unused */
810 { CTL_INT, FS_OVERFLOWUID, "overflowuid" },
811 { CTL_INT, FS_OVERFLOWGID, "overflowgid" },
812 { CTL_INT, FS_LEASES, "leases-enable" },
813 { CTL_INT, FS_DIR_NOTIFY, "dir-notify-enable" },
814 { CTL_INT, FS_LEASE_TIME, "lease-break-time" },
815 { CTL_DIR, FS_DQSTATS, "quota", bin_fs_quota_table },
816 { CTL_DIR, FS_XFS, "xfs", bin_fs_xfs_table },
817 { CTL_ULONG, FS_AIO_NR, "aio-nr" },
818 { CTL_ULONG, FS_AIO_MAX_NR, "aio-max-nr" },
819 { CTL_DIR, FS_INOTIFY, "inotify", bin_inotify_table },
820 { CTL_DIR, FS_OCFS2, "ocfs2", bin_fs_ocfs2_table },
821 { CTL_INT, KERN_SETUID_DUMPABLE, "suid_dumpable" },
822 {}
823};
824
825static const struct bin_table bin_ipmi_table[] = {
826 { CTL_INT, DEV_IPMI_POWEROFF_POWERCYCLE, "poweroff_powercycle" },
827 {}
828};
829
830static const struct bin_table bin_mac_hid_files[] = {
831 /* DEV_MAC_HID_KEYBOARD_SENDS_LINUX_KEYCODES unused */
832 /* DEV_MAC_HID_KEYBOARD_LOCK_KEYCODES unused */
833 { CTL_INT, DEV_MAC_HID_MOUSE_BUTTON_EMULATION, "mouse_button_emulation" },
834 { CTL_INT, DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE, "mouse_button2_keycode" },
835 { CTL_INT, DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE, "mouse_button3_keycode" },
836 /* DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES unused */
837 {}
838};
839
840static const struct bin_table bin_raid_table[] = {
841 { CTL_INT, DEV_RAID_SPEED_LIMIT_MIN, "speed_limit_min" },
842 { CTL_INT, DEV_RAID_SPEED_LIMIT_MAX, "speed_limit_max" },
843 {}
844};
845
846static const struct bin_table bin_scsi_table[] = {
847 { CTL_INT, DEV_SCSI_LOGGING_LEVEL, "logging_level" },
848 {}
849};
850
851static const struct bin_table bin_dev_table[] = {
852 /* DEV_CDROM "cdrom" no longer used */
853 /* DEV_HWMON unused */
854 /* DEV_PARPORT "parport" no longer used */
855 { CTL_DIR, DEV_RAID, "raid", bin_raid_table },
856 { CTL_DIR, DEV_MAC_HID, "mac_hid", bin_mac_hid_files },
857 { CTL_DIR, DEV_SCSI, "scsi", bin_scsi_table },
858 { CTL_DIR, DEV_IPMI, "ipmi", bin_ipmi_table },
859 {}
860};
861
862static const struct bin_table bin_bus_isa_table[] = {
863 { CTL_INT, BUS_ISA_MEM_BASE, "membase" },
864 { CTL_INT, BUS_ISA_PORT_BASE, "portbase" },
865 { CTL_INT, BUS_ISA_PORT_SHIFT, "portshift" },
866 {}
867};
868
869static const struct bin_table bin_bus_table[] = {
870 { CTL_DIR, CTL_BUS_ISA, "isa", bin_bus_isa_table },
871 {}
872};
873
874
875static const struct bin_table bin_s390dbf_table[] = {
876 { CTL_INT, 5678 /* CTL_S390DBF_STOPPABLE */, "debug_stoppable" },
877 { CTL_INT, 5679 /* CTL_S390DBF_ACTIVE */, "debug_active" },
878 {}
879};
880
881static const struct bin_table bin_sunrpc_table[] = {
882 /* CTL_RPCDEBUG "rpc_debug" no longer used */
883 /* CTL_NFSDEBUG "nfs_debug" no longer used */
884 /* CTL_NFSDDEBUG "nfsd_debug" no longer used */
885 /* CTL_NLMDEBUG "nlm_debug" no longer used */
886
887 { CTL_INT, CTL_SLOTTABLE_UDP, "udp_slot_table_entries" },
888 { CTL_INT, CTL_SLOTTABLE_TCP, "tcp_slot_table_entries" },
889 { CTL_INT, CTL_MIN_RESVPORT, "min_resvport" },
890 { CTL_INT, CTL_MAX_RESVPORT, "max_resvport" },
891 {}
892};
893
894static const struct bin_table bin_pm_table[] = {
895 /* frv specific */
896 /* 1 == CTL_PM_SUSPEND "suspend" no longer used" */
897 { CTL_INT, 2 /* CTL_PM_CMODE */, "cmode" },
898 { CTL_INT, 3 /* CTL_PM_P0 */, "p0" },
899 { CTL_INT, 4 /* CTL_PM_CM */, "cm" },
900 {}
901};
902
903static const struct bin_table bin_root_table[] = {
904 { CTL_DIR, CTL_KERN, "kernel", bin_kern_table },
905 { CTL_DIR, CTL_VM, "vm", bin_vm_table },
906 { CTL_DIR, CTL_NET, "net", bin_net_table },
907 /* CTL_PROC not used */
908 { CTL_DIR, CTL_FS, "fs", bin_fs_table },
909 /* CTL_DEBUG "debug" no longer used */
910 { CTL_DIR, CTL_DEV, "dev", bin_dev_table },
911 { CTL_DIR, CTL_BUS, "bus", bin_bus_table },
912 { CTL_DIR, CTL_ABI, "abi" },
913 /* CTL_CPU not used */
914 /* CTL_ARLAN "arlan" no longer used */
915 { CTL_DIR, CTL_S390DBF, "s390dbf", bin_s390dbf_table },
916 { CTL_DIR, CTL_SUNRPC, "sunrpc", bin_sunrpc_table },
917 { CTL_DIR, CTL_PM, "pm", bin_pm_table },
918 {}
919};
920
921static ssize_t bin_dir(struct file *file,
922 void __user *oldval, size_t oldlen, void __user *newval, size_t newlen)
923{
924 return -ENOTDIR;
925}
926
927
928static ssize_t bin_string(struct file *file,
929 void __user *oldval, size_t oldlen, void __user *newval, size_t newlen)
930{
931 ssize_t result, copied = 0;
932
933 if (oldval && oldlen) {
934 char __user *lastp;
935 loff_t pos = 0;
936 int ch;
937
938 result = vfs_read(file, oldval, oldlen, &pos);
939 if (result < 0)
940 goto out;
941
942 copied = result;
943 lastp = oldval + copied - 1;
944
945 result = -EFAULT;
946 if (get_user(ch, lastp))
947 goto out;
948
949 /* Trim off the trailing newline */
950 if (ch == '\n') {
951 result = -EFAULT;
952 if (put_user('\0', lastp))
953 goto out;
954 copied -= 1;
955 }
956 }
957
958 if (newval && newlen) {
959 loff_t pos = 0;
960
961 result = vfs_write(file, newval, newlen, &pos);
962 if (result < 0)
963 goto out;
964 }
965
966 result = copied;
967out:
968 return result;
969}
970
971static ssize_t bin_intvec(struct file *file,
972 void __user *oldval, size_t oldlen, void __user *newval, size_t newlen)
973{
974 mm_segment_t old_fs = get_fs();
975 ssize_t copied = 0;
976 char *buffer;
977 ssize_t result;
978
979 result = -ENOMEM;
980 buffer = kmalloc(BUFSZ, GFP_KERNEL);
981 if (!buffer)
982 goto out;
983
984 if (oldval && oldlen) {
985 unsigned __user *vec = oldval;
986 size_t length = oldlen / sizeof(*vec);
987 loff_t pos = 0;
988 char *str, *end;
989 int i;
990
991 set_fs(KERNEL_DS);
992 result = vfs_read(file, buffer, BUFSZ - 1, &pos);
993 set_fs(old_fs);
994 if (result < 0)
995 goto out_kfree;
996
997 str = buffer;
998 end = str + result;
999 *end++ = '\0';
1000 for (i = 0; i < length; i++) {
1001 unsigned long value;
1002
1003 value = simple_strtoul(str, &str, 10);
1004 while (isspace(*str))
1005 str++;
1006
1007 result = -EFAULT;
1008 if (put_user(value, vec + i))
1009 goto out_kfree;
1010
1011 copied += sizeof(*vec);
1012 if (!isdigit(*str))
1013 break;
1014 }
1015 }
1016
1017 if (newval && newlen) {
1018 unsigned __user *vec = newval;
1019 size_t length = newlen / sizeof(*vec);
1020 loff_t pos = 0;
1021 char *str, *end;
1022 int i;
1023
1024 str = buffer;
1025 end = str + BUFSZ;
1026 for (i = 0; i < length; i++) {
1027 unsigned long value;
1028
1029 result = -EFAULT;
1030 if (get_user(value, vec + i))
1031 goto out_kfree;
1032
1033 str += snprintf(str, end - str, "%lu\t", value);
1034 }
1035
1036 set_fs(KERNEL_DS);
1037 result = vfs_write(file, buffer, str - buffer, &pos);
1038 set_fs(old_fs);
1039 if (result < 0)
1040 goto out_kfree;
1041 }
1042 result = copied;
1043out_kfree:
1044 kfree(buffer);
1045out:
1046 return result;
1047}
1048
1049static ssize_t bin_ulongvec(struct file *file,
1050 void __user *oldval, size_t oldlen, void __user *newval, size_t newlen)
1051{
1052 mm_segment_t old_fs = get_fs();
1053 ssize_t copied = 0;
1054 char *buffer;
1055 ssize_t result;
1056
1057 result = -ENOMEM;
1058 buffer = kmalloc(BUFSZ, GFP_KERNEL);
1059 if (!buffer)
1060 goto out;
1061
1062 if (oldval && oldlen) {
1063 unsigned long __user *vec = oldval;
1064 size_t length = oldlen / sizeof(*vec);
1065 loff_t pos = 0;
1066 char *str, *end;
1067 int i;
1068
1069 set_fs(KERNEL_DS);
1070 result = vfs_read(file, buffer, BUFSZ - 1, &pos);
1071 set_fs(old_fs);
1072 if (result < 0)
1073 goto out_kfree;
1074
1075 str = buffer;
1076 end = str + result;
1077 *end++ = '\0';
1078 for (i = 0; i < length; i++) {
1079 unsigned long value;
1080
1081 value = simple_strtoul(str, &str, 10);
1082 while (isspace(*str))
1083 str++;
1084
1085 result = -EFAULT;
1086 if (put_user(value, vec + i))
1087 goto out_kfree;
1088
1089 copied += sizeof(*vec);
1090 if (!isdigit(*str))
1091 break;
1092 }
1093 }
1094
1095 if (newval && newlen) {
1096 unsigned long __user *vec = newval;
1097 size_t length = newlen / sizeof(*vec);
1098 loff_t pos = 0;
1099 char *str, *end;
1100 int i;
1101
1102 str = buffer;
1103 end = str + BUFSZ;
1104 for (i = 0; i < length; i++) {
1105 unsigned long value;
1106
1107 result = -EFAULT;
1108 if (get_user(value, vec + i))
1109 goto out_kfree;
1110
1111 str += snprintf(str, end - str, "%lu\t", value);
1112 }
1113
1114 set_fs(KERNEL_DS);
1115 result = vfs_write(file, buffer, str - buffer, &pos);
1116 set_fs(old_fs);
1117 if (result < 0)
1118 goto out_kfree;
1119 }
1120 result = copied;
1121out_kfree:
1122 kfree(buffer);
1123out:
1124 return result;
1125}
1126
1127static unsigned hex_value(int ch)
1128{
1129 return isdigit(ch) ? ch - '0' : ((ch | 0x20) - 'a') + 10;
1130}
1131
1132static ssize_t bin_uuid(struct file *file,
1133 void __user *oldval, size_t oldlen, void __user *newval, size_t newlen)
1134{
1135 mm_segment_t old_fs = get_fs();
1136 ssize_t result, copied = 0;
1137
1138 /* Only supports reads */
1139 if (oldval && oldlen) {
1140 loff_t pos = 0;
1141 char buf[40], *str = buf;
1142 unsigned char uuid[16];
1143 int i;
1144
1145 set_fs(KERNEL_DS);
1146 result = vfs_read(file, buf, sizeof(buf) - 1, &pos);
1147 set_fs(old_fs);
1148 if (result < 0)
1149 goto out;
1150
1151 buf[result] = '\0';
1152
1153 /* Convert the uuid to from a string to binary */
1154 for (i = 0; i < 16; i++) {
1155 result = -EIO;
1156 if (!isxdigit(str[0]) || !isxdigit(str[1]))
1157 goto out;
1158
1159 uuid[i] = (hex_value(str[0]) << 4) | hex_value(str[1]);
1160 str += 2;
1161 if (*str == '-')
1162 str++;
1163 }
1164
1165 if (oldlen > 16)
1166 oldlen = 16;
1167
1168 result = -EFAULT;
1169 if (copy_to_user(oldval, uuid, oldlen))
1170 goto out;
1171
1172 copied = oldlen;
1173 }
1174 result = copied;
1175out:
1176 return result;
1177}
1178
1179static ssize_t bin_dn_node_address(struct file *file,
1180 void __user *oldval, size_t oldlen, void __user *newval, size_t newlen)
1181{
1182 mm_segment_t old_fs = get_fs();
1183 ssize_t result, copied = 0;
1184
1185 if (oldval && oldlen) {
1186 loff_t pos = 0;
1187 char buf[15], *nodep;
1188 unsigned long area, node;
1189 __le16 dnaddr;
1190
1191 set_fs(KERNEL_DS);
1192 result = vfs_read(file, buf, sizeof(buf) - 1, &pos);
1193 set_fs(old_fs);
1194 if (result < 0)
1195 goto out;
1196
1197 buf[result] = '\0';
1198
1199 /* Convert the decnet addresss to binary */
1200 result = -EIO;
1201 nodep = strchr(buf, '.') + 1;
1202 if (!nodep)
1203 goto out;
1204
1205 area = simple_strtoul(buf, NULL, 10);
1206 node = simple_strtoul(nodep, NULL, 10);
1207
1208 result = -EIO;
1209 if ((area > 63)||(node > 1023))
1210 goto out;
1211
1212 dnaddr = cpu_to_le16((area << 10) | node);
1213
1214 result = -EFAULT;
1215 if (put_user(dnaddr, (__le16 __user *)oldval))
1216 goto out;
1217
1218 copied = sizeof(dnaddr);
1219 }
1220
1221 if (newval && newlen) {
1222 loff_t pos = 0;
1223 __le16 dnaddr;
1224 char buf[15];
1225 int len;
1226
1227 result = -EINVAL;
1228 if (newlen != sizeof(dnaddr))
1229 goto out;
1230
1231 result = -EFAULT;
1232 if (get_user(dnaddr, (__le16 __user *)newval))
1233 goto out;
1234
1235 len = snprintf(buf, sizeof(buf), "%hu.%hu",
1236 le16_to_cpu(dnaddr) >> 10,
1237 le16_to_cpu(dnaddr) & 0x3ff);
1238
1239 set_fs(KERNEL_DS);
1240 result = vfs_write(file, buf, len, &pos);
1241 set_fs(old_fs);
1242 if (result < 0)
1243 goto out;
1244 }
1245
1246 result = copied;
1247out:
1248 return result;
1249}
1250
1251static const struct bin_table *get_sysctl(const int *name, int nlen, char *path)
1252{
1253 const struct bin_table *table = &bin_root_table[0];
1254 int ctl_name;
1255
1256 /* The binary sysctl tables have a small maximum depth so
1257 * there is no danger of overflowing our path as it PATH_MAX
1258 * bytes long.
1259 */
1260 memcpy(path, "sys/", 4);
1261 path += 4;
1262
1263repeat:
1264 if (!nlen)
1265 return ERR_PTR(-ENOTDIR);
1266 ctl_name = *name;
1267 name++;
1268 nlen--;
1269 for ( ; table->convert; table++) {
1270 int len = 0;
1271
1272 /*
1273 * For a wild card entry map from ifindex to network
1274 * device name.
1275 */
1276 if (!table->ctl_name) {
1277#ifdef CONFIG_NET
1278 struct net *net = current->nsproxy->net_ns;
1279 struct net_device *dev;
1280 dev = dev_get_by_index(net, ctl_name);
1281 if (dev) {
1282 len = strlen(dev->name);
1283 memcpy(path, dev->name, len);
1284 dev_put(dev);
1285 }
1286#endif
1287 /* Use the well known sysctl number to proc name mapping */
1288 } else if (ctl_name == table->ctl_name) {
1289 len = strlen(table->procname);
1290 memcpy(path, table->procname, len);
1291 }
1292 if (len) {
1293 path += len;
1294 if (table->child) {
1295 *path++ = '/';
1296 table = table->child;
1297 goto repeat;
1298 }
1299 *path = '\0';
1300 return table;
1301 }
1302 }
1303 return ERR_PTR(-ENOTDIR);
1304}
1305
1306static char *sysctl_getname(const int *name, int nlen, const struct bin_table **tablep)
1307{
1308 char *tmp, *result;
1309
1310 result = ERR_PTR(-ENOMEM);
1311 tmp = __getname();
1312 if (tmp) {
1313 const struct bin_table *table = get_sysctl(name, nlen, tmp);
1314 result = tmp;
1315 *tablep = table;
1316 if (IS_ERR(table)) {
1317 __putname(tmp);
1318 result = ERR_CAST(table);
1319 }
1320 }
1321 return result;
1322}
1323
1324static ssize_t binary_sysctl(const int *name, int nlen,
1325 void __user *oldval, size_t oldlen, void __user *newval, size_t newlen)
1326{
1327 const struct bin_table *table = NULL;
1328 struct nameidata nd;
1329 struct vfsmount *mnt;
1330 struct file *file;
1331 ssize_t result;
1332 char *pathname;
1333 int flags;
1334 int acc_mode, fmode;
1335
1336 pathname = sysctl_getname(name, nlen, &table);
1337 result = PTR_ERR(pathname);
1338 if (IS_ERR(pathname))
1339 goto out;
1340
1341 /* How should the sysctl be accessed? */
1342 if (oldval && oldlen && newval && newlen) {
1343 flags = O_RDWR;
1344 acc_mode = MAY_READ | MAY_WRITE;
1345 fmode = FMODE_READ | FMODE_WRITE;
1346 } else if (newval && newlen) {
1347 flags = O_WRONLY;
1348 acc_mode = MAY_WRITE;
1349 fmode = FMODE_WRITE;
1350 } else if (oldval && oldlen) {
1351 flags = O_RDONLY;
1352 acc_mode = MAY_READ;
1353 fmode = FMODE_READ;
1354 } else {
1355 result = 0;
1356 goto out_putname;
1357 }
1358
1359 mnt = current->nsproxy->pid_ns->proc_mnt;
1360 result = vfs_path_lookup(mnt->mnt_root, mnt, pathname, 0, &nd);
1361 if (result)
1362 goto out_putname;
1363
1364 result = may_open(&nd.path, acc_mode, fmode);
1365 if (result)
1366 goto out_putpath;
1367
1368 file = dentry_open(nd.path.dentry, nd.path.mnt, flags, current_cred());
1369 result = PTR_ERR(file);
1370 if (IS_ERR(file))
1371 goto out_putname;
1372
1373 result = table->convert(file, oldval, oldlen, newval, newlen);
1374
1375 fput(file);
1376out_putname:
1377 putname(pathname);
1378out:
1379 return result;
1380
1381out_putpath:
1382 path_put(&nd.path);
1383 goto out_putname;
1384}
1385
1386
1387#else /* CONFIG_SYSCTL_SYSCALL */
1388
1389static ssize_t binary_sysctl(const int *name, int nlen,
1390 void __user *oldval, size_t oldlen, void __user *newval, size_t newlen)
1391{
1392 return -ENOSYS;
1393}
1394
1395#endif /* CONFIG_SYSCTL_SYSCALL */
1396
1397
1398static void deprecated_sysctl_warning(const int *name, int nlen)
1399{
1400 int i;
1401
1402 if (printk_ratelimit()) {
1403 printk(KERN_INFO
1404 "warning: process `%s' used the deprecated sysctl "
1405 "system call with ", current->comm);
1406 for (i = 0; i < nlen; i++)
1407 printk("%d.", name[i]);
1408 printk("\n");
1409 }
1410 return;
1411}
1412
1413static ssize_t do_sysctl(int __user *args_name, int nlen,
1414 void __user *oldval, size_t oldlen, void __user *newval, size_t newlen)
1415{
1416 int name[CTL_MAXNAME];
1417 int i;
1418
1419 /* Check args->nlen. */
1420 if (nlen < 0 || nlen > CTL_MAXNAME)
1421 return -ENOTDIR;
1422 /* Read in the sysctl name for simplicity */
1423 for (i = 0; i < nlen; i++)
1424 if (get_user(name[i], args_name + i))
1425 return -EFAULT;
1426
1427 deprecated_sysctl_warning(name, nlen);
1428
1429 return binary_sysctl(name, nlen, oldval, oldlen, newval, newlen);
1430}
1431
1432SYSCALL_DEFINE1(sysctl, struct __sysctl_args __user *, args)
1433{
1434 struct __sysctl_args tmp;
1435 size_t oldlen = 0;
1436 ssize_t result;
1437
1438 if (copy_from_user(&tmp, args, sizeof(tmp)))
1439 return -EFAULT;
1440
1441 if (tmp.oldval && !tmp.oldlenp)
1442 return -EFAULT;
1443
1444 if (tmp.oldlenp && get_user(oldlen, tmp.oldlenp))
1445 return -EFAULT;
1446
1447 result = do_sysctl(tmp.name, tmp.nlen, tmp.oldval, oldlen,
1448 tmp.newval, tmp.newlen);
1449
1450 if (result >= 0) {
1451 oldlen = result;
1452 result = 0;
1453 }
1454
1455 if (tmp.oldlenp && put_user(oldlen, tmp.oldlenp))
1456 return -EFAULT;
1457
1458 return result;
1459}
1460
1461
1462#ifdef CONFIG_COMPAT
1463#include <asm/compat.h>
1464
1465struct compat_sysctl_args {
1466 compat_uptr_t name;
1467 int nlen;
1468 compat_uptr_t oldval;
1469 compat_uptr_t oldlenp;
1470 compat_uptr_t newval;
1471 compat_size_t newlen;
1472 compat_ulong_t __unused[4];
1473};
1474
1475asmlinkage long compat_sys_sysctl(struct compat_sysctl_args __user *args)
1476{
1477 struct compat_sysctl_args tmp;
1478 compat_size_t __user *compat_oldlenp;
1479 size_t oldlen = 0;
1480 ssize_t result;
1481
1482 if (copy_from_user(&tmp, args, sizeof(tmp)))
1483 return -EFAULT;
1484
1485 if (tmp.oldval && !tmp.oldlenp)
1486 return -EFAULT;
1487
1488 compat_oldlenp = compat_ptr(tmp.oldlenp);
1489 if (compat_oldlenp && get_user(oldlen, compat_oldlenp))
1490 return -EFAULT;
1491
1492 result = do_sysctl(compat_ptr(tmp.name), tmp.nlen,
1493 compat_ptr(tmp.oldval), oldlen,
1494 compat_ptr(tmp.newval), tmp.newlen);
1495
1496 if (result >= 0) {
1497 oldlen = result;
1498 result = 0;
1499 }
1500
1501 if (compat_oldlenp && put_user(oldlen, compat_oldlenp))
1502 return -EFAULT;
1503
1504 return result;
1505}
1506
1507#endif /* CONFIG_COMPAT */
diff --git a/kernel/sysctl_check.c b/kernel/sysctl_check.c
index b6e7aaea4604..04cdcf72c827 100644
--- a/kernel/sysctl_check.c
+++ b/kernel/sysctl_check.c
@@ -5,1239 +5,6 @@
5#include <linux/string.h> 5#include <linux/string.h>
6#include <net/ip_vs.h> 6#include <net/ip_vs.h>
7 7
8struct trans_ctl_table {
9 int ctl_name;
10 const char *procname;
11 const struct trans_ctl_table *child;
12};
13
14static const struct trans_ctl_table trans_random_table[] = {
15 { RANDOM_POOLSIZE, "poolsize" },
16 { RANDOM_ENTROPY_COUNT, "entropy_avail" },
17 { RANDOM_READ_THRESH, "read_wakeup_threshold" },
18 { RANDOM_WRITE_THRESH, "write_wakeup_threshold" },
19 { RANDOM_BOOT_ID, "boot_id" },
20 { RANDOM_UUID, "uuid" },
21 {}
22};
23
24static const struct trans_ctl_table trans_pty_table[] = {
25 { PTY_MAX, "max" },
26 { PTY_NR, "nr" },
27 {}
28};
29
30static const struct trans_ctl_table trans_kern_table[] = {
31 { KERN_OSTYPE, "ostype" },
32 { KERN_OSRELEASE, "osrelease" },
33 /* KERN_OSREV not used */
34 { KERN_VERSION, "version" },
35 /* KERN_SECUREMASK not used */
36 /* KERN_PROF not used */
37 { KERN_NODENAME, "hostname" },
38 { KERN_DOMAINNAME, "domainname" },
39
40 { KERN_PANIC, "panic" },
41 { KERN_REALROOTDEV, "real-root-dev" },
42
43 { KERN_SPARC_REBOOT, "reboot-cmd" },
44 { KERN_CTLALTDEL, "ctrl-alt-del" },
45 { KERN_PRINTK, "printk" },
46
47 /* KERN_NAMETRANS not used */
48 /* KERN_PPC_HTABRECLAIM not used */
49 /* KERN_PPC_ZEROPAGED not used */
50 { KERN_PPC_POWERSAVE_NAP, "powersave-nap" },
51
52 { KERN_MODPROBE, "modprobe" },
53 { KERN_SG_BIG_BUFF, "sg-big-buff" },
54 { KERN_ACCT, "acct" },
55 { KERN_PPC_L2CR, "l2cr" },
56
57 /* KERN_RTSIGNR not used */
58 /* KERN_RTSIGMAX not used */
59
60 { KERN_SHMMAX, "shmmax" },
61 { KERN_MSGMAX, "msgmax" },
62 { KERN_MSGMNB, "msgmnb" },
63 /* KERN_MSGPOOL not used*/
64 { KERN_SYSRQ, "sysrq" },
65 { KERN_MAX_THREADS, "threads-max" },
66 { KERN_RANDOM, "random", trans_random_table },
67 { KERN_SHMALL, "shmall" },
68 { KERN_MSGMNI, "msgmni" },
69 { KERN_SEM, "sem" },
70 { KERN_SPARC_STOP_A, "stop-a" },
71 { KERN_SHMMNI, "shmmni" },
72
73 { KERN_OVERFLOWUID, "overflowuid" },
74 { KERN_OVERFLOWGID, "overflowgid" },
75
76 { KERN_HOTPLUG, "hotplug", },
77 { KERN_IEEE_EMULATION_WARNINGS, "ieee_emulation_warnings" },
78
79 { KERN_S390_USER_DEBUG_LOGGING, "userprocess_debug" },
80 { KERN_CORE_USES_PID, "core_uses_pid" },
81 { KERN_TAINTED, "tainted" },
82 { KERN_CADPID, "cad_pid" },
83 { KERN_PIDMAX, "pid_max" },
84 { KERN_CORE_PATTERN, "core_pattern" },
85 { KERN_PANIC_ON_OOPS, "panic_on_oops" },
86 { KERN_HPPA_PWRSW, "soft-power" },
87 { KERN_HPPA_UNALIGNED, "unaligned-trap" },
88
89 { KERN_PRINTK_RATELIMIT, "printk_ratelimit" },
90 { KERN_PRINTK_RATELIMIT_BURST, "printk_ratelimit_burst" },
91
92 { KERN_PTY, "pty", trans_pty_table },
93 { KERN_NGROUPS_MAX, "ngroups_max" },
94 { KERN_SPARC_SCONS_PWROFF, "scons-poweroff" },
95 { KERN_HZ_TIMER, "hz_timer" },
96 { KERN_UNKNOWN_NMI_PANIC, "unknown_nmi_panic" },
97 { KERN_BOOTLOADER_TYPE, "bootloader_type" },
98 { KERN_RANDOMIZE, "randomize_va_space" },
99
100 { KERN_SPIN_RETRY, "spin_retry" },
101 { KERN_ACPI_VIDEO_FLAGS, "acpi_video_flags" },
102 { KERN_IA64_UNALIGNED, "ignore-unaligned-usertrap" },
103 { KERN_COMPAT_LOG, "compat-log" },
104 { KERN_MAX_LOCK_DEPTH, "max_lock_depth" },
105 { KERN_NMI_WATCHDOG, "nmi_watchdog" },
106 { KERN_PANIC_ON_NMI, "panic_on_unrecovered_nmi" },
107 {}
108};
109
110static const struct trans_ctl_table trans_vm_table[] = {
111 { VM_OVERCOMMIT_MEMORY, "overcommit_memory" },
112 { VM_PAGE_CLUSTER, "page-cluster" },
113 { VM_DIRTY_BACKGROUND, "dirty_background_ratio" },
114 { VM_DIRTY_RATIO, "dirty_ratio" },
115 { VM_DIRTY_WB_CS, "dirty_writeback_centisecs" },
116 { VM_DIRTY_EXPIRE_CS, "dirty_expire_centisecs" },
117 { VM_NR_PDFLUSH_THREADS, "nr_pdflush_threads" },
118 { VM_OVERCOMMIT_RATIO, "overcommit_ratio" },
119 /* VM_PAGEBUF unused */
120 { VM_HUGETLB_PAGES, "nr_hugepages" },
121 { VM_SWAPPINESS, "swappiness" },
122 { VM_LOWMEM_RESERVE_RATIO, "lowmem_reserve_ratio" },
123 { VM_MIN_FREE_KBYTES, "min_free_kbytes" },
124 { VM_MAX_MAP_COUNT, "max_map_count" },
125 { VM_LAPTOP_MODE, "laptop_mode" },
126 { VM_BLOCK_DUMP, "block_dump" },
127 { VM_HUGETLB_GROUP, "hugetlb_shm_group" },
128 { VM_VFS_CACHE_PRESSURE, "vfs_cache_pressure" },
129 { VM_LEGACY_VA_LAYOUT, "legacy_va_layout" },
130 /* VM_SWAP_TOKEN_TIMEOUT unused */
131 { VM_DROP_PAGECACHE, "drop_caches" },
132 { VM_PERCPU_PAGELIST_FRACTION, "percpu_pagelist_fraction" },
133 { VM_ZONE_RECLAIM_MODE, "zone_reclaim_mode" },
134 { VM_MIN_UNMAPPED, "min_unmapped_ratio" },
135 { VM_PANIC_ON_OOM, "panic_on_oom" },
136 { VM_VDSO_ENABLED, "vdso_enabled" },
137 { VM_MIN_SLAB, "min_slab_ratio" },
138
139 {}
140};
141
142static const struct trans_ctl_table trans_net_core_table[] = {
143 { NET_CORE_WMEM_MAX, "wmem_max" },
144 { NET_CORE_RMEM_MAX, "rmem_max" },
145 { NET_CORE_WMEM_DEFAULT, "wmem_default" },
146 { NET_CORE_RMEM_DEFAULT, "rmem_default" },
147 /* NET_CORE_DESTROY_DELAY unused */
148 { NET_CORE_MAX_BACKLOG, "netdev_max_backlog" },
149 /* NET_CORE_FASTROUTE unused */
150 { NET_CORE_MSG_COST, "message_cost" },
151 { NET_CORE_MSG_BURST, "message_burst" },
152 { NET_CORE_OPTMEM_MAX, "optmem_max" },
153 /* NET_CORE_HOT_LIST_LENGTH unused */
154 /* NET_CORE_DIVERT_VERSION unused */
155 /* NET_CORE_NO_CONG_THRESH unused */
156 /* NET_CORE_NO_CONG unused */
157 /* NET_CORE_LO_CONG unused */
158 /* NET_CORE_MOD_CONG unused */
159 { NET_CORE_DEV_WEIGHT, "dev_weight" },
160 { NET_CORE_SOMAXCONN, "somaxconn" },
161 { NET_CORE_BUDGET, "netdev_budget" },
162 { NET_CORE_AEVENT_ETIME, "xfrm_aevent_etime" },
163 { NET_CORE_AEVENT_RSEQTH, "xfrm_aevent_rseqth" },
164 { NET_CORE_WARNINGS, "warnings" },
165 {},
166};
167
168static const struct trans_ctl_table trans_net_unix_table[] = {
169 /* NET_UNIX_DESTROY_DELAY unused */
170 /* NET_UNIX_DELETE_DELAY unused */
171 { NET_UNIX_MAX_DGRAM_QLEN, "max_dgram_qlen" },
172 {}
173};
174
175static const struct trans_ctl_table trans_net_ipv4_route_table[] = {
176 { NET_IPV4_ROUTE_FLUSH, "flush" },
177 { NET_IPV4_ROUTE_MIN_DELAY, "min_delay" },
178 { NET_IPV4_ROUTE_MAX_DELAY, "max_delay" },
179 { NET_IPV4_ROUTE_GC_THRESH, "gc_thresh" },
180 { NET_IPV4_ROUTE_MAX_SIZE, "max_size" },
181 { NET_IPV4_ROUTE_GC_MIN_INTERVAL, "gc_min_interval" },
182 { NET_IPV4_ROUTE_GC_TIMEOUT, "gc_timeout" },
183 { NET_IPV4_ROUTE_GC_INTERVAL, "gc_interval" },
184 { NET_IPV4_ROUTE_REDIRECT_LOAD, "redirect_load" },
185 { NET_IPV4_ROUTE_REDIRECT_NUMBER, "redirect_number" },
186 { NET_IPV4_ROUTE_REDIRECT_SILENCE, "redirect_silence" },
187 { NET_IPV4_ROUTE_ERROR_COST, "error_cost" },
188 { NET_IPV4_ROUTE_ERROR_BURST, "error_burst" },
189 { NET_IPV4_ROUTE_GC_ELASTICITY, "gc_elasticity" },
190 { NET_IPV4_ROUTE_MTU_EXPIRES, "mtu_expires" },
191 { NET_IPV4_ROUTE_MIN_PMTU, "min_pmtu" },
192 { NET_IPV4_ROUTE_MIN_ADVMSS, "min_adv_mss" },
193 { NET_IPV4_ROUTE_SECRET_INTERVAL, "secret_interval" },
194 { NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS, "gc_min_interval_ms" },
195 {}
196};
197
198static const struct trans_ctl_table trans_net_ipv4_conf_vars_table[] = {
199 { NET_IPV4_CONF_FORWARDING, "forwarding" },
200 { NET_IPV4_CONF_MC_FORWARDING, "mc_forwarding" },
201
202 { NET_IPV4_CONF_PROXY_ARP, "proxy_arp" },
203 { NET_IPV4_CONF_ACCEPT_REDIRECTS, "accept_redirects" },
204 { NET_IPV4_CONF_SECURE_REDIRECTS, "secure_redirects" },
205 { NET_IPV4_CONF_SEND_REDIRECTS, "send_redirects" },
206 { NET_IPV4_CONF_SHARED_MEDIA, "shared_media" },
207 { NET_IPV4_CONF_RP_FILTER, "rp_filter" },
208 { NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE, "accept_source_route" },
209 { NET_IPV4_CONF_BOOTP_RELAY, "bootp_relay" },
210 { NET_IPV4_CONF_LOG_MARTIANS, "log_martians" },
211 { NET_IPV4_CONF_TAG, "tag" },
212 { NET_IPV4_CONF_ARPFILTER, "arp_filter" },
213 { NET_IPV4_CONF_MEDIUM_ID, "medium_id" },
214 { NET_IPV4_CONF_NOXFRM, "disable_xfrm" },
215 { NET_IPV4_CONF_NOPOLICY, "disable_policy" },
216 { NET_IPV4_CONF_FORCE_IGMP_VERSION, "force_igmp_version" },
217
218 { NET_IPV4_CONF_ARP_ANNOUNCE, "arp_announce" },
219 { NET_IPV4_CONF_ARP_IGNORE, "arp_ignore" },
220 { NET_IPV4_CONF_PROMOTE_SECONDARIES, "promote_secondaries" },
221 { NET_IPV4_CONF_ARP_ACCEPT, "arp_accept" },
222 { NET_IPV4_CONF_ARP_NOTIFY, "arp_notify" },
223 {}
224};
225
226static const struct trans_ctl_table trans_net_ipv4_conf_table[] = {
227 { NET_PROTO_CONF_ALL, "all", trans_net_ipv4_conf_vars_table },
228 { NET_PROTO_CONF_DEFAULT, "default", trans_net_ipv4_conf_vars_table },
229 { 0, NULL, trans_net_ipv4_conf_vars_table },
230 {}
231};
232
233static const struct trans_ctl_table trans_net_neigh_vars_table[] = {
234 { NET_NEIGH_MCAST_SOLICIT, "mcast_solicit" },
235 { NET_NEIGH_UCAST_SOLICIT, "ucast_solicit" },
236 { NET_NEIGH_APP_SOLICIT, "app_solicit" },
237 { NET_NEIGH_RETRANS_TIME, "retrans_time" },
238 { NET_NEIGH_REACHABLE_TIME, "base_reachable_time" },
239 { NET_NEIGH_DELAY_PROBE_TIME, "delay_first_probe_time" },
240 { NET_NEIGH_GC_STALE_TIME, "gc_stale_time" },
241 { NET_NEIGH_UNRES_QLEN, "unres_qlen" },
242 { NET_NEIGH_PROXY_QLEN, "proxy_qlen" },
243 { NET_NEIGH_ANYCAST_DELAY, "anycast_delay" },
244 { NET_NEIGH_PROXY_DELAY, "proxy_delay" },
245 { NET_NEIGH_LOCKTIME, "locktime" },
246 { NET_NEIGH_GC_INTERVAL, "gc_interval" },
247 { NET_NEIGH_GC_THRESH1, "gc_thresh1" },
248 { NET_NEIGH_GC_THRESH2, "gc_thresh2" },
249 { NET_NEIGH_GC_THRESH3, "gc_thresh3" },
250 { NET_NEIGH_RETRANS_TIME_MS, "retrans_time_ms" },
251 { NET_NEIGH_REACHABLE_TIME_MS, "base_reachable_time_ms" },
252 {}
253};
254
255static const struct trans_ctl_table trans_net_neigh_table[] = {
256 { NET_PROTO_CONF_DEFAULT, "default", trans_net_neigh_vars_table },
257 { 0, NULL, trans_net_neigh_vars_table },
258 {}
259};
260
261static const struct trans_ctl_table trans_net_ipv4_netfilter_table[] = {
262 { NET_IPV4_NF_CONNTRACK_MAX, "ip_conntrack_max" },
263
264 { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT, "ip_conntrack_tcp_timeout_syn_sent" },
265 { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV, "ip_conntrack_tcp_timeout_syn_recv" },
266 { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED, "ip_conntrack_tcp_timeout_established" },
267 { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT, "ip_conntrack_tcp_timeout_fin_wait" },
268 { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT, "ip_conntrack_tcp_timeout_close_wait" },
269 { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK, "ip_conntrack_tcp_timeout_last_ack" },
270 { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT, "ip_conntrack_tcp_timeout_time_wait" },
271 { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE, "ip_conntrack_tcp_timeout_close" },
272
273 { NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT, "ip_conntrack_udp_timeout" },
274 { NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT_STREAM, "ip_conntrack_udp_timeout_stream" },
275 { NET_IPV4_NF_CONNTRACK_ICMP_TIMEOUT, "ip_conntrack_icmp_timeout" },
276 { NET_IPV4_NF_CONNTRACK_GENERIC_TIMEOUT, "ip_conntrack_generic_timeout" },
277
278 { NET_IPV4_NF_CONNTRACK_BUCKETS, "ip_conntrack_buckets" },
279 { NET_IPV4_NF_CONNTRACK_LOG_INVALID, "ip_conntrack_log_invalid" },
280 { NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS, "ip_conntrack_tcp_timeout_max_retrans" },
281 { NET_IPV4_NF_CONNTRACK_TCP_LOOSE, "ip_conntrack_tcp_loose" },
282 { NET_IPV4_NF_CONNTRACK_TCP_BE_LIBERAL, "ip_conntrack_tcp_be_liberal" },
283 { NET_IPV4_NF_CONNTRACK_TCP_MAX_RETRANS, "ip_conntrack_tcp_max_retrans" },
284
285 { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED, "ip_conntrack_sctp_timeout_closed" },
286 { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT, "ip_conntrack_sctp_timeout_cookie_wait" },
287 { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED, "ip_conntrack_sctp_timeout_cookie_echoed" },
288 { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED, "ip_conntrack_sctp_timeout_established" },
289 { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT, "ip_conntrack_sctp_timeout_shutdown_sent" },
290 { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD, "ip_conntrack_sctp_timeout_shutdown_recd" },
291 { NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT, "ip_conntrack_sctp_timeout_shutdown_ack_sent" },
292
293 { NET_IPV4_NF_CONNTRACK_COUNT, "ip_conntrack_count" },
294 { NET_IPV4_NF_CONNTRACK_CHECKSUM, "ip_conntrack_checksum" },
295 {}
296};
297
298static const struct trans_ctl_table trans_net_ipv4_table[] = {
299 { NET_IPV4_FORWARD, "ip_forward" },
300 { NET_IPV4_DYNADDR, "ip_dynaddr" },
301
302 { NET_IPV4_CONF, "conf", trans_net_ipv4_conf_table },
303 { NET_IPV4_NEIGH, "neigh", trans_net_neigh_table },
304 { NET_IPV4_ROUTE, "route", trans_net_ipv4_route_table },
305 /* NET_IPV4_FIB_HASH unused */
306 { NET_IPV4_NETFILTER, "netfilter", trans_net_ipv4_netfilter_table },
307
308 { NET_IPV4_TCP_TIMESTAMPS, "tcp_timestamps" },
309 { NET_IPV4_TCP_WINDOW_SCALING, "tcp_window_scaling" },
310 { NET_IPV4_TCP_SACK, "tcp_sack" },
311 { NET_IPV4_TCP_RETRANS_COLLAPSE, "tcp_retrans_collapse" },
312 { NET_IPV4_DEFAULT_TTL, "ip_default_ttl" },
313 /* NET_IPV4_AUTOCONFIG unused */
314 { NET_IPV4_NO_PMTU_DISC, "ip_no_pmtu_disc" },
315 { NET_IPV4_TCP_SYN_RETRIES, "tcp_syn_retries" },
316 { NET_IPV4_IPFRAG_HIGH_THRESH, "ipfrag_high_thresh" },
317 { NET_IPV4_IPFRAG_LOW_THRESH, "ipfrag_low_thresh" },
318 { NET_IPV4_IPFRAG_TIME, "ipfrag_time" },
319 /* NET_IPV4_TCP_MAX_KA_PROBES unused */
320 { NET_IPV4_TCP_KEEPALIVE_TIME, "tcp_keepalive_time" },
321 { NET_IPV4_TCP_KEEPALIVE_PROBES, "tcp_keepalive_probes" },
322 { NET_IPV4_TCP_RETRIES1, "tcp_retries1" },
323 { NET_IPV4_TCP_RETRIES2, "tcp_retries2" },
324 { NET_IPV4_TCP_FIN_TIMEOUT, "tcp_fin_timeout" },
325 /* NET_IPV4_IP_MASQ_DEBUG unused */
326 { NET_TCP_SYNCOOKIES, "tcp_syncookies" },
327 { NET_TCP_STDURG, "tcp_stdurg" },
328 { NET_TCP_RFC1337, "tcp_rfc1337" },
329 /* NET_TCP_SYN_TAILDROP unused */
330 { NET_TCP_MAX_SYN_BACKLOG, "tcp_max_syn_backlog" },
331 { NET_IPV4_LOCAL_PORT_RANGE, "ip_local_port_range" },
332 { NET_IPV4_ICMP_ECHO_IGNORE_ALL, "icmp_echo_ignore_all" },
333 { NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS, "icmp_echo_ignore_broadcasts" },
334 /* NET_IPV4_ICMP_SOURCEQUENCH_RATE unused */
335 /* NET_IPV4_ICMP_DESTUNREACH_RATE unused */
336 /* NET_IPV4_ICMP_TIMEEXCEED_RATE unused */
337 /* NET_IPV4_ICMP_PARAMPROB_RATE unused */
338 /* NET_IPV4_ICMP_ECHOREPLY_RATE unused */
339 { NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES, "icmp_ignore_bogus_error_responses" },
340 { NET_IPV4_IGMP_MAX_MEMBERSHIPS, "igmp_max_memberships" },
341 { NET_TCP_TW_RECYCLE, "tcp_tw_recycle" },
342 /* NET_IPV4_ALWAYS_DEFRAG unused */
343 { NET_IPV4_TCP_KEEPALIVE_INTVL, "tcp_keepalive_intvl" },
344 { NET_IPV4_INET_PEER_THRESHOLD, "inet_peer_threshold" },
345 { NET_IPV4_INET_PEER_MINTTL, "inet_peer_minttl" },
346 { NET_IPV4_INET_PEER_MAXTTL, "inet_peer_maxttl" },
347 { NET_IPV4_INET_PEER_GC_MINTIME, "inet_peer_gc_mintime" },
348 { NET_IPV4_INET_PEER_GC_MAXTIME, "inet_peer_gc_maxtime" },
349 { NET_TCP_ORPHAN_RETRIES, "tcp_orphan_retries" },
350 { NET_TCP_ABORT_ON_OVERFLOW, "tcp_abort_on_overflow" },
351 { NET_TCP_SYNACK_RETRIES, "tcp_synack_retries" },
352 { NET_TCP_MAX_ORPHANS, "tcp_max_orphans" },
353 { NET_TCP_MAX_TW_BUCKETS, "tcp_max_tw_buckets" },
354 { NET_TCP_FACK, "tcp_fack" },
355 { NET_TCP_REORDERING, "tcp_reordering" },
356 { NET_TCP_ECN, "tcp_ecn" },
357 { NET_TCP_DSACK, "tcp_dsack" },
358 { NET_TCP_MEM, "tcp_mem" },
359 { NET_TCP_WMEM, "tcp_wmem" },
360 { NET_TCP_RMEM, "tcp_rmem" },
361 { NET_TCP_APP_WIN, "tcp_app_win" },
362 { NET_TCP_ADV_WIN_SCALE, "tcp_adv_win_scale" },
363 { NET_IPV4_NONLOCAL_BIND, "ip_nonlocal_bind" },
364 { NET_IPV4_ICMP_RATELIMIT, "icmp_ratelimit" },
365 { NET_IPV4_ICMP_RATEMASK, "icmp_ratemask" },
366 { NET_TCP_TW_REUSE, "tcp_tw_reuse" },
367 { NET_TCP_FRTO, "tcp_frto" },
368 { NET_TCP_LOW_LATENCY, "tcp_low_latency" },
369 { NET_IPV4_IPFRAG_SECRET_INTERVAL, "ipfrag_secret_interval" },
370 { NET_IPV4_IGMP_MAX_MSF, "igmp_max_msf" },
371 { NET_TCP_NO_METRICS_SAVE, "tcp_no_metrics_save" },
372 /* NET_TCP_DEFAULT_WIN_SCALE unused */
373 { NET_TCP_MODERATE_RCVBUF, "tcp_moderate_rcvbuf" },
374 { NET_TCP_TSO_WIN_DIVISOR, "tcp_tso_win_divisor" },
375 /* NET_TCP_BIC_BETA unused */
376 { NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR, "icmp_errors_use_inbound_ifaddr" },
377 { NET_TCP_CONG_CONTROL, "tcp_congestion_control" },
378 { NET_TCP_ABC, "tcp_abc" },
379 { NET_IPV4_IPFRAG_MAX_DIST, "ipfrag_max_dist" },
380 { NET_TCP_MTU_PROBING, "tcp_mtu_probing" },
381 { NET_TCP_BASE_MSS, "tcp_base_mss" },
382 { NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS, "tcp_workaround_signed_windows" },
383 { NET_TCP_DMA_COPYBREAK, "tcp_dma_copybreak" },
384 { NET_TCP_SLOW_START_AFTER_IDLE, "tcp_slow_start_after_idle" },
385 { NET_CIPSOV4_CACHE_ENABLE, "cipso_cache_enable" },
386 { NET_CIPSOV4_CACHE_BUCKET_SIZE, "cipso_cache_bucket_size" },
387 { NET_CIPSOV4_RBM_OPTFMT, "cipso_rbm_optfmt" },
388 { NET_CIPSOV4_RBM_STRICTVALID, "cipso_rbm_strictvalid" },
389 { NET_TCP_AVAIL_CONG_CONTROL, "tcp_available_congestion_control" },
390 { NET_TCP_ALLOWED_CONG_CONTROL, "tcp_allowed_congestion_control" },
391 { NET_TCP_MAX_SSTHRESH, "tcp_max_ssthresh" },
392 { NET_TCP_FRTO_RESPONSE, "tcp_frto_response" },
393 { 2088 /* NET_IPQ_QMAX */, "ip_queue_maxlen" },
394 {}
395};
396
397static const struct trans_ctl_table trans_net_ipx_table[] = {
398 { NET_IPX_PPROP_BROADCASTING, "ipx_pprop_broadcasting" },
399 /* NET_IPX_FORWARDING unused */
400 {}
401};
402
403static const struct trans_ctl_table trans_net_atalk_table[] = {
404 { NET_ATALK_AARP_EXPIRY_TIME, "aarp-expiry-time" },
405 { NET_ATALK_AARP_TICK_TIME, "aarp-tick-time" },
406 { NET_ATALK_AARP_RETRANSMIT_LIMIT, "aarp-retransmit-limit" },
407 { NET_ATALK_AARP_RESOLVE_TIME, "aarp-resolve-time" },
408 {},
409};
410
411static const struct trans_ctl_table trans_net_netrom_table[] = {
412 { NET_NETROM_DEFAULT_PATH_QUALITY, "default_path_quality" },
413 { NET_NETROM_OBSOLESCENCE_COUNT_INITIALISER, "obsolescence_count_initialiser" },
414 { NET_NETROM_NETWORK_TTL_INITIALISER, "network_ttl_initialiser" },
415 { NET_NETROM_TRANSPORT_TIMEOUT, "transport_timeout" },
416 { NET_NETROM_TRANSPORT_MAXIMUM_TRIES, "transport_maximum_tries" },
417 { NET_NETROM_TRANSPORT_ACKNOWLEDGE_DELAY, "transport_acknowledge_delay" },
418 { NET_NETROM_TRANSPORT_BUSY_DELAY, "transport_busy_delay" },
419 { NET_NETROM_TRANSPORT_REQUESTED_WINDOW_SIZE, "transport_requested_window_size" },
420 { NET_NETROM_TRANSPORT_NO_ACTIVITY_TIMEOUT, "transport_no_activity_timeout" },
421 { NET_NETROM_ROUTING_CONTROL, "routing_control" },
422 { NET_NETROM_LINK_FAILS_COUNT, "link_fails_count" },
423 { NET_NETROM_RESET, "reset" },
424 {}
425};
426
427static const struct trans_ctl_table trans_net_ax25_param_table[] = {
428 { NET_AX25_IP_DEFAULT_MODE, "ip_default_mode" },
429 { NET_AX25_DEFAULT_MODE, "ax25_default_mode" },
430 { NET_AX25_BACKOFF_TYPE, "backoff_type" },
431 { NET_AX25_CONNECT_MODE, "connect_mode" },
432 { NET_AX25_STANDARD_WINDOW, "standard_window_size" },
433 { NET_AX25_EXTENDED_WINDOW, "extended_window_size" },
434 { NET_AX25_T1_TIMEOUT, "t1_timeout" },
435 { NET_AX25_T2_TIMEOUT, "t2_timeout" },
436 { NET_AX25_T3_TIMEOUT, "t3_timeout" },
437 { NET_AX25_IDLE_TIMEOUT, "idle_timeout" },
438 { NET_AX25_N2, "maximum_retry_count" },
439 { NET_AX25_PACLEN, "maximum_packet_length" },
440 { NET_AX25_PROTOCOL, "protocol" },
441 { NET_AX25_DAMA_SLAVE_TIMEOUT, "dama_slave_timeout" },
442 {}
443};
444
445static const struct trans_ctl_table trans_net_ax25_table[] = {
446 { 0, NULL, trans_net_ax25_param_table },
447 {}
448};
449
450static const struct trans_ctl_table trans_net_bridge_table[] = {
451 { NET_BRIDGE_NF_CALL_ARPTABLES, "bridge-nf-call-arptables" },
452 { NET_BRIDGE_NF_CALL_IPTABLES, "bridge-nf-call-iptables" },
453 { NET_BRIDGE_NF_CALL_IP6TABLES, "bridge-nf-call-ip6tables" },
454 { NET_BRIDGE_NF_FILTER_VLAN_TAGGED, "bridge-nf-filter-vlan-tagged" },
455 { NET_BRIDGE_NF_FILTER_PPPOE_TAGGED, "bridge-nf-filter-pppoe-tagged" },
456 {}
457};
458
459static const struct trans_ctl_table trans_net_rose_table[] = {
460 { NET_ROSE_RESTART_REQUEST_TIMEOUT, "restart_request_timeout" },
461 { NET_ROSE_CALL_REQUEST_TIMEOUT, "call_request_timeout" },
462 { NET_ROSE_RESET_REQUEST_TIMEOUT, "reset_request_timeout" },
463 { NET_ROSE_CLEAR_REQUEST_TIMEOUT, "clear_request_timeout" },
464 { NET_ROSE_ACK_HOLD_BACK_TIMEOUT, "acknowledge_hold_back_timeout" },
465 { NET_ROSE_ROUTING_CONTROL, "routing_control" },
466 { NET_ROSE_LINK_FAIL_TIMEOUT, "link_fail_timeout" },
467 { NET_ROSE_MAX_VCS, "maximum_virtual_circuits" },
468 { NET_ROSE_WINDOW_SIZE, "window_size" },
469 { NET_ROSE_NO_ACTIVITY_TIMEOUT, "no_activity_timeout" },
470 {}
471};
472
473static const struct trans_ctl_table trans_net_ipv6_conf_var_table[] = {
474 { NET_IPV6_FORWARDING, "forwarding" },
475 { NET_IPV6_HOP_LIMIT, "hop_limit" },
476 { NET_IPV6_MTU, "mtu" },
477 { NET_IPV6_ACCEPT_RA, "accept_ra" },
478 { NET_IPV6_ACCEPT_REDIRECTS, "accept_redirects" },
479 { NET_IPV6_AUTOCONF, "autoconf" },
480 { NET_IPV6_DAD_TRANSMITS, "dad_transmits" },
481 { NET_IPV6_RTR_SOLICITS, "router_solicitations" },
482 { NET_IPV6_RTR_SOLICIT_INTERVAL, "router_solicitation_interval" },
483 { NET_IPV6_RTR_SOLICIT_DELAY, "router_solicitation_delay" },
484 { NET_IPV6_USE_TEMPADDR, "use_tempaddr" },
485 { NET_IPV6_TEMP_VALID_LFT, "temp_valid_lft" },
486 { NET_IPV6_TEMP_PREFERED_LFT, "temp_prefered_lft" },
487 { NET_IPV6_REGEN_MAX_RETRY, "regen_max_retry" },
488 { NET_IPV6_MAX_DESYNC_FACTOR, "max_desync_factor" },
489 { NET_IPV6_MAX_ADDRESSES, "max_addresses" },
490 { NET_IPV6_FORCE_MLD_VERSION, "force_mld_version" },
491 { NET_IPV6_ACCEPT_RA_DEFRTR, "accept_ra_defrtr" },
492 { NET_IPV6_ACCEPT_RA_PINFO, "accept_ra_pinfo" },
493 { NET_IPV6_ACCEPT_RA_RTR_PREF, "accept_ra_rtr_pref" },
494 { NET_IPV6_RTR_PROBE_INTERVAL, "router_probe_interval" },
495 { NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN, "accept_ra_rt_info_max_plen" },
496 { NET_IPV6_PROXY_NDP, "proxy_ndp" },
497 { NET_IPV6_ACCEPT_SOURCE_ROUTE, "accept_source_route" },
498 {}
499};
500
501static const struct trans_ctl_table trans_net_ipv6_conf_table[] = {
502 { NET_PROTO_CONF_ALL, "all", trans_net_ipv6_conf_var_table },
503 { NET_PROTO_CONF_DEFAULT, "default", trans_net_ipv6_conf_var_table },
504 { 0, NULL, trans_net_ipv6_conf_var_table },
505 {}
506};
507
508static const struct trans_ctl_table trans_net_ipv6_route_table[] = {
509 { NET_IPV6_ROUTE_FLUSH, "flush" },
510 { NET_IPV6_ROUTE_GC_THRESH, "gc_thresh" },
511 { NET_IPV6_ROUTE_MAX_SIZE, "max_size" },
512 { NET_IPV6_ROUTE_GC_MIN_INTERVAL, "gc_min_interval" },
513 { NET_IPV6_ROUTE_GC_TIMEOUT, "gc_timeout" },
514 { NET_IPV6_ROUTE_GC_INTERVAL, "gc_interval" },
515 { NET_IPV6_ROUTE_GC_ELASTICITY, "gc_elasticity" },
516 { NET_IPV6_ROUTE_MTU_EXPIRES, "mtu_expires" },
517 { NET_IPV6_ROUTE_MIN_ADVMSS, "min_adv_mss" },
518 { NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS, "gc_min_interval_ms" },
519 {}
520};
521
522static const struct trans_ctl_table trans_net_ipv6_icmp_table[] = {
523 { NET_IPV6_ICMP_RATELIMIT, "ratelimit" },
524 {}
525};
526
527static const struct trans_ctl_table trans_net_ipv6_table[] = {
528 { NET_IPV6_CONF, "conf", trans_net_ipv6_conf_table },
529 { NET_IPV6_NEIGH, "neigh", trans_net_neigh_table },
530 { NET_IPV6_ROUTE, "route", trans_net_ipv6_route_table },
531 { NET_IPV6_ICMP, "icmp", trans_net_ipv6_icmp_table },
532 { NET_IPV6_BINDV6ONLY, "bindv6only" },
533 { NET_IPV6_IP6FRAG_HIGH_THRESH, "ip6frag_high_thresh" },
534 { NET_IPV6_IP6FRAG_LOW_THRESH, "ip6frag_low_thresh" },
535 { NET_IPV6_IP6FRAG_TIME, "ip6frag_time" },
536 { NET_IPV6_IP6FRAG_SECRET_INTERVAL, "ip6frag_secret_interval" },
537 { NET_IPV6_MLD_MAX_MSF, "mld_max_msf" },
538 { 2088 /* IPQ_QMAX */, "ip6_queue_maxlen" },
539 {}
540};
541
542static const struct trans_ctl_table trans_net_x25_table[] = {
543 { NET_X25_RESTART_REQUEST_TIMEOUT, "restart_request_timeout" },
544 { NET_X25_CALL_REQUEST_TIMEOUT, "call_request_timeout" },
545 { NET_X25_RESET_REQUEST_TIMEOUT, "reset_request_timeout" },
546 { NET_X25_CLEAR_REQUEST_TIMEOUT, "clear_request_timeout" },
547 { NET_X25_ACK_HOLD_BACK_TIMEOUT, "acknowledgement_hold_back_timeout" },
548 { NET_X25_FORWARD, "x25_forward" },
549 {}
550};
551
552static const struct trans_ctl_table trans_net_tr_table[] = {
553 { NET_TR_RIF_TIMEOUT, "rif_timeout" },
554 {}
555};
556
557
558static const struct trans_ctl_table trans_net_decnet_conf_vars[] = {
559 { NET_DECNET_CONF_DEV_FORWARDING, "forwarding" },
560 { NET_DECNET_CONF_DEV_PRIORITY, "priority" },
561 { NET_DECNET_CONF_DEV_T2, "t2" },
562 { NET_DECNET_CONF_DEV_T3, "t3" },
563 {}
564};
565
566static const struct trans_ctl_table trans_net_decnet_conf[] = {
567 { 0, NULL, trans_net_decnet_conf_vars },
568 {}
569};
570
571static const struct trans_ctl_table trans_net_decnet_table[] = {
572 { NET_DECNET_CONF, "conf", trans_net_decnet_conf },
573 { NET_DECNET_NODE_ADDRESS, "node_address" },
574 { NET_DECNET_NODE_NAME, "node_name" },
575 { NET_DECNET_DEFAULT_DEVICE, "default_device" },
576 { NET_DECNET_TIME_WAIT, "time_wait" },
577 { NET_DECNET_DN_COUNT, "dn_count" },
578 { NET_DECNET_DI_COUNT, "di_count" },
579 { NET_DECNET_DR_COUNT, "dr_count" },
580 { NET_DECNET_DST_GC_INTERVAL, "dst_gc_interval" },
581 { NET_DECNET_NO_FC_MAX_CWND, "no_fc_max_cwnd" },
582 { NET_DECNET_MEM, "decnet_mem" },
583 { NET_DECNET_RMEM, "decnet_rmem" },
584 { NET_DECNET_WMEM, "decnet_wmem" },
585 { NET_DECNET_DEBUG_LEVEL, "debug" },
586 {}
587};
588
589static const struct trans_ctl_table trans_net_sctp_table[] = {
590 { NET_SCTP_RTO_INITIAL, "rto_initial" },
591 { NET_SCTP_RTO_MIN, "rto_min" },
592 { NET_SCTP_RTO_MAX, "rto_max" },
593 { NET_SCTP_RTO_ALPHA, "rto_alpha_exp_divisor" },
594 { NET_SCTP_RTO_BETA, "rto_beta_exp_divisor" },
595 { NET_SCTP_VALID_COOKIE_LIFE, "valid_cookie_life" },
596 { NET_SCTP_ASSOCIATION_MAX_RETRANS, "association_max_retrans" },
597 { NET_SCTP_PATH_MAX_RETRANS, "path_max_retrans" },
598 { NET_SCTP_MAX_INIT_RETRANSMITS, "max_init_retransmits" },
599 { NET_SCTP_HB_INTERVAL, "hb_interval" },
600 { NET_SCTP_PRESERVE_ENABLE, "cookie_preserve_enable" },
601 { NET_SCTP_MAX_BURST, "max_burst" },
602 { NET_SCTP_ADDIP_ENABLE, "addip_enable" },
603 { NET_SCTP_PRSCTP_ENABLE, "prsctp_enable" },
604 { NET_SCTP_SNDBUF_POLICY, "sndbuf_policy" },
605 { NET_SCTP_SACK_TIMEOUT, "sack_timeout" },
606 { NET_SCTP_RCVBUF_POLICY, "rcvbuf_policy" },
607 {}
608};
609
610static const struct trans_ctl_table trans_net_llc_llc2_timeout_table[] = {
611 { NET_LLC2_ACK_TIMEOUT, "ack" },
612 { NET_LLC2_P_TIMEOUT, "p" },
613 { NET_LLC2_REJ_TIMEOUT, "rej" },
614 { NET_LLC2_BUSY_TIMEOUT, "busy" },
615 {}
616};
617
618static const struct trans_ctl_table trans_net_llc_station_table[] = {
619 { NET_LLC_STATION_ACK_TIMEOUT, "ack_timeout" },
620 {}
621};
622
623static const struct trans_ctl_table trans_net_llc_llc2_table[] = {
624 { NET_LLC2, "timeout", trans_net_llc_llc2_timeout_table },
625 {}
626};
627
628static const struct trans_ctl_table trans_net_llc_table[] = {
629 { NET_LLC2, "llc2", trans_net_llc_llc2_table },
630 { NET_LLC_STATION, "station", trans_net_llc_station_table },
631 {}
632};
633
634static const struct trans_ctl_table trans_net_netfilter_table[] = {
635 { NET_NF_CONNTRACK_MAX, "nf_conntrack_max" },
636 { NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT, "nf_conntrack_tcp_timeout_syn_sent" },
637 { NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV, "nf_conntrack_tcp_timeout_syn_recv" },
638 { NET_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED, "nf_conntrack_tcp_timeout_established" },
639 { NET_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT, "nf_conntrack_tcp_timeout_fin_wait" },
640 { NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT, "nf_conntrack_tcp_timeout_close_wait" },
641 { NET_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK, "nf_conntrack_tcp_timeout_last_ack" },
642 { NET_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT, "nf_conntrack_tcp_timeout_time_wait" },
643 { NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE, "nf_conntrack_tcp_timeout_close" },
644 { NET_NF_CONNTRACK_UDP_TIMEOUT, "nf_conntrack_udp_timeout" },
645 { NET_NF_CONNTRACK_UDP_TIMEOUT_STREAM, "nf_conntrack_udp_timeout_stream" },
646 { NET_NF_CONNTRACK_ICMP_TIMEOUT, "nf_conntrack_icmp_timeout" },
647 { NET_NF_CONNTRACK_GENERIC_TIMEOUT, "nf_conntrack_generic_timeout" },
648 { NET_NF_CONNTRACK_BUCKETS, "nf_conntrack_buckets" },
649 { NET_NF_CONNTRACK_LOG_INVALID, "nf_conntrack_log_invalid" },
650 { NET_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS, "nf_conntrack_tcp_timeout_max_retrans" },
651 { NET_NF_CONNTRACK_TCP_LOOSE, "nf_conntrack_tcp_loose" },
652 { NET_NF_CONNTRACK_TCP_BE_LIBERAL, "nf_conntrack_tcp_be_liberal" },
653 { NET_NF_CONNTRACK_TCP_MAX_RETRANS, "nf_conntrack_tcp_max_retrans" },
654 { NET_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED, "nf_conntrack_sctp_timeout_closed" },
655 { NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT, "nf_conntrack_sctp_timeout_cookie_wait" },
656 { NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED, "nf_conntrack_sctp_timeout_cookie_echoed" },
657 { NET_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED, "nf_conntrack_sctp_timeout_established" },
658 { NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT, "nf_conntrack_sctp_timeout_shutdown_sent" },
659 { NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD, "nf_conntrack_sctp_timeout_shutdown_recd" },
660 { NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT, "nf_conntrack_sctp_timeout_shutdown_ack_sent" },
661 { NET_NF_CONNTRACK_COUNT, "nf_conntrack_count" },
662 { NET_NF_CONNTRACK_ICMPV6_TIMEOUT, "nf_conntrack_icmpv6_timeout" },
663 { NET_NF_CONNTRACK_FRAG6_TIMEOUT, "nf_conntrack_frag6_timeout" },
664 { NET_NF_CONNTRACK_FRAG6_LOW_THRESH, "nf_conntrack_frag6_low_thresh" },
665 { NET_NF_CONNTRACK_FRAG6_HIGH_THRESH, "nf_conntrack_frag6_high_thresh" },
666 { NET_NF_CONNTRACK_CHECKSUM, "nf_conntrack_checksum" },
667
668 {}
669};
670
671static const struct trans_ctl_table trans_net_dccp_table[] = {
672 { NET_DCCP_DEFAULT, "default" },
673 {}
674};
675
676static const struct trans_ctl_table trans_net_irda_table[] = {
677 { NET_IRDA_DISCOVERY, "discovery" },
678 { NET_IRDA_DEVNAME, "devname" },
679 { NET_IRDA_DEBUG, "debug" },
680 { NET_IRDA_FAST_POLL, "fast_poll_increase" },
681 { NET_IRDA_DISCOVERY_SLOTS, "discovery_slots" },
682 { NET_IRDA_DISCOVERY_TIMEOUT, "discovery_timeout" },
683 { NET_IRDA_SLOT_TIMEOUT, "slot_timeout" },
684 { NET_IRDA_MAX_BAUD_RATE, "max_baud_rate" },
685 { NET_IRDA_MIN_TX_TURN_TIME, "min_tx_turn_time" },
686 { NET_IRDA_MAX_TX_DATA_SIZE, "max_tx_data_size" },
687 { NET_IRDA_MAX_TX_WINDOW, "max_tx_window" },
688 { NET_IRDA_MAX_NOREPLY_TIME, "max_noreply_time" },
689 { NET_IRDA_WARN_NOREPLY_TIME, "warn_noreply_time" },
690 { NET_IRDA_LAP_KEEPALIVE_TIME, "lap_keepalive_time" },
691 {}
692};
693
694static const struct trans_ctl_table trans_net_table[] = {
695 { NET_CORE, "core", trans_net_core_table },
696 /* NET_ETHER not used */
697 /* NET_802 not used */
698 { NET_UNIX, "unix", trans_net_unix_table },
699 { NET_IPV4, "ipv4", trans_net_ipv4_table },
700 { NET_IPX, "ipx", trans_net_ipx_table },
701 { NET_ATALK, "appletalk", trans_net_atalk_table },
702 { NET_NETROM, "netrom", trans_net_netrom_table },
703 { NET_AX25, "ax25", trans_net_ax25_table },
704 { NET_BRIDGE, "bridge", trans_net_bridge_table },
705 { NET_ROSE, "rose", trans_net_rose_table },
706 { NET_IPV6, "ipv6", trans_net_ipv6_table },
707 { NET_X25, "x25", trans_net_x25_table },
708 { NET_TR, "token-ring", trans_net_tr_table },
709 { NET_DECNET, "decnet", trans_net_decnet_table },
710 /* NET_ECONET not used */
711 { NET_SCTP, "sctp", trans_net_sctp_table },
712 { NET_LLC, "llc", trans_net_llc_table },
713 { NET_NETFILTER, "netfilter", trans_net_netfilter_table },
714 { NET_DCCP, "dccp", trans_net_dccp_table },
715 { NET_IRDA, "irda", trans_net_irda_table },
716 { 2089, "nf_conntrack_max" },
717 {}
718};
719
720static const struct trans_ctl_table trans_fs_quota_table[] = {
721 { FS_DQ_LOOKUPS, "lookups" },
722 { FS_DQ_DROPS, "drops" },
723 { FS_DQ_READS, "reads" },
724 { FS_DQ_WRITES, "writes" },
725 { FS_DQ_CACHE_HITS, "cache_hits" },
726 { FS_DQ_ALLOCATED, "allocated_dquots" },
727 { FS_DQ_FREE, "free_dquots" },
728 { FS_DQ_SYNCS, "syncs" },
729 { FS_DQ_WARNINGS, "warnings" },
730 {}
731};
732
733static const struct trans_ctl_table trans_fs_xfs_table[] = {
734 { XFS_SGID_INHERIT, "irix_sgid_inherit" },
735 { XFS_SYMLINK_MODE, "irix_symlink_mode" },
736 { XFS_PANIC_MASK, "panic_mask" },
737
738 { XFS_ERRLEVEL, "error_level" },
739 { XFS_SYNCD_TIMER, "xfssyncd_centisecs" },
740 { XFS_INHERIT_SYNC, "inherit_sync" },
741 { XFS_INHERIT_NODUMP, "inherit_nodump" },
742 { XFS_INHERIT_NOATIME, "inherit_noatime" },
743 { XFS_BUF_TIMER, "xfsbufd_centisecs" },
744 { XFS_BUF_AGE, "age_buffer_centisecs" },
745 { XFS_INHERIT_NOSYM, "inherit_nosymlinks" },
746 { XFS_ROTORSTEP, "rotorstep" },
747 { XFS_INHERIT_NODFRG, "inherit_nodefrag" },
748 { XFS_FILESTREAM_TIMER, "filestream_centisecs" },
749 { XFS_STATS_CLEAR, "stats_clear" },
750 {}
751};
752
753static const struct trans_ctl_table trans_fs_ocfs2_nm_table[] = {
754 { 1, "hb_ctl_path" },
755 {}
756};
757
758static const struct trans_ctl_table trans_fs_ocfs2_table[] = {
759 { 1, "nm", trans_fs_ocfs2_nm_table },
760 {}
761};
762
763static const struct trans_ctl_table trans_inotify_table[] = {
764 { INOTIFY_MAX_USER_INSTANCES, "max_user_instances" },
765 { INOTIFY_MAX_USER_WATCHES, "max_user_watches" },
766 { INOTIFY_MAX_QUEUED_EVENTS, "max_queued_events" },
767 {}
768};
769
770static const struct trans_ctl_table trans_fs_table[] = {
771 { FS_NRINODE, "inode-nr" },
772 { FS_STATINODE, "inode-state" },
773 /* FS_MAXINODE unused */
774 /* FS_NRDQUOT unused */
775 /* FS_MAXDQUOT unused */
776 { FS_NRFILE, "file-nr" },
777 { FS_MAXFILE, "file-max" },
778 { FS_DENTRY, "dentry-state" },
779 /* FS_NRSUPER unused */
780 /* FS_MAXUPSER unused */
781 { FS_OVERFLOWUID, "overflowuid" },
782 { FS_OVERFLOWGID, "overflowgid" },
783 { FS_LEASES, "leases-enable" },
784 { FS_DIR_NOTIFY, "dir-notify-enable" },
785 { FS_LEASE_TIME, "lease-break-time" },
786 { FS_DQSTATS, "quota", trans_fs_quota_table },
787 { FS_XFS, "xfs", trans_fs_xfs_table },
788 { FS_AIO_NR, "aio-nr" },
789 { FS_AIO_MAX_NR, "aio-max-nr" },
790 { FS_INOTIFY, "inotify", trans_inotify_table },
791 { FS_OCFS2, "ocfs2", trans_fs_ocfs2_table },
792 { KERN_SETUID_DUMPABLE, "suid_dumpable" },
793 {}
794};
795
796static const struct trans_ctl_table trans_debug_table[] = {
797 {}
798};
799
800static const struct trans_ctl_table trans_cdrom_table[] = {
801 { DEV_CDROM_INFO, "info" },
802 { DEV_CDROM_AUTOCLOSE, "autoclose" },
803 { DEV_CDROM_AUTOEJECT, "autoeject" },
804 { DEV_CDROM_DEBUG, "debug" },
805 { DEV_CDROM_LOCK, "lock" },
806 { DEV_CDROM_CHECK_MEDIA, "check_media" },
807 {}
808};
809
810static const struct trans_ctl_table trans_ipmi_table[] = {
811 { DEV_IPMI_POWEROFF_POWERCYCLE, "poweroff_powercycle" },
812 {}
813};
814
815static const struct trans_ctl_table trans_mac_hid_files[] = {
816 /* DEV_MAC_HID_KEYBOARD_SENDS_LINUX_KEYCODES unused */
817 /* DEV_MAC_HID_KEYBOARD_LOCK_KEYCODES unused */
818 { DEV_MAC_HID_MOUSE_BUTTON_EMULATION, "mouse_button_emulation" },
819 { DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE, "mouse_button2_keycode" },
820 { DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE, "mouse_button3_keycode" },
821 /* DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES unused */
822 {}
823};
824
825static const struct trans_ctl_table trans_raid_table[] = {
826 { DEV_RAID_SPEED_LIMIT_MIN, "speed_limit_min" },
827 { DEV_RAID_SPEED_LIMIT_MAX, "speed_limit_max" },
828 {}
829};
830
831static const struct trans_ctl_table trans_scsi_table[] = {
832 { DEV_SCSI_LOGGING_LEVEL, "logging_level" },
833 {}
834};
835
836static const struct trans_ctl_table trans_parport_default_table[] = {
837 { DEV_PARPORT_DEFAULT_TIMESLICE, "timeslice" },
838 { DEV_PARPORT_DEFAULT_SPINTIME, "spintime" },
839 {}
840};
841
842static const struct trans_ctl_table trans_parport_device_table[] = {
843 { DEV_PARPORT_DEVICE_TIMESLICE, "timeslice" },
844 {}
845};
846
847static const struct trans_ctl_table trans_parport_devices_table[] = {
848 { DEV_PARPORT_DEVICES_ACTIVE, "active" },
849 { 0, NULL, trans_parport_device_table },
850 {}
851};
852
853static const struct trans_ctl_table trans_parport_parport_table[] = {
854 { DEV_PARPORT_SPINTIME, "spintime" },
855 { DEV_PARPORT_BASE_ADDR, "base-addr" },
856 { DEV_PARPORT_IRQ, "irq" },
857 { DEV_PARPORT_DMA, "dma" },
858 { DEV_PARPORT_MODES, "modes" },
859 { DEV_PARPORT_DEVICES, "devices", trans_parport_devices_table },
860 { DEV_PARPORT_AUTOPROBE, "autoprobe" },
861 { DEV_PARPORT_AUTOPROBE + 1, "autoprobe0" },
862 { DEV_PARPORT_AUTOPROBE + 2, "autoprobe1" },
863 { DEV_PARPORT_AUTOPROBE + 3, "autoprobe2" },
864 { DEV_PARPORT_AUTOPROBE + 4, "autoprobe3" },
865 {}
866};
867static const struct trans_ctl_table trans_parport_table[] = {
868 { DEV_PARPORT_DEFAULT, "default", trans_parport_default_table },
869 { 0, NULL, trans_parport_parport_table },
870 {}
871};
872
873static const struct trans_ctl_table trans_dev_table[] = {
874 { DEV_CDROM, "cdrom", trans_cdrom_table },
875 /* DEV_HWMON unused */
876 { DEV_PARPORT, "parport", trans_parport_table },
877 { DEV_RAID, "raid", trans_raid_table },
878 { DEV_MAC_HID, "mac_hid", trans_mac_hid_files },
879 { DEV_SCSI, "scsi", trans_scsi_table },
880 { DEV_IPMI, "ipmi", trans_ipmi_table },
881 {}
882};
883
884static const struct trans_ctl_table trans_bus_isa_table[] = {
885 { BUS_ISA_MEM_BASE, "membase" },
886 { BUS_ISA_PORT_BASE, "portbase" },
887 { BUS_ISA_PORT_SHIFT, "portshift" },
888 {}
889};
890
891static const struct trans_ctl_table trans_bus_table[] = {
892 { CTL_BUS_ISA, "isa", trans_bus_isa_table },
893 {}
894};
895
896static const struct trans_ctl_table trans_arlan_conf_table0[] = {
897 { 1, "spreadingCode" },
898 { 2, "channelNumber" },
899 { 3, "scramblingDisable" },
900 { 4, "txAttenuation" },
901 { 5, "systemId" },
902 { 6, "maxDatagramSize" },
903 { 7, "maxFrameSize" },
904 { 8, "maxRetries" },
905 { 9, "receiveMode" },
906 { 10, "priority" },
907 { 11, "rootOrRepeater" },
908 { 12, "SID" },
909 { 13, "registrationMode" },
910 { 14, "registrationFill" },
911 { 15, "localTalkAddress" },
912 { 16, "codeFormat" },
913 { 17, "numChannels" },
914 { 18, "channel1" },
915 { 19, "channel2" },
916 { 20, "channel3" },
917 { 21, "channel4" },
918 { 22, "txClear" },
919 { 23, "txRetries" },
920 { 24, "txRouting" },
921 { 25, "txScrambled" },
922 { 26, "rxParameter" },
923 { 27, "txTimeoutMs" },
924 { 28, "waitCardTimeout" },
925 { 29, "channelSet" },
926 { 30, "name" },
927 { 31, "waitTime" },
928 { 32, "lParameter" },
929 { 33, "_15" },
930 { 34, "headerSize" },
931 { 36, "tx_delay_ms" },
932 { 37, "retries" },
933 { 38, "ReTransmitPacketMaxSize" },
934 { 39, "waitReTransmitPacketMaxSize" },
935 { 40, "fastReTransCount" },
936 { 41, "driverRetransmissions" },
937 { 42, "txAckTimeoutMs" },
938 { 43, "registrationInterrupts" },
939 { 44, "hardwareType" },
940 { 45, "radioType" },
941 { 46, "writeEEPROM" },
942 { 47, "writeRadioType" },
943 { 48, "entry_exit_debug" },
944 { 49, "debug" },
945 { 50, "in_speed" },
946 { 51, "out_speed" },
947 { 52, "in_speed10" },
948 { 53, "out_speed10" },
949 { 54, "in_speed_max" },
950 { 55, "out_speed_max" },
951 { 56, "measure_rate" },
952 { 57, "pre_Command_Wait" },
953 { 58, "rx_tweak1" },
954 { 59, "rx_tweak2" },
955 { 60, "tx_queue_len" },
956
957 { 150, "arlan0-txRing" },
958 { 151, "arlan0-rxRing" },
959 { 152, "arlan0-18" },
960 { 153, "arlan0-ring" },
961 { 154, "arlan0-shm-cpy" },
962 { 155, "config0" },
963 { 156, "reset0" },
964 {}
965};
966
967static const struct trans_ctl_table trans_arlan_conf_table1[] = {
968 { 1, "spreadingCode" },
969 { 2, "channelNumber" },
970 { 3, "scramblingDisable" },
971 { 4, "txAttenuation" },
972 { 5, "systemId" },
973 { 6, "maxDatagramSize" },
974 { 7, "maxFrameSize" },
975 { 8, "maxRetries" },
976 { 9, "receiveMode" },
977 { 10, "priority" },
978 { 11, "rootOrRepeater" },
979 { 12, "SID" },
980 { 13, "registrationMode" },
981 { 14, "registrationFill" },
982 { 15, "localTalkAddress" },
983 { 16, "codeFormat" },
984 { 17, "numChannels" },
985 { 18, "channel1" },
986 { 19, "channel2" },
987 { 20, "channel3" },
988 { 21, "channel4" },
989 { 22, "txClear" },
990 { 23, "txRetries" },
991 { 24, "txRouting" },
992 { 25, "txScrambled" },
993 { 26, "rxParameter" },
994 { 27, "txTimeoutMs" },
995 { 28, "waitCardTimeout" },
996 { 29, "channelSet" },
997 { 30, "name" },
998 { 31, "waitTime" },
999 { 32, "lParameter" },
1000 { 33, "_15" },
1001 { 34, "headerSize" },
1002 { 36, "tx_delay_ms" },
1003 { 37, "retries" },
1004 { 38, "ReTransmitPacketMaxSize" },
1005 { 39, "waitReTransmitPacketMaxSize" },
1006 { 40, "fastReTransCount" },
1007 { 41, "driverRetransmissions" },
1008 { 42, "txAckTimeoutMs" },
1009 { 43, "registrationInterrupts" },
1010 { 44, "hardwareType" },
1011 { 45, "radioType" },
1012 { 46, "writeEEPROM" },
1013 { 47, "writeRadioType" },
1014 { 48, "entry_exit_debug" },
1015 { 49, "debug" },
1016 { 50, "in_speed" },
1017 { 51, "out_speed" },
1018 { 52, "in_speed10" },
1019 { 53, "out_speed10" },
1020 { 54, "in_speed_max" },
1021 { 55, "out_speed_max" },
1022 { 56, "measure_rate" },
1023 { 57, "pre_Command_Wait" },
1024 { 58, "rx_tweak1" },
1025 { 59, "rx_tweak2" },
1026 { 60, "tx_queue_len" },
1027
1028 { 150, "arlan1-txRing" },
1029 { 151, "arlan1-rxRing" },
1030 { 152, "arlan1-18" },
1031 { 153, "arlan1-ring" },
1032 { 154, "arlan1-shm-cpy" },
1033 { 155, "config1" },
1034 { 156, "reset1" },
1035 {}
1036};
1037
1038static const struct trans_ctl_table trans_arlan_conf_table2[] = {
1039 { 1, "spreadingCode" },
1040 { 2, "channelNumber" },
1041 { 3, "scramblingDisable" },
1042 { 4, "txAttenuation" },
1043 { 5, "systemId" },
1044 { 6, "maxDatagramSize" },
1045 { 7, "maxFrameSize" },
1046 { 8, "maxRetries" },
1047 { 9, "receiveMode" },
1048 { 10, "priority" },
1049 { 11, "rootOrRepeater" },
1050 { 12, "SID" },
1051 { 13, "registrationMode" },
1052 { 14, "registrationFill" },
1053 { 15, "localTalkAddress" },
1054 { 16, "codeFormat" },
1055 { 17, "numChannels" },
1056 { 18, "channel1" },
1057 { 19, "channel2" },
1058 { 20, "channel3" },
1059 { 21, "channel4" },
1060 { 22, "txClear" },
1061 { 23, "txRetries" },
1062 { 24, "txRouting" },
1063 { 25, "txScrambled" },
1064 { 26, "rxParameter" },
1065 { 27, "txTimeoutMs" },
1066 { 28, "waitCardTimeout" },
1067 { 29, "channelSet" },
1068 { 30, "name" },
1069 { 31, "waitTime" },
1070 { 32, "lParameter" },
1071 { 33, "_15" },
1072 { 34, "headerSize" },
1073 { 36, "tx_delay_ms" },
1074 { 37, "retries" },
1075 { 38, "ReTransmitPacketMaxSize" },
1076 { 39, "waitReTransmitPacketMaxSize" },
1077 { 40, "fastReTransCount" },
1078 { 41, "driverRetransmissions" },
1079 { 42, "txAckTimeoutMs" },
1080 { 43, "registrationInterrupts" },
1081 { 44, "hardwareType" },
1082 { 45, "radioType" },
1083 { 46, "writeEEPROM" },
1084 { 47, "writeRadioType" },
1085 { 48, "entry_exit_debug" },
1086 { 49, "debug" },
1087 { 50, "in_speed" },
1088 { 51, "out_speed" },
1089 { 52, "in_speed10" },
1090 { 53, "out_speed10" },
1091 { 54, "in_speed_max" },
1092 { 55, "out_speed_max" },
1093 { 56, "measure_rate" },
1094 { 57, "pre_Command_Wait" },
1095 { 58, "rx_tweak1" },
1096 { 59, "rx_tweak2" },
1097 { 60, "tx_queue_len" },
1098
1099 { 150, "arlan2-txRing" },
1100 { 151, "arlan2-rxRing" },
1101 { 152, "arlan2-18" },
1102 { 153, "arlan2-ring" },
1103 { 154, "arlan2-shm-cpy" },
1104 { 155, "config2" },
1105 { 156, "reset2" },
1106 {}
1107};
1108
1109static const struct trans_ctl_table trans_arlan_conf_table3[] = {
1110 { 1, "spreadingCode" },
1111 { 2, "channelNumber" },
1112 { 3, "scramblingDisable" },
1113 { 4, "txAttenuation" },
1114 { 5, "systemId" },
1115 { 6, "maxDatagramSize" },
1116 { 7, "maxFrameSize" },
1117 { 8, "maxRetries" },
1118 { 9, "receiveMode" },
1119 { 10, "priority" },
1120 { 11, "rootOrRepeater" },
1121 { 12, "SID" },
1122 { 13, "registrationMode" },
1123 { 14, "registrationFill" },
1124 { 15, "localTalkAddress" },
1125 { 16, "codeFormat" },
1126 { 17, "numChannels" },
1127 { 18, "channel1" },
1128 { 19, "channel2" },
1129 { 20, "channel3" },
1130 { 21, "channel4" },
1131 { 22, "txClear" },
1132 { 23, "txRetries" },
1133 { 24, "txRouting" },
1134 { 25, "txScrambled" },
1135 { 26, "rxParameter" },
1136 { 27, "txTimeoutMs" },
1137 { 28, "waitCardTimeout" },
1138 { 29, "channelSet" },
1139 { 30, "name" },
1140 { 31, "waitTime" },
1141 { 32, "lParameter" },
1142 { 33, "_15" },
1143 { 34, "headerSize" },
1144 { 36, "tx_delay_ms" },
1145 { 37, "retries" },
1146 { 38, "ReTransmitPacketMaxSize" },
1147 { 39, "waitReTransmitPacketMaxSize" },
1148 { 40, "fastReTransCount" },
1149 { 41, "driverRetransmissions" },
1150 { 42, "txAckTimeoutMs" },
1151 { 43, "registrationInterrupts" },
1152 { 44, "hardwareType" },
1153 { 45, "radioType" },
1154 { 46, "writeEEPROM" },
1155 { 47, "writeRadioType" },
1156 { 48, "entry_exit_debug" },
1157 { 49, "debug" },
1158 { 50, "in_speed" },
1159 { 51, "out_speed" },
1160 { 52, "in_speed10" },
1161 { 53, "out_speed10" },
1162 { 54, "in_speed_max" },
1163 { 55, "out_speed_max" },
1164 { 56, "measure_rate" },
1165 { 57, "pre_Command_Wait" },
1166 { 58, "rx_tweak1" },
1167 { 59, "rx_tweak2" },
1168 { 60, "tx_queue_len" },
1169
1170 { 150, "arlan3-txRing" },
1171 { 151, "arlan3-rxRing" },
1172 { 152, "arlan3-18" },
1173 { 153, "arlan3-ring" },
1174 { 154, "arlan3-shm-cpy" },
1175 { 155, "config3" },
1176 { 156, "reset3" },
1177 {}
1178};
1179
1180static const struct trans_ctl_table trans_arlan_table[] = {
1181 { 1, "arlan0", trans_arlan_conf_table0 },
1182 { 2, "arlan1", trans_arlan_conf_table1 },
1183 { 3, "arlan2", trans_arlan_conf_table2 },
1184 { 4, "arlan3", trans_arlan_conf_table3 },
1185 {}
1186};
1187
1188static const struct trans_ctl_table trans_s390dbf_table[] = {
1189 { 5678 /* CTL_S390DBF_STOPPABLE */, "debug_stoppable" },
1190 { 5679 /* CTL_S390DBF_ACTIVE */, "debug_active" },
1191 {}
1192};
1193
1194static const struct trans_ctl_table trans_sunrpc_table[] = {
1195 { CTL_RPCDEBUG, "rpc_debug" },
1196 { CTL_NFSDEBUG, "nfs_debug" },
1197 { CTL_NFSDDEBUG, "nfsd_debug" },
1198 { CTL_NLMDEBUG, "nlm_debug" },
1199 { CTL_SLOTTABLE_UDP, "udp_slot_table_entries" },
1200 { CTL_SLOTTABLE_TCP, "tcp_slot_table_entries" },
1201 { CTL_MIN_RESVPORT, "min_resvport" },
1202 { CTL_MAX_RESVPORT, "max_resvport" },
1203 {}
1204};
1205
1206static const struct trans_ctl_table trans_pm_table[] = {
1207 { 1 /* CTL_PM_SUSPEND */, "suspend" },
1208 { 2 /* CTL_PM_CMODE */, "cmode" },
1209 { 3 /* CTL_PM_P0 */, "p0" },
1210 { 4 /* CTL_PM_CM */, "cm" },
1211 {}
1212};
1213
1214static const struct trans_ctl_table trans_frv_table[] = {
1215 { 1, "cache-mode" },
1216 { 2, "pin-cxnr" },
1217 {}
1218};
1219
1220static const struct trans_ctl_table trans_root_table[] = {
1221 { CTL_KERN, "kernel", trans_kern_table },
1222 { CTL_VM, "vm", trans_vm_table },
1223 { CTL_NET, "net", trans_net_table },
1224 /* CTL_PROC not used */
1225 { CTL_FS, "fs", trans_fs_table },
1226 { CTL_DEBUG, "debug", trans_debug_table },
1227 { CTL_DEV, "dev", trans_dev_table },
1228 { CTL_BUS, "bus", trans_bus_table },
1229 { CTL_ABI, "abi" },
1230 /* CTL_CPU not used */
1231 { CTL_ARLAN, "arlan", trans_arlan_table },
1232 { CTL_S390DBF, "s390dbf", trans_s390dbf_table },
1233 { CTL_SUNRPC, "sunrpc", trans_sunrpc_table },
1234 { CTL_PM, "pm", trans_pm_table },
1235 { CTL_FRV, "frv", trans_frv_table },
1236 {}
1237};
1238
1239
1240
1241 8
1242static int sysctl_depth(struct ctl_table *table) 9static int sysctl_depth(struct ctl_table *table)
1243{ 10{
@@ -1261,47 +28,6 @@ static struct ctl_table *sysctl_parent(struct ctl_table *table, int n)
1261 return table; 28 return table;
1262} 29}
1263 30
1264static const struct trans_ctl_table *sysctl_binary_lookup(struct ctl_table *table)
1265{
1266 struct ctl_table *test;
1267 const struct trans_ctl_table *ref;
1268 int cur_depth;
1269
1270 cur_depth = sysctl_depth(table);
1271
1272 ref = trans_root_table;
1273repeat:
1274 test = sysctl_parent(table, cur_depth);
1275 for (; ref->ctl_name || ref->procname || ref->child; ref++) {
1276 int match = 0;
1277
1278 if (cur_depth && !ref->child)
1279 continue;
1280
1281 if (test->procname && ref->procname &&
1282 (strcmp(test->procname, ref->procname) == 0))
1283 match++;
1284
1285 if (test->ctl_name && ref->ctl_name &&
1286 (test->ctl_name == ref->ctl_name))
1287 match++;
1288
1289 if (!ref->ctl_name && !ref->procname)
1290 match++;
1291
1292 if (match) {
1293 if (cur_depth != 0) {
1294 cur_depth--;
1295 ref = ref->child;
1296 goto repeat;
1297 }
1298 goto out;
1299 }
1300 }
1301 ref = NULL;
1302out:
1303 return ref;
1304}
1305 31
1306static void sysctl_print_path(struct ctl_table *table) 32static void sysctl_print_path(struct ctl_table *table)
1307{ 33{
@@ -1315,26 +41,6 @@ static void sysctl_print_path(struct ctl_table *table)
1315 } 41 }
1316 } 42 }
1317 printk(" "); 43 printk(" ");
1318 if (table->ctl_name) {
1319 for (i = depth; i >= 0; i--) {
1320 tmp = sysctl_parent(table, i);
1321 printk(".%d", tmp->ctl_name);
1322 }
1323 }
1324}
1325
1326static void sysctl_repair_table(struct ctl_table *table)
1327{
1328 /* Don't complain about the classic default
1329 * sysctl strategy routine. Maybe later we
1330 * can get the tables fixed and complain about
1331 * this.
1332 */
1333 if (table->ctl_name && table->procname &&
1334 (table->proc_handler == proc_dointvec) &&
1335 (!table->strategy)) {
1336 table->strategy = sysctl_data;
1337 }
1338} 44}
1339 45
1340static struct ctl_table *sysctl_check_lookup(struct nsproxy *namespaces, 46static struct ctl_table *sysctl_check_lookup(struct nsproxy *namespaces,
@@ -1352,7 +58,7 @@ static struct ctl_table *sysctl_check_lookup(struct nsproxy *namespaces,
1352 ref = head->ctl_table; 58 ref = head->ctl_table;
1353repeat: 59repeat:
1354 test = sysctl_parent(table, cur_depth); 60 test = sysctl_parent(table, cur_depth);
1355 for (; ref->ctl_name || ref->procname; ref++) { 61 for (; ref->procname; ref++) {
1356 int match = 0; 62 int match = 0;
1357 if (cur_depth && !ref->child) 63 if (cur_depth && !ref->child)
1358 continue; 64 continue;
@@ -1361,10 +67,6 @@ repeat:
1361 (strcmp(test->procname, ref->procname) == 0)) 67 (strcmp(test->procname, ref->procname) == 0))
1362 match++; 68 match++;
1363 69
1364 if (test->ctl_name && ref->ctl_name &&
1365 (test->ctl_name == ref->ctl_name))
1366 match++;
1367
1368 if (match) { 70 if (match) {
1369 if (cur_depth != 0) { 71 if (cur_depth != 0) {
1370 cur_depth--; 72 cur_depth--;
@@ -1392,38 +94,6 @@ static void set_fail(const char **fail, struct ctl_table *table, const char *str
1392 *fail = str; 94 *fail = str;
1393} 95}
1394 96
1395static int sysctl_check_dir(struct nsproxy *namespaces,
1396 struct ctl_table *table)
1397{
1398 struct ctl_table *ref;
1399 int error;
1400
1401 error = 0;
1402 ref = sysctl_check_lookup(namespaces, table);
1403 if (ref) {
1404 int match = 0;
1405 if ((!table->procname && !ref->procname) ||
1406 (table->procname && ref->procname &&
1407 (strcmp(table->procname, ref->procname) == 0)))
1408 match++;
1409
1410 if ((!table->ctl_name && !ref->ctl_name) ||
1411 (table->ctl_name && ref->ctl_name &&
1412 (table->ctl_name == ref->ctl_name)))
1413 match++;
1414
1415 if (match != 2) {
1416 printk(KERN_ERR "%s: failed: ", __func__);
1417 sysctl_print_path(table);
1418 printk(" ref: ");
1419 sysctl_print_path(ref);
1420 printk("\n");
1421 error = -EINVAL;
1422 }
1423 }
1424 return error;
1425}
1426
1427static void sysctl_check_leaf(struct nsproxy *namespaces, 97static void sysctl_check_leaf(struct nsproxy *namespaces,
1428 struct ctl_table *table, const char **fail) 98 struct ctl_table *table, const char **fail)
1429{ 99{
@@ -1434,37 +104,15 @@ static void sysctl_check_leaf(struct nsproxy *namespaces,
1434 set_fail(fail, table, "Sysctl already exists"); 104 set_fail(fail, table, "Sysctl already exists");
1435} 105}
1436 106
1437static void sysctl_check_bin_path(struct ctl_table *table, const char **fail)
1438{
1439 const struct trans_ctl_table *ref;
1440
1441 ref = sysctl_binary_lookup(table);
1442 if (table->ctl_name && !ref)
1443 set_fail(fail, table, "Unknown sysctl binary path");
1444 if (ref) {
1445 if (ref->procname &&
1446 (!table->procname ||
1447 (strcmp(table->procname, ref->procname) != 0)))
1448 set_fail(fail, table, "procname does not match binary path procname");
1449
1450 if (ref->ctl_name && table->ctl_name &&
1451 (table->ctl_name != ref->ctl_name))
1452 set_fail(fail, table, "ctl_name does not match binary path ctl_name");
1453 }
1454}
1455
1456int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table) 107int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table)
1457{ 108{
1458 int error = 0; 109 int error = 0;
1459 for (; table->ctl_name || table->procname; table++) { 110 for (; table->procname; table++) {
1460 const char *fail = NULL; 111 const char *fail = NULL;
1461 112
1462 sysctl_repair_table(table);
1463 if (table->parent) { 113 if (table->parent) {
1464 if (table->procname && !table->parent->procname) 114 if (table->procname && !table->parent->procname)
1465 set_fail(&fail, table, "Parent without procname"); 115 set_fail(&fail, table, "Parent without procname");
1466 if (table->ctl_name && !table->parent->ctl_name)
1467 set_fail(&fail, table, "Parent without ctl_name");
1468 } 116 }
1469 if (!table->procname) 117 if (!table->procname)
1470 set_fail(&fail, table, "No procname"); 118 set_fail(&fail, table, "No procname");
@@ -1477,21 +125,12 @@ int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table)
1477 set_fail(&fail, table, "Writable sysctl directory"); 125 set_fail(&fail, table, "Writable sysctl directory");
1478 if (table->proc_handler) 126 if (table->proc_handler)
1479 set_fail(&fail, table, "Directory with proc_handler"); 127 set_fail(&fail, table, "Directory with proc_handler");
1480 if (table->strategy)
1481 set_fail(&fail, table, "Directory with strategy");
1482 if (table->extra1) 128 if (table->extra1)
1483 set_fail(&fail, table, "Directory with extra1"); 129 set_fail(&fail, table, "Directory with extra1");
1484 if (table->extra2) 130 if (table->extra2)
1485 set_fail(&fail, table, "Directory with extra2"); 131 set_fail(&fail, table, "Directory with extra2");
1486 if (sysctl_check_dir(namespaces, table))
1487 set_fail(&fail, table, "Inconsistent directory names");
1488 } else { 132 } else {
1489 if ((table->strategy == sysctl_data) || 133 if ((table->proc_handler == proc_dostring) ||
1490 (table->strategy == sysctl_string) ||
1491 (table->strategy == sysctl_intvec) ||
1492 (table->strategy == sysctl_jiffies) ||
1493 (table->strategy == sysctl_ms_jiffies) ||
1494 (table->proc_handler == proc_dostring) ||
1495 (table->proc_handler == proc_dointvec) || 134 (table->proc_handler == proc_dointvec) ||
1496 (table->proc_handler == proc_dointvec_minmax) || 135 (table->proc_handler == proc_dointvec_minmax) ||
1497 (table->proc_handler == proc_dointvec_jiffies) || 136 (table->proc_handler == proc_dointvec_jiffies) ||
@@ -1513,14 +152,6 @@ int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table)
1513 set_fail(&fail, table, "No max"); 152 set_fail(&fail, table, "No max");
1514 } 153 }
1515 } 154 }
1516#ifdef CONFIG_SYSCTL_SYSCALL
1517 if (table->ctl_name && !table->strategy)
1518 set_fail(&fail, table, "Missing strategy");
1519#endif
1520#if 0
1521 if (!table->ctl_name && table->strategy)
1522 set_fail(&fail, table, "Strategy without ctl_name");
1523#endif
1524#ifdef CONFIG_PROC_SYSCTL 155#ifdef CONFIG_PROC_SYSCTL
1525 if (table->procname && !table->proc_handler) 156 if (table->procname && !table->proc_handler)
1526 set_fail(&fail, table, "No proc_handler"); 157 set_fail(&fail, table, "No proc_handler");
@@ -1531,7 +162,6 @@ int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table)
1531#endif 162#endif
1532 sysctl_check_leaf(namespaces, table, &fail); 163 sysctl_check_leaf(namespaces, table, &fail);
1533 } 164 }
1534 sysctl_check_bin_path(table, &fail);
1535 if (table->mode > 0777) 165 if (table->mode > 0777)
1536 set_fail(&fail, table, "bogus .mode"); 166 set_fail(&fail, table, "bogus .mode");
1537 if (fail) { 167 if (fail) {
diff --git a/kernel/utsname_sysctl.c b/kernel/utsname_sysctl.c
index 69eae358a726..a2cd77e70d4d 100644
--- a/kernel/utsname_sysctl.c
+++ b/kernel/utsname_sysctl.c
@@ -57,78 +57,47 @@ static int proc_do_uts_string(ctl_table *table, int write,
57#define proc_do_uts_string NULL 57#define proc_do_uts_string NULL
58#endif 58#endif
59 59
60
61#ifdef CONFIG_SYSCTL_SYSCALL
62/* The generic string strategy routine: */
63static int sysctl_uts_string(ctl_table *table,
64 void __user *oldval, size_t __user *oldlenp,
65 void __user *newval, size_t newlen)
66{
67 struct ctl_table uts_table;
68 int r, write;
69 write = newval && newlen;
70 memcpy(&uts_table, table, sizeof(uts_table));
71 uts_table.data = get_uts(table, write);
72 r = sysctl_string(&uts_table, oldval, oldlenp, newval, newlen);
73 put_uts(table, write, uts_table.data);
74 return r;
75}
76#else
77#define sysctl_uts_string NULL
78#endif
79
80static struct ctl_table uts_kern_table[] = { 60static struct ctl_table uts_kern_table[] = {
81 { 61 {
82 .ctl_name = KERN_OSTYPE,
83 .procname = "ostype", 62 .procname = "ostype",
84 .data = init_uts_ns.name.sysname, 63 .data = init_uts_ns.name.sysname,
85 .maxlen = sizeof(init_uts_ns.name.sysname), 64 .maxlen = sizeof(init_uts_ns.name.sysname),
86 .mode = 0444, 65 .mode = 0444,
87 .proc_handler = proc_do_uts_string, 66 .proc_handler = proc_do_uts_string,
88 .strategy = sysctl_uts_string,
89 }, 67 },
90 { 68 {
91 .ctl_name = KERN_OSRELEASE,
92 .procname = "osrelease", 69 .procname = "osrelease",
93 .data = init_uts_ns.name.release, 70 .data = init_uts_ns.name.release,
94 .maxlen = sizeof(init_uts_ns.name.release), 71 .maxlen = sizeof(init_uts_ns.name.release),
95 .mode = 0444, 72 .mode = 0444,
96 .proc_handler = proc_do_uts_string, 73 .proc_handler = proc_do_uts_string,
97 .strategy = sysctl_uts_string,
98 }, 74 },
99 { 75 {
100 .ctl_name = KERN_VERSION,
101 .procname = "version", 76 .procname = "version",
102 .data = init_uts_ns.name.version, 77 .data = init_uts_ns.name.version,
103 .maxlen = sizeof(init_uts_ns.name.version), 78 .maxlen = sizeof(init_uts_ns.name.version),
104 .mode = 0444, 79 .mode = 0444,
105 .proc_handler = proc_do_uts_string, 80 .proc_handler = proc_do_uts_string,
106 .strategy = sysctl_uts_string,
107 }, 81 },
108 { 82 {
109 .ctl_name = KERN_NODENAME,
110 .procname = "hostname", 83 .procname = "hostname",
111 .data = init_uts_ns.name.nodename, 84 .data = init_uts_ns.name.nodename,
112 .maxlen = sizeof(init_uts_ns.name.nodename), 85 .maxlen = sizeof(init_uts_ns.name.nodename),
113 .mode = 0644, 86 .mode = 0644,
114 .proc_handler = proc_do_uts_string, 87 .proc_handler = proc_do_uts_string,
115 .strategy = sysctl_uts_string,
116 }, 88 },
117 { 89 {
118 .ctl_name = KERN_DOMAINNAME,
119 .procname = "domainname", 90 .procname = "domainname",
120 .data = init_uts_ns.name.domainname, 91 .data = init_uts_ns.name.domainname,
121 .maxlen = sizeof(init_uts_ns.name.domainname), 92 .maxlen = sizeof(init_uts_ns.name.domainname),
122 .mode = 0644, 93 .mode = 0644,
123 .proc_handler = proc_do_uts_string, 94 .proc_handler = proc_do_uts_string,
124 .strategy = sysctl_uts_string,
125 }, 95 },
126 {} 96 {}
127}; 97};
128 98
129static struct ctl_table uts_root_table[] = { 99static struct ctl_table uts_root_table[] = {
130 { 100 {
131 .ctl_name = CTL_KERN,
132 .procname = "kernel", 101 .procname = "kernel",
133 .mode = 0555, 102 .mode = 0555,
134 .child = uts_kern_table, 103 .child = uts_kern_table,
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
index 234ceb10861f..01f2d1139e9a 100644
--- a/lib/Kconfig.debug
+++ b/lib/Kconfig.debug
@@ -912,7 +912,7 @@ config LATENCYTOP
912 912
913config SYSCTL_SYSCALL_CHECK 913config SYSCTL_SYSCALL_CHECK
914 bool "Sysctl checks" 914 bool "Sysctl checks"
915 depends on SYSCTL_SYSCALL 915 depends on SYSCTL
916 ---help--- 916 ---help---
917 sys_sysctl uses binary paths that have been found challenging 917 sys_sysctl uses binary paths that have been found challenging
918 to properly maintain and use. This enables checks that help 918 to properly maintain and use. This enables checks that help
diff --git a/net/802/tr.c b/net/802/tr.c
index e874447ad144..44acce47fcdc 100644
--- a/net/802/tr.c
+++ b/net/802/tr.c
@@ -635,19 +635,18 @@ struct net_device *alloc_trdev(int sizeof_priv)
635#ifdef CONFIG_SYSCTL 635#ifdef CONFIG_SYSCTL
636static struct ctl_table tr_table[] = { 636static struct ctl_table tr_table[] = {
637 { 637 {
638 .ctl_name = NET_TR_RIF_TIMEOUT,
639 .procname = "rif_timeout", 638 .procname = "rif_timeout",
640 .data = &sysctl_tr_rif_timeout, 639 .data = &sysctl_tr_rif_timeout,
641 .maxlen = sizeof(int), 640 .maxlen = sizeof(int),
642 .mode = 0644, 641 .mode = 0644,
643 .proc_handler = proc_dointvec 642 .proc_handler = proc_dointvec
644 }, 643 },
645 { 0 }, 644 { },
646}; 645};
647 646
648static __initdata struct ctl_path tr_path[] = { 647static __initdata struct ctl_path tr_path[] = {
649 { .procname = "net", .ctl_name = CTL_NET, }, 648 { .procname = "net", },
650 { .procname = "token-ring", .ctl_name = NET_TR, }, 649 { .procname = "token-ring", },
651 { } 650 { }
652}; 651};
653#endif 652#endif
diff --git a/net/appletalk/sysctl_net_atalk.c b/net/appletalk/sysctl_net_atalk.c
index 8d237b15183b..04e9c0da7aa9 100644
--- a/net/appletalk/sysctl_net_atalk.c
+++ b/net/appletalk/sysctl_net_atalk.c
@@ -12,25 +12,20 @@
12 12
13static struct ctl_table atalk_table[] = { 13static struct ctl_table atalk_table[] = {
14 { 14 {
15 .ctl_name = NET_ATALK_AARP_EXPIRY_TIME,
16 .procname = "aarp-expiry-time", 15 .procname = "aarp-expiry-time",
17 .data = &sysctl_aarp_expiry_time, 16 .data = &sysctl_aarp_expiry_time,
18 .maxlen = sizeof(int), 17 .maxlen = sizeof(int),
19 .mode = 0644, 18 .mode = 0644,
20 .proc_handler = proc_dointvec_jiffies, 19 .proc_handler = proc_dointvec_jiffies,
21 .strategy = sysctl_jiffies,
22 }, 20 },
23 { 21 {
24 .ctl_name = NET_ATALK_AARP_TICK_TIME,
25 .procname = "aarp-tick-time", 22 .procname = "aarp-tick-time",
26 .data = &sysctl_aarp_tick_time, 23 .data = &sysctl_aarp_tick_time,
27 .maxlen = sizeof(int), 24 .maxlen = sizeof(int),
28 .mode = 0644, 25 .mode = 0644,
29 .proc_handler = proc_dointvec_jiffies, 26 .proc_handler = proc_dointvec_jiffies,
30 .strategy = sysctl_jiffies,
31 }, 27 },
32 { 28 {
33 .ctl_name = NET_ATALK_AARP_RETRANSMIT_LIMIT,
34 .procname = "aarp-retransmit-limit", 29 .procname = "aarp-retransmit-limit",
35 .data = &sysctl_aarp_retransmit_limit, 30 .data = &sysctl_aarp_retransmit_limit,
36 .maxlen = sizeof(int), 31 .maxlen = sizeof(int),
@@ -38,20 +33,18 @@ static struct ctl_table atalk_table[] = {
38 .proc_handler = proc_dointvec, 33 .proc_handler = proc_dointvec,
39 }, 34 },
40 { 35 {
41 .ctl_name = NET_ATALK_AARP_RESOLVE_TIME,
42 .procname = "aarp-resolve-time", 36 .procname = "aarp-resolve-time",
43 .data = &sysctl_aarp_resolve_time, 37 .data = &sysctl_aarp_resolve_time,
44 .maxlen = sizeof(int), 38 .maxlen = sizeof(int),
45 .mode = 0644, 39 .mode = 0644,
46 .proc_handler = proc_dointvec_jiffies, 40 .proc_handler = proc_dointvec_jiffies,
47 .strategy = sysctl_jiffies,
48 }, 41 },
49 { 0 }, 42 { },
50}; 43};
51 44
52static struct ctl_path atalk_path[] = { 45static struct ctl_path atalk_path[] = {
53 { .procname = "net", .ctl_name = CTL_NET, }, 46 { .procname = "net", },
54 { .procname = "appletalk", .ctl_name = NET_ATALK, }, 47 { .procname = "appletalk", },
55 { } 48 { }
56}; 49};
57 50
diff --git a/net/ax25/sysctl_net_ax25.c b/net/ax25/sysctl_net_ax25.c
index 62ee3fb34732..5159be6b2625 100644
--- a/net/ax25/sysctl_net_ax25.c
+++ b/net/ax25/sysctl_net_ax25.c
@@ -34,156 +34,128 @@ static ctl_table *ax25_table;
34static int ax25_table_size; 34static int ax25_table_size;
35 35
36static struct ctl_path ax25_path[] = { 36static struct ctl_path ax25_path[] = {
37 { .procname = "net", .ctl_name = CTL_NET, }, 37 { .procname = "net", },
38 { .procname = "ax25", .ctl_name = NET_AX25, }, 38 { .procname = "ax25", },
39 { } 39 { }
40}; 40};
41 41
42static const ctl_table ax25_param_table[] = { 42static const ctl_table ax25_param_table[] = {
43 { 43 {
44 .ctl_name = NET_AX25_IP_DEFAULT_MODE,
45 .procname = "ip_default_mode", 44 .procname = "ip_default_mode",
46 .maxlen = sizeof(int), 45 .maxlen = sizeof(int),
47 .mode = 0644, 46 .mode = 0644,
48 .proc_handler = proc_dointvec_minmax, 47 .proc_handler = proc_dointvec_minmax,
49 .strategy = sysctl_intvec,
50 .extra1 = &min_ipdefmode, 48 .extra1 = &min_ipdefmode,
51 .extra2 = &max_ipdefmode 49 .extra2 = &max_ipdefmode
52 }, 50 },
53 { 51 {
54 .ctl_name = NET_AX25_DEFAULT_MODE,
55 .procname = "ax25_default_mode", 52 .procname = "ax25_default_mode",
56 .maxlen = sizeof(int), 53 .maxlen = sizeof(int),
57 .mode = 0644, 54 .mode = 0644,
58 .proc_handler = proc_dointvec_minmax, 55 .proc_handler = proc_dointvec_minmax,
59 .strategy = sysctl_intvec,
60 .extra1 = &min_axdefmode, 56 .extra1 = &min_axdefmode,
61 .extra2 = &max_axdefmode 57 .extra2 = &max_axdefmode
62 }, 58 },
63 { 59 {
64 .ctl_name = NET_AX25_BACKOFF_TYPE,
65 .procname = "backoff_type", 60 .procname = "backoff_type",
66 .maxlen = sizeof(int), 61 .maxlen = sizeof(int),
67 .mode = 0644, 62 .mode = 0644,
68 .proc_handler = proc_dointvec_minmax, 63 .proc_handler = proc_dointvec_minmax,
69 .strategy = sysctl_intvec,
70 .extra1 = &min_backoff, 64 .extra1 = &min_backoff,
71 .extra2 = &max_backoff 65 .extra2 = &max_backoff
72 }, 66 },
73 { 67 {
74 .ctl_name = NET_AX25_CONNECT_MODE,
75 .procname = "connect_mode", 68 .procname = "connect_mode",
76 .maxlen = sizeof(int), 69 .maxlen = sizeof(int),
77 .mode = 0644, 70 .mode = 0644,
78 .proc_handler = proc_dointvec_minmax, 71 .proc_handler = proc_dointvec_minmax,
79 .strategy = sysctl_intvec,
80 .extra1 = &min_conmode, 72 .extra1 = &min_conmode,
81 .extra2 = &max_conmode 73 .extra2 = &max_conmode
82 }, 74 },
83 { 75 {
84 .ctl_name = NET_AX25_STANDARD_WINDOW,
85 .procname = "standard_window_size", 76 .procname = "standard_window_size",
86 .maxlen = sizeof(int), 77 .maxlen = sizeof(int),
87 .mode = 0644, 78 .mode = 0644,
88 .proc_handler = proc_dointvec_minmax, 79 .proc_handler = proc_dointvec_minmax,
89 .strategy = sysctl_intvec,
90 .extra1 = &min_window, 80 .extra1 = &min_window,
91 .extra2 = &max_window 81 .extra2 = &max_window
92 }, 82 },
93 { 83 {
94 .ctl_name = NET_AX25_EXTENDED_WINDOW,
95 .procname = "extended_window_size", 84 .procname = "extended_window_size",
96 .maxlen = sizeof(int), 85 .maxlen = sizeof(int),
97 .mode = 0644, 86 .mode = 0644,
98 .proc_handler = proc_dointvec_minmax, 87 .proc_handler = proc_dointvec_minmax,
99 .strategy = sysctl_intvec,
100 .extra1 = &min_ewindow, 88 .extra1 = &min_ewindow,
101 .extra2 = &max_ewindow 89 .extra2 = &max_ewindow
102 }, 90 },
103 { 91 {
104 .ctl_name = NET_AX25_T1_TIMEOUT,
105 .procname = "t1_timeout", 92 .procname = "t1_timeout",
106 .maxlen = sizeof(int), 93 .maxlen = sizeof(int),
107 .mode = 0644, 94 .mode = 0644,
108 .proc_handler = proc_dointvec_minmax, 95 .proc_handler = proc_dointvec_minmax,
109 .strategy = sysctl_intvec,
110 .extra1 = &min_t1, 96 .extra1 = &min_t1,
111 .extra2 = &max_t1 97 .extra2 = &max_t1
112 }, 98 },
113 { 99 {
114 .ctl_name = NET_AX25_T2_TIMEOUT,
115 .procname = "t2_timeout", 100 .procname = "t2_timeout",
116 .maxlen = sizeof(int), 101 .maxlen = sizeof(int),
117 .mode = 0644, 102 .mode = 0644,
118 .proc_handler = proc_dointvec_minmax, 103 .proc_handler = proc_dointvec_minmax,
119 .strategy = sysctl_intvec,
120 .extra1 = &min_t2, 104 .extra1 = &min_t2,
121 .extra2 = &max_t2 105 .extra2 = &max_t2
122 }, 106 },
123 { 107 {
124 .ctl_name = NET_AX25_T3_TIMEOUT,
125 .procname = "t3_timeout", 108 .procname = "t3_timeout",
126 .maxlen = sizeof(int), 109 .maxlen = sizeof(int),
127 .mode = 0644, 110 .mode = 0644,
128 .proc_handler = proc_dointvec_minmax, 111 .proc_handler = proc_dointvec_minmax,
129 .strategy = sysctl_intvec,
130 .extra1 = &min_t3, 112 .extra1 = &min_t3,
131 .extra2 = &max_t3 113 .extra2 = &max_t3
132 }, 114 },
133 { 115 {
134 .ctl_name = NET_AX25_IDLE_TIMEOUT,
135 .procname = "idle_timeout", 116 .procname = "idle_timeout",
136 .maxlen = sizeof(int), 117 .maxlen = sizeof(int),
137 .mode = 0644, 118 .mode = 0644,
138 .proc_handler = proc_dointvec_minmax, 119 .proc_handler = proc_dointvec_minmax,
139 .strategy = sysctl_intvec,
140 .extra1 = &min_idle, 120 .extra1 = &min_idle,
141 .extra2 = &max_idle 121 .extra2 = &max_idle
142 }, 122 },
143 { 123 {
144 .ctl_name = NET_AX25_N2,
145 .procname = "maximum_retry_count", 124 .procname = "maximum_retry_count",
146 .maxlen = sizeof(int), 125 .maxlen = sizeof(int),
147 .mode = 0644, 126 .mode = 0644,
148 .proc_handler = proc_dointvec_minmax, 127 .proc_handler = proc_dointvec_minmax,
149 .strategy = sysctl_intvec,
150 .extra1 = &min_n2, 128 .extra1 = &min_n2,
151 .extra2 = &max_n2 129 .extra2 = &max_n2
152 }, 130 },
153 { 131 {
154 .ctl_name = NET_AX25_PACLEN,
155 .procname = "maximum_packet_length", 132 .procname = "maximum_packet_length",
156 .maxlen = sizeof(int), 133 .maxlen = sizeof(int),
157 .mode = 0644, 134 .mode = 0644,
158 .proc_handler = proc_dointvec_minmax, 135 .proc_handler = proc_dointvec_minmax,
159 .strategy = sysctl_intvec,
160 .extra1 = &min_paclen, 136 .extra1 = &min_paclen,
161 .extra2 = &max_paclen 137 .extra2 = &max_paclen
162 }, 138 },
163 { 139 {
164 .ctl_name = NET_AX25_PROTOCOL,
165 .procname = "protocol", 140 .procname = "protocol",
166 .maxlen = sizeof(int), 141 .maxlen = sizeof(int),
167 .mode = 0644, 142 .mode = 0644,
168 .proc_handler = proc_dointvec_minmax, 143 .proc_handler = proc_dointvec_minmax,
169 .strategy = sysctl_intvec,
170 .extra1 = &min_proto, 144 .extra1 = &min_proto,
171 .extra2 = &max_proto 145 .extra2 = &max_proto
172 }, 146 },
173#ifdef CONFIG_AX25_DAMA_SLAVE 147#ifdef CONFIG_AX25_DAMA_SLAVE
174 { 148 {
175 .ctl_name = NET_AX25_DAMA_SLAVE_TIMEOUT,
176 .procname = "dama_slave_timeout", 149 .procname = "dama_slave_timeout",
177 .maxlen = sizeof(int), 150 .maxlen = sizeof(int),
178 .mode = 0644, 151 .mode = 0644,
179 .proc_handler = proc_dointvec_minmax, 152 .proc_handler = proc_dointvec_minmax,
180 .strategy = sysctl_intvec,
181 .extra1 = &min_ds_timeout, 153 .extra1 = &min_ds_timeout,
182 .extra2 = &max_ds_timeout 154 .extra2 = &max_ds_timeout
183 }, 155 },
184#endif 156#endif
185 157
186 { .ctl_name = 0 } /* that's all, folks! */ 158 { } /* that's all, folks! */
187}; 159};
188 160
189void ax25_register_sysctl(void) 161void ax25_register_sysctl(void)
@@ -212,11 +184,9 @@ void ax25_register_sysctl(void)
212 return; 184 return;
213 } 185 }
214 ax25_table[n].child = ax25_dev->systable = child; 186 ax25_table[n].child = ax25_dev->systable = child;
215 ax25_table[n].ctl_name = n + 1;
216 ax25_table[n].procname = ax25_dev->dev->name; 187 ax25_table[n].procname = ax25_dev->dev->name;
217 ax25_table[n].mode = 0555; 188 ax25_table[n].mode = 0555;
218 189
219 child[AX25_MAX_VALUES].ctl_name = 0; /* just in case... */
220 190
221 for (k = 0; k < AX25_MAX_VALUES; k++) 191 for (k = 0; k < AX25_MAX_VALUES; k++)
222 child[k].data = &ax25_dev->values[k]; 192 child[k].data = &ax25_dev->values[k];
@@ -233,7 +203,7 @@ void ax25_unregister_sysctl(void)
233 ctl_table *p; 203 ctl_table *p;
234 unregister_sysctl_table(ax25_table_header); 204 unregister_sysctl_table(ax25_table_header);
235 205
236 for (p = ax25_table; p->ctl_name; p++) 206 for (p = ax25_table; p->procname; p++)
237 kfree(p->child); 207 kfree(p->child);
238 kfree(ax25_table); 208 kfree(ax25_table);
239} 209}
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index a16a2342f6bf..268e2e725888 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -1013,12 +1013,12 @@ static ctl_table brnf_table[] = {
1013 .mode = 0644, 1013 .mode = 0644,
1014 .proc_handler = brnf_sysctl_call_tables, 1014 .proc_handler = brnf_sysctl_call_tables,
1015 }, 1015 },
1016 { .ctl_name = 0 } 1016 { }
1017}; 1017};
1018 1018
1019static struct ctl_path brnf_path[] = { 1019static struct ctl_path brnf_path[] = {
1020 { .procname = "net", .ctl_name = CTL_NET, }, 1020 { .procname = "net", },
1021 { .procname = "bridge", .ctl_name = NET_BRIDGE, }, 1021 { .procname = "bridge", },
1022 { } 1022 { }
1023}; 1023};
1024#endif 1024#endif
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index e587e6819698..2b54e6c6a7c8 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -2566,21 +2566,18 @@ static struct neigh_sysctl_table {
2566} neigh_sysctl_template __read_mostly = { 2566} neigh_sysctl_template __read_mostly = {
2567 .neigh_vars = { 2567 .neigh_vars = {
2568 { 2568 {
2569 .ctl_name = NET_NEIGH_MCAST_SOLICIT,
2570 .procname = "mcast_solicit", 2569 .procname = "mcast_solicit",
2571 .maxlen = sizeof(int), 2570 .maxlen = sizeof(int),
2572 .mode = 0644, 2571 .mode = 0644,
2573 .proc_handler = proc_dointvec, 2572 .proc_handler = proc_dointvec,
2574 }, 2573 },
2575 { 2574 {
2576 .ctl_name = NET_NEIGH_UCAST_SOLICIT,
2577 .procname = "ucast_solicit", 2575 .procname = "ucast_solicit",
2578 .maxlen = sizeof(int), 2576 .maxlen = sizeof(int),
2579 .mode = 0644, 2577 .mode = 0644,
2580 .proc_handler = proc_dointvec, 2578 .proc_handler = proc_dointvec,
2581 }, 2579 },
2582 { 2580 {
2583 .ctl_name = NET_NEIGH_APP_SOLICIT,
2584 .procname = "app_solicit", 2581 .procname = "app_solicit",
2585 .maxlen = sizeof(int), 2582 .maxlen = sizeof(int),
2586 .mode = 0644, 2583 .mode = 0644,
@@ -2593,38 +2590,30 @@ static struct neigh_sysctl_table {
2593 .proc_handler = proc_dointvec_userhz_jiffies, 2590 .proc_handler = proc_dointvec_userhz_jiffies,
2594 }, 2591 },
2595 { 2592 {
2596 .ctl_name = NET_NEIGH_REACHABLE_TIME,
2597 .procname = "base_reachable_time", 2593 .procname = "base_reachable_time",
2598 .maxlen = sizeof(int), 2594 .maxlen = sizeof(int),
2599 .mode = 0644, 2595 .mode = 0644,
2600 .proc_handler = proc_dointvec_jiffies, 2596 .proc_handler = proc_dointvec_jiffies,
2601 .strategy = sysctl_jiffies,
2602 }, 2597 },
2603 { 2598 {
2604 .ctl_name = NET_NEIGH_DELAY_PROBE_TIME,
2605 .procname = "delay_first_probe_time", 2599 .procname = "delay_first_probe_time",
2606 .maxlen = sizeof(int), 2600 .maxlen = sizeof(int),
2607 .mode = 0644, 2601 .mode = 0644,
2608 .proc_handler = proc_dointvec_jiffies, 2602 .proc_handler = proc_dointvec_jiffies,
2609 .strategy = sysctl_jiffies,
2610 }, 2603 },
2611 { 2604 {
2612 .ctl_name = NET_NEIGH_GC_STALE_TIME,
2613 .procname = "gc_stale_time", 2605 .procname = "gc_stale_time",
2614 .maxlen = sizeof(int), 2606 .maxlen = sizeof(int),
2615 .mode = 0644, 2607 .mode = 0644,
2616 .proc_handler = proc_dointvec_jiffies, 2608 .proc_handler = proc_dointvec_jiffies,
2617 .strategy = sysctl_jiffies,
2618 }, 2609 },
2619 { 2610 {
2620 .ctl_name = NET_NEIGH_UNRES_QLEN,
2621 .procname = "unres_qlen", 2611 .procname = "unres_qlen",
2622 .maxlen = sizeof(int), 2612 .maxlen = sizeof(int),
2623 .mode = 0644, 2613 .mode = 0644,
2624 .proc_handler = proc_dointvec, 2614 .proc_handler = proc_dointvec,
2625 }, 2615 },
2626 { 2616 {
2627 .ctl_name = NET_NEIGH_PROXY_QLEN,
2628 .procname = "proxy_qlen", 2617 .procname = "proxy_qlen",
2629 .maxlen = sizeof(int), 2618 .maxlen = sizeof(int),
2630 .mode = 0644, 2619 .mode = 0644,
@@ -2649,45 +2638,36 @@ static struct neigh_sysctl_table {
2649 .proc_handler = proc_dointvec_userhz_jiffies, 2638 .proc_handler = proc_dointvec_userhz_jiffies,
2650 }, 2639 },
2651 { 2640 {
2652 .ctl_name = NET_NEIGH_RETRANS_TIME_MS,
2653 .procname = "retrans_time_ms", 2641 .procname = "retrans_time_ms",
2654 .maxlen = sizeof(int), 2642 .maxlen = sizeof(int),
2655 .mode = 0644, 2643 .mode = 0644,
2656 .proc_handler = proc_dointvec_ms_jiffies, 2644 .proc_handler = proc_dointvec_ms_jiffies,
2657 .strategy = sysctl_ms_jiffies,
2658 }, 2645 },
2659 { 2646 {
2660 .ctl_name = NET_NEIGH_REACHABLE_TIME_MS,
2661 .procname = "base_reachable_time_ms", 2647 .procname = "base_reachable_time_ms",
2662 .maxlen = sizeof(int), 2648 .maxlen = sizeof(int),
2663 .mode = 0644, 2649 .mode = 0644,
2664 .proc_handler = proc_dointvec_ms_jiffies, 2650 .proc_handler = proc_dointvec_ms_jiffies,
2665 .strategy = sysctl_ms_jiffies,
2666 }, 2651 },
2667 { 2652 {
2668 .ctl_name = NET_NEIGH_GC_INTERVAL,
2669 .procname = "gc_interval", 2653 .procname = "gc_interval",
2670 .maxlen = sizeof(int), 2654 .maxlen = sizeof(int),
2671 .mode = 0644, 2655 .mode = 0644,
2672 .proc_handler = proc_dointvec_jiffies, 2656 .proc_handler = proc_dointvec_jiffies,
2673 .strategy = sysctl_jiffies,
2674 }, 2657 },
2675 { 2658 {
2676 .ctl_name = NET_NEIGH_GC_THRESH1,
2677 .procname = "gc_thresh1", 2659 .procname = "gc_thresh1",
2678 .maxlen = sizeof(int), 2660 .maxlen = sizeof(int),
2679 .mode = 0644, 2661 .mode = 0644,
2680 .proc_handler = proc_dointvec, 2662 .proc_handler = proc_dointvec,
2681 }, 2663 },
2682 { 2664 {
2683 .ctl_name = NET_NEIGH_GC_THRESH2,
2684 .procname = "gc_thresh2", 2665 .procname = "gc_thresh2",
2685 .maxlen = sizeof(int), 2666 .maxlen = sizeof(int),
2686 .mode = 0644, 2667 .mode = 0644,
2687 .proc_handler = proc_dointvec, 2668 .proc_handler = proc_dointvec,
2688 }, 2669 },
2689 { 2670 {
2690 .ctl_name = NET_NEIGH_GC_THRESH3,
2691 .procname = "gc_thresh3", 2671 .procname = "gc_thresh3",
2692 .maxlen = sizeof(int), 2672 .maxlen = sizeof(int),
2693 .mode = 0644, 2673 .mode = 0644,
@@ -2699,7 +2679,7 @@ static struct neigh_sysctl_table {
2699 2679
2700int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, 2680int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
2701 int p_id, int pdev_id, char *p_name, 2681 int p_id, int pdev_id, char *p_name,
2702 proc_handler *handler, ctl_handler *strategy) 2682 proc_handler *handler)
2703{ 2683{
2704 struct neigh_sysctl_table *t; 2684 struct neigh_sysctl_table *t;
2705 const char *dev_name_source = NULL; 2685 const char *dev_name_source = NULL;
@@ -2710,10 +2690,10 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
2710#define NEIGH_CTL_PATH_DEV 3 2690#define NEIGH_CTL_PATH_DEV 3
2711 2691
2712 struct ctl_path neigh_path[] = { 2692 struct ctl_path neigh_path[] = {
2713 { .procname = "net", .ctl_name = CTL_NET, }, 2693 { .procname = "net", },
2714 { .procname = "proto", .ctl_name = 0, }, 2694 { .procname = "proto", },
2715 { .procname = "neigh", .ctl_name = 0, }, 2695 { .procname = "neigh", },
2716 { .procname = "default", .ctl_name = NET_PROTO_CONF_DEFAULT, }, 2696 { .procname = "default", },
2717 { }, 2697 { },
2718 }; 2698 };
2719 2699
@@ -2738,7 +2718,6 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
2738 2718
2739 if (dev) { 2719 if (dev) {
2740 dev_name_source = dev->name; 2720 dev_name_source = dev->name;
2741 neigh_path[NEIGH_CTL_PATH_DEV].ctl_name = dev->ifindex;
2742 /* Terminate the table early */ 2721 /* Terminate the table early */
2743 memset(&t->neigh_vars[14], 0, sizeof(t->neigh_vars[14])); 2722 memset(&t->neigh_vars[14], 0, sizeof(t->neigh_vars[14]));
2744 } else { 2723 } else {
@@ -2750,31 +2729,19 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
2750 } 2729 }
2751 2730
2752 2731
2753 if (handler || strategy) { 2732 if (handler) {
2754 /* RetransTime */ 2733 /* RetransTime */
2755 t->neigh_vars[3].proc_handler = handler; 2734 t->neigh_vars[3].proc_handler = handler;
2756 t->neigh_vars[3].strategy = strategy;
2757 t->neigh_vars[3].extra1 = dev; 2735 t->neigh_vars[3].extra1 = dev;
2758 if (!strategy)
2759 t->neigh_vars[3].ctl_name = CTL_UNNUMBERED;
2760 /* ReachableTime */ 2736 /* ReachableTime */
2761 t->neigh_vars[4].proc_handler = handler; 2737 t->neigh_vars[4].proc_handler = handler;
2762 t->neigh_vars[4].strategy = strategy;
2763 t->neigh_vars[4].extra1 = dev; 2738 t->neigh_vars[4].extra1 = dev;
2764 if (!strategy)
2765 t->neigh_vars[4].ctl_name = CTL_UNNUMBERED;
2766 /* RetransTime (in milliseconds)*/ 2739 /* RetransTime (in milliseconds)*/
2767 t->neigh_vars[12].proc_handler = handler; 2740 t->neigh_vars[12].proc_handler = handler;
2768 t->neigh_vars[12].strategy = strategy;
2769 t->neigh_vars[12].extra1 = dev; 2741 t->neigh_vars[12].extra1 = dev;
2770 if (!strategy)
2771 t->neigh_vars[12].ctl_name = CTL_UNNUMBERED;
2772 /* ReachableTime (in milliseconds) */ 2742 /* ReachableTime (in milliseconds) */
2773 t->neigh_vars[13].proc_handler = handler; 2743 t->neigh_vars[13].proc_handler = handler;
2774 t->neigh_vars[13].strategy = strategy;
2775 t->neigh_vars[13].extra1 = dev; 2744 t->neigh_vars[13].extra1 = dev;
2776 if (!strategy)
2777 t->neigh_vars[13].ctl_name = CTL_UNNUMBERED;
2778 } 2745 }
2779 2746
2780 t->dev_name = kstrdup(dev_name_source, GFP_KERNEL); 2747 t->dev_name = kstrdup(dev_name_source, GFP_KERNEL);
@@ -2782,9 +2749,7 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
2782 goto free; 2749 goto free;
2783 2750
2784 neigh_path[NEIGH_CTL_PATH_DEV].procname = t->dev_name; 2751 neigh_path[NEIGH_CTL_PATH_DEV].procname = t->dev_name;
2785 neigh_path[NEIGH_CTL_PATH_NEIGH].ctl_name = pdev_id;
2786 neigh_path[NEIGH_CTL_PATH_PROTO].procname = p_name; 2752 neigh_path[NEIGH_CTL_PATH_PROTO].procname = p_name;
2787 neigh_path[NEIGH_CTL_PATH_PROTO].ctl_name = p_id;
2788 2753
2789 t->sysctl_header = 2754 t->sysctl_header =
2790 register_net_sysctl_table(neigh_parms_net(p), neigh_path, t->neigh_vars); 2755 register_net_sysctl_table(neigh_parms_net(p), neigh_path, t->neigh_vars);
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
index 7db1de0497c6..1ce4e6e85125 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -17,7 +17,6 @@
17static struct ctl_table net_core_table[] = { 17static struct ctl_table net_core_table[] = {
18#ifdef CONFIG_NET 18#ifdef CONFIG_NET
19 { 19 {
20 .ctl_name = NET_CORE_WMEM_MAX,
21 .procname = "wmem_max", 20 .procname = "wmem_max",
22 .data = &sysctl_wmem_max, 21 .data = &sysctl_wmem_max,
23 .maxlen = sizeof(int), 22 .maxlen = sizeof(int),
@@ -25,7 +24,6 @@ static struct ctl_table net_core_table[] = {
25 .proc_handler = proc_dointvec 24 .proc_handler = proc_dointvec
26 }, 25 },
27 { 26 {
28 .ctl_name = NET_CORE_RMEM_MAX,
29 .procname = "rmem_max", 27 .procname = "rmem_max",
30 .data = &sysctl_rmem_max, 28 .data = &sysctl_rmem_max,
31 .maxlen = sizeof(int), 29 .maxlen = sizeof(int),
@@ -33,7 +31,6 @@ static struct ctl_table net_core_table[] = {
33 .proc_handler = proc_dointvec 31 .proc_handler = proc_dointvec
34 }, 32 },
35 { 33 {
36 .ctl_name = NET_CORE_WMEM_DEFAULT,
37 .procname = "wmem_default", 34 .procname = "wmem_default",
38 .data = &sysctl_wmem_default, 35 .data = &sysctl_wmem_default,
39 .maxlen = sizeof(int), 36 .maxlen = sizeof(int),
@@ -41,7 +38,6 @@ static struct ctl_table net_core_table[] = {
41 .proc_handler = proc_dointvec 38 .proc_handler = proc_dointvec
42 }, 39 },
43 { 40 {
44 .ctl_name = NET_CORE_RMEM_DEFAULT,
45 .procname = "rmem_default", 41 .procname = "rmem_default",
46 .data = &sysctl_rmem_default, 42 .data = &sysctl_rmem_default,
47 .maxlen = sizeof(int), 43 .maxlen = sizeof(int),
@@ -49,7 +45,6 @@ static struct ctl_table net_core_table[] = {
49 .proc_handler = proc_dointvec 45 .proc_handler = proc_dointvec
50 }, 46 },
51 { 47 {
52 .ctl_name = NET_CORE_DEV_WEIGHT,
53 .procname = "dev_weight", 48 .procname = "dev_weight",
54 .data = &weight_p, 49 .data = &weight_p,
55 .maxlen = sizeof(int), 50 .maxlen = sizeof(int),
@@ -57,7 +52,6 @@ static struct ctl_table net_core_table[] = {
57 .proc_handler = proc_dointvec 52 .proc_handler = proc_dointvec
58 }, 53 },
59 { 54 {
60 .ctl_name = NET_CORE_MAX_BACKLOG,
61 .procname = "netdev_max_backlog", 55 .procname = "netdev_max_backlog",
62 .data = &netdev_max_backlog, 56 .data = &netdev_max_backlog,
63 .maxlen = sizeof(int), 57 .maxlen = sizeof(int),
@@ -65,16 +59,13 @@ static struct ctl_table net_core_table[] = {
65 .proc_handler = proc_dointvec 59 .proc_handler = proc_dointvec
66 }, 60 },
67 { 61 {
68 .ctl_name = NET_CORE_MSG_COST,
69 .procname = "message_cost", 62 .procname = "message_cost",
70 .data = &net_ratelimit_state.interval, 63 .data = &net_ratelimit_state.interval,
71 .maxlen = sizeof(int), 64 .maxlen = sizeof(int),
72 .mode = 0644, 65 .mode = 0644,
73 .proc_handler = proc_dointvec_jiffies, 66 .proc_handler = proc_dointvec_jiffies,
74 .strategy = sysctl_jiffies,
75 }, 67 },
76 { 68 {
77 .ctl_name = NET_CORE_MSG_BURST,
78 .procname = "message_burst", 69 .procname = "message_burst",
79 .data = &net_ratelimit_state.burst, 70 .data = &net_ratelimit_state.burst,
80 .maxlen = sizeof(int), 71 .maxlen = sizeof(int),
@@ -82,7 +73,6 @@ static struct ctl_table net_core_table[] = {
82 .proc_handler = proc_dointvec, 73 .proc_handler = proc_dointvec,
83 }, 74 },
84 { 75 {
85 .ctl_name = NET_CORE_OPTMEM_MAX,
86 .procname = "optmem_max", 76 .procname = "optmem_max",
87 .data = &sysctl_optmem_max, 77 .data = &sysctl_optmem_max,
88 .maxlen = sizeof(int), 78 .maxlen = sizeof(int),
@@ -91,7 +81,6 @@ static struct ctl_table net_core_table[] = {
91 }, 81 },
92#endif /* CONFIG_NET */ 82#endif /* CONFIG_NET */
93 { 83 {
94 .ctl_name = NET_CORE_BUDGET,
95 .procname = "netdev_budget", 84 .procname = "netdev_budget",
96 .data = &netdev_budget, 85 .data = &netdev_budget,
97 .maxlen = sizeof(int), 86 .maxlen = sizeof(int),
@@ -99,31 +88,29 @@ static struct ctl_table net_core_table[] = {
99 .proc_handler = proc_dointvec 88 .proc_handler = proc_dointvec
100 }, 89 },
101 { 90 {
102 .ctl_name = NET_CORE_WARNINGS,
103 .procname = "warnings", 91 .procname = "warnings",
104 .data = &net_msg_warn, 92 .data = &net_msg_warn,
105 .maxlen = sizeof(int), 93 .maxlen = sizeof(int),
106 .mode = 0644, 94 .mode = 0644,
107 .proc_handler = proc_dointvec 95 .proc_handler = proc_dointvec
108 }, 96 },
109 { .ctl_name = 0 } 97 { }
110}; 98};
111 99
112static struct ctl_table netns_core_table[] = { 100static struct ctl_table netns_core_table[] = {
113 { 101 {
114 .ctl_name = NET_CORE_SOMAXCONN,
115 .procname = "somaxconn", 102 .procname = "somaxconn",
116 .data = &init_net.core.sysctl_somaxconn, 103 .data = &init_net.core.sysctl_somaxconn,
117 .maxlen = sizeof(int), 104 .maxlen = sizeof(int),
118 .mode = 0644, 105 .mode = 0644,
119 .proc_handler = proc_dointvec 106 .proc_handler = proc_dointvec
120 }, 107 },
121 { .ctl_name = 0 } 108 { }
122}; 109};
123 110
124__net_initdata struct ctl_path net_core_path[] = { 111__net_initdata struct ctl_path net_core_path[] = {
125 { .procname = "net", .ctl_name = CTL_NET, }, 112 { .procname = "net", },
126 { .procname = "core", .ctl_name = NET_CORE, }, 113 { .procname = "core", },
127 { }, 114 { },
128}; 115};
129 116
diff --git a/net/dccp/sysctl.c b/net/dccp/sysctl.c
index a5a1856234e7..563943822e58 100644
--- a/net/dccp/sysctl.c
+++ b/net/dccp/sysctl.c
@@ -93,13 +93,13 @@ static struct ctl_table dccp_default_table[] = {
93 .proc_handler = proc_dointvec_ms_jiffies, 93 .proc_handler = proc_dointvec_ms_jiffies,
94 }, 94 },
95 95
96 { .ctl_name = 0, } 96 { }
97}; 97};
98 98
99static struct ctl_path dccp_path[] = { 99static struct ctl_path dccp_path[] = {
100 { .procname = "net", .ctl_name = CTL_NET, }, 100 { .procname = "net", },
101 { .procname = "dccp", .ctl_name = NET_DCCP, }, 101 { .procname = "dccp", },
102 { .procname = "default", .ctl_name = NET_DCCP_DEFAULT, }, 102 { .procname = "default", },
103 { } 103 { }
104}; 104};
105 105
diff --git a/net/decnet/dn_dev.c b/net/decnet/dn_dev.c
index 6e1f085db06a..1b1daeb151f2 100644
--- a/net/decnet/dn_dev.c
+++ b/net/decnet/dn_dev.c
@@ -89,7 +89,6 @@ static struct dn_dev_parms dn_dev_list[] = {
89 .t2 = 1, 89 .t2 = 1,
90 .t3 = 10, 90 .t3 = 10,
91 .name = "ethernet", 91 .name = "ethernet",
92 .ctl_name = NET_DECNET_CONF_ETHER,
93 .up = dn_eth_up, 92 .up = dn_eth_up,
94 .down = dn_eth_down, 93 .down = dn_eth_down,
95 .timer3 = dn_send_brd_hello, 94 .timer3 = dn_send_brd_hello,
@@ -101,7 +100,6 @@ static struct dn_dev_parms dn_dev_list[] = {
101 .t2 = 1, 100 .t2 = 1,
102 .t3 = 10, 101 .t3 = 10,
103 .name = "ipgre", 102 .name = "ipgre",
104 .ctl_name = NET_DECNET_CONF_GRE,
105 .timer3 = dn_send_brd_hello, 103 .timer3 = dn_send_brd_hello,
106}, 104},
107#if 0 105#if 0
@@ -112,7 +110,6 @@ static struct dn_dev_parms dn_dev_list[] = {
112 .t2 = 1, 110 .t2 = 1,
113 .t3 = 120, 111 .t3 = 120,
114 .name = "x25", 112 .name = "x25",
115 .ctl_name = NET_DECNET_CONF_X25,
116 .timer3 = dn_send_ptp_hello, 113 .timer3 = dn_send_ptp_hello,
117}, 114},
118#endif 115#endif
@@ -124,7 +121,6 @@ static struct dn_dev_parms dn_dev_list[] = {
124 .t2 = 1, 121 .t2 = 1,
125 .t3 = 10, 122 .t3 = 10,
126 .name = "ppp", 123 .name = "ppp",
127 .ctl_name = NET_DECNET_CONF_PPP,
128 .timer3 = dn_send_brd_hello, 124 .timer3 = dn_send_brd_hello,
129}, 125},
130#endif 126#endif
@@ -135,7 +131,6 @@ static struct dn_dev_parms dn_dev_list[] = {
135 .t2 = 1, 131 .t2 = 1,
136 .t3 = 120, 132 .t3 = 120,
137 .name = "ddcmp", 133 .name = "ddcmp",
138 .ctl_name = NET_DECNET_CONF_DDCMP,
139 .timer3 = dn_send_ptp_hello, 134 .timer3 = dn_send_ptp_hello,
140}, 135},
141{ 136{
@@ -145,7 +140,6 @@ static struct dn_dev_parms dn_dev_list[] = {
145 .t2 = 1, 140 .t2 = 1,
146 .t3 = 10, 141 .t3 = 10,
147 .name = "loopback", 142 .name = "loopback",
148 .ctl_name = NET_DECNET_CONF_LOOPBACK,
149 .timer3 = dn_send_brd_hello, 143 .timer3 = dn_send_brd_hello,
150} 144}
151}; 145};
@@ -166,10 +160,6 @@ static int max_priority[] = { 127 }; /* From DECnet spec */
166 160
167static int dn_forwarding_proc(ctl_table *, int, 161static int dn_forwarding_proc(ctl_table *, int,
168 void __user *, size_t *, loff_t *); 162 void __user *, size_t *, loff_t *);
169static int dn_forwarding_sysctl(ctl_table *table,
170 void __user *oldval, size_t __user *oldlenp,
171 void __user *newval, size_t newlen);
172
173static struct dn_dev_sysctl_table { 163static struct dn_dev_sysctl_table {
174 struct ctl_table_header *sysctl_header; 164 struct ctl_table_header *sysctl_header;
175 ctl_table dn_dev_vars[5]; 165 ctl_table dn_dev_vars[5];
@@ -177,44 +167,36 @@ static struct dn_dev_sysctl_table {
177 NULL, 167 NULL,
178 { 168 {
179 { 169 {
180 .ctl_name = NET_DECNET_CONF_DEV_FORWARDING,
181 .procname = "forwarding", 170 .procname = "forwarding",
182 .data = (void *)DN_DEV_PARMS_OFFSET(forwarding), 171 .data = (void *)DN_DEV_PARMS_OFFSET(forwarding),
183 .maxlen = sizeof(int), 172 .maxlen = sizeof(int),
184 .mode = 0644, 173 .mode = 0644,
185 .proc_handler = dn_forwarding_proc, 174 .proc_handler = dn_forwarding_proc,
186 .strategy = dn_forwarding_sysctl,
187 }, 175 },
188 { 176 {
189 .ctl_name = NET_DECNET_CONF_DEV_PRIORITY,
190 .procname = "priority", 177 .procname = "priority",
191 .data = (void *)DN_DEV_PARMS_OFFSET(priority), 178 .data = (void *)DN_DEV_PARMS_OFFSET(priority),
192 .maxlen = sizeof(int), 179 .maxlen = sizeof(int),
193 .mode = 0644, 180 .mode = 0644,
194 .proc_handler = proc_dointvec_minmax, 181 .proc_handler = proc_dointvec_minmax,
195 .strategy = sysctl_intvec,
196 .extra1 = &min_priority, 182 .extra1 = &min_priority,
197 .extra2 = &max_priority 183 .extra2 = &max_priority
198 }, 184 },
199 { 185 {
200 .ctl_name = NET_DECNET_CONF_DEV_T2,
201 .procname = "t2", 186 .procname = "t2",
202 .data = (void *)DN_DEV_PARMS_OFFSET(t2), 187 .data = (void *)DN_DEV_PARMS_OFFSET(t2),
203 .maxlen = sizeof(int), 188 .maxlen = sizeof(int),
204 .mode = 0644, 189 .mode = 0644,
205 .proc_handler = proc_dointvec_minmax, 190 .proc_handler = proc_dointvec_minmax,
206 .strategy = sysctl_intvec,
207 .extra1 = &min_t2, 191 .extra1 = &min_t2,
208 .extra2 = &max_t2 192 .extra2 = &max_t2
209 }, 193 },
210 { 194 {
211 .ctl_name = NET_DECNET_CONF_DEV_T3,
212 .procname = "t3", 195 .procname = "t3",
213 .data = (void *)DN_DEV_PARMS_OFFSET(t3), 196 .data = (void *)DN_DEV_PARMS_OFFSET(t3),
214 .maxlen = sizeof(int), 197 .maxlen = sizeof(int),
215 .mode = 0644, 198 .mode = 0644,
216 .proc_handler = proc_dointvec_minmax, 199 .proc_handler = proc_dointvec_minmax,
217 .strategy = sysctl_intvec,
218 .extra1 = &min_t3, 200 .extra1 = &min_t3,
219 .extra2 = &max_t3 201 .extra2 = &max_t3
220 }, 202 },
@@ -230,9 +212,9 @@ static void dn_dev_sysctl_register(struct net_device *dev, struct dn_dev_parms *
230#define DN_CTL_PATH_DEV 3 212#define DN_CTL_PATH_DEV 3
231 213
232 struct ctl_path dn_ctl_path[] = { 214 struct ctl_path dn_ctl_path[] = {
233 { .procname = "net", .ctl_name = CTL_NET, }, 215 { .procname = "net", },
234 { .procname = "decnet", .ctl_name = NET_DECNET, }, 216 { .procname = "decnet", },
235 { .procname = "conf", .ctl_name = NET_DECNET_CONF, }, 217 { .procname = "conf", },
236 { /* to be set */ }, 218 { /* to be set */ },
237 { }, 219 { },
238 }; 220 };
@@ -248,10 +230,8 @@ static void dn_dev_sysctl_register(struct net_device *dev, struct dn_dev_parms *
248 230
249 if (dev) { 231 if (dev) {
250 dn_ctl_path[DN_CTL_PATH_DEV].procname = dev->name; 232 dn_ctl_path[DN_CTL_PATH_DEV].procname = dev->name;
251 dn_ctl_path[DN_CTL_PATH_DEV].ctl_name = dev->ifindex;
252 } else { 233 } else {
253 dn_ctl_path[DN_CTL_PATH_DEV].procname = parms->name; 234 dn_ctl_path[DN_CTL_PATH_DEV].procname = parms->name;
254 dn_ctl_path[DN_CTL_PATH_DEV].ctl_name = parms->ctl_name;
255 } 235 }
256 236
257 t->dn_dev_vars[0].extra1 = (void *)dev; 237 t->dn_dev_vars[0].extra1 = (void *)dev;
@@ -317,44 +297,6 @@ static int dn_forwarding_proc(ctl_table *table, int write,
317#endif 297#endif
318} 298}
319 299
320static int dn_forwarding_sysctl(ctl_table *table,
321 void __user *oldval, size_t __user *oldlenp,
322 void __user *newval, size_t newlen)
323{
324#ifdef CONFIG_DECNET_ROUTER
325 struct net_device *dev = table->extra1;
326 struct dn_dev *dn_db;
327 int value;
328
329 if (table->extra1 == NULL)
330 return -EINVAL;
331
332 dn_db = dev->dn_ptr;
333
334 if (newval && newlen) {
335 if (newlen != sizeof(int))
336 return -EINVAL;
337
338 if (get_user(value, (int __user *)newval))
339 return -EFAULT;
340 if (value < 0)
341 return -EINVAL;
342 if (value > 2)
343 return -EINVAL;
344
345 if (dn_db->parms.down)
346 dn_db->parms.down(dev);
347 dn_db->parms.forwarding = value;
348 if (dn_db->parms.up)
349 dn_db->parms.up(dev);
350 }
351
352 return 0;
353#else
354 return -EINVAL;
355#endif
356}
357
358#else /* CONFIG_SYSCTL */ 300#else /* CONFIG_SYSCTL */
359static void dn_dev_sysctl_unregister(struct dn_dev_parms *parms) 301static void dn_dev_sysctl_unregister(struct dn_dev_parms *parms)
360{ 302{
diff --git a/net/decnet/sysctl_net_decnet.c b/net/decnet/sysctl_net_decnet.c
index 2036568beea9..be3eb8e23288 100644
--- a/net/decnet/sysctl_net_decnet.c
+++ b/net/decnet/sysctl_net_decnet.c
@@ -131,39 +131,6 @@ static int parse_addr(__le16 *addr, char *str)
131 return 0; 131 return 0;
132} 132}
133 133
134
135static int dn_node_address_strategy(ctl_table *table,
136 void __user *oldval, size_t __user *oldlenp,
137 void __user *newval, size_t newlen)
138{
139 size_t len;
140 __le16 addr;
141
142 if (oldval && oldlenp) {
143 if (get_user(len, oldlenp))
144 return -EFAULT;
145 if (len) {
146 if (len != sizeof(unsigned short))
147 return -EINVAL;
148 if (put_user(decnet_address, (__le16 __user *)oldval))
149 return -EFAULT;
150 }
151 }
152 if (newval && newlen) {
153 if (newlen != sizeof(unsigned short))
154 return -EINVAL;
155 if (get_user(addr, (__le16 __user *)newval))
156 return -EFAULT;
157
158 dn_dev_devices_off();
159
160 decnet_address = addr;
161
162 dn_dev_devices_on();
163 }
164 return 0;
165}
166
167static int dn_node_address_handler(ctl_table *table, int write, 134static int dn_node_address_handler(ctl_table *table, int write,
168 void __user *buffer, 135 void __user *buffer,
169 size_t *lenp, loff_t *ppos) 136 size_t *lenp, loff_t *ppos)
@@ -215,64 +182,6 @@ static int dn_node_address_handler(ctl_table *table, int write,
215 return 0; 182 return 0;
216} 183}
217 184
218
219static int dn_def_dev_strategy(ctl_table *table,
220 void __user *oldval, size_t __user *oldlenp,
221 void __user *newval, size_t newlen)
222{
223 size_t len;
224 struct net_device *dev;
225 char devname[17];
226 size_t namel;
227 int rv = 0;
228
229 devname[0] = 0;
230
231 if (oldval && oldlenp) {
232 if (get_user(len, oldlenp))
233 return -EFAULT;
234 if (len) {
235 dev = dn_dev_get_default();
236 if (dev) {
237 strcpy(devname, dev->name);
238 dev_put(dev);
239 }
240
241 namel = strlen(devname) + 1;
242 if (len > namel) len = namel;
243
244 if (copy_to_user(oldval, devname, len))
245 return -EFAULT;
246
247 if (put_user(len, oldlenp))
248 return -EFAULT;
249 }
250 }
251
252 if (newval && newlen) {
253 if (newlen > 16)
254 return -E2BIG;
255
256 if (copy_from_user(devname, newval, newlen))
257 return -EFAULT;
258
259 devname[newlen] = 0;
260
261 dev = dev_get_by_name(&init_net, devname);
262 if (dev == NULL)
263 return -ENODEV;
264
265 rv = -ENODEV;
266 if (dev->dn_ptr != NULL)
267 rv = dn_dev_set_default(dev, 1);
268 if (rv)
269 dev_put(dev);
270 }
271
272 return rv;
273}
274
275
276static int dn_def_dev_handler(ctl_table *table, int write, 185static int dn_def_dev_handler(ctl_table *table, int write,
277 void __user *buffer, 186 void __user *buffer,
278 size_t *lenp, loff_t *ppos) 187 size_t *lenp, loff_t *ppos)
@@ -338,138 +247,112 @@ static int dn_def_dev_handler(ctl_table *table, int write,
338 247
339static ctl_table dn_table[] = { 248static ctl_table dn_table[] = {
340 { 249 {
341 .ctl_name = NET_DECNET_NODE_ADDRESS,
342 .procname = "node_address", 250 .procname = "node_address",
343 .maxlen = 7, 251 .maxlen = 7,
344 .mode = 0644, 252 .mode = 0644,
345 .proc_handler = dn_node_address_handler, 253 .proc_handler = dn_node_address_handler,
346 .strategy = dn_node_address_strategy,
347 }, 254 },
348 { 255 {
349 .ctl_name = NET_DECNET_NODE_NAME,
350 .procname = "node_name", 256 .procname = "node_name",
351 .data = node_name, 257 .data = node_name,
352 .maxlen = 7, 258 .maxlen = 7,
353 .mode = 0644, 259 .mode = 0644,
354 .proc_handler = proc_dostring, 260 .proc_handler = proc_dostring,
355 .strategy = sysctl_string,
356 }, 261 },
357 { 262 {
358 .ctl_name = NET_DECNET_DEFAULT_DEVICE,
359 .procname = "default_device", 263 .procname = "default_device",
360 .maxlen = 16, 264 .maxlen = 16,
361 .mode = 0644, 265 .mode = 0644,
362 .proc_handler = dn_def_dev_handler, 266 .proc_handler = dn_def_dev_handler,
363 .strategy = dn_def_dev_strategy,
364 }, 267 },
365 { 268 {
366 .ctl_name = NET_DECNET_TIME_WAIT,
367 .procname = "time_wait", 269 .procname = "time_wait",
368 .data = &decnet_time_wait, 270 .data = &decnet_time_wait,
369 .maxlen = sizeof(int), 271 .maxlen = sizeof(int),
370 .mode = 0644, 272 .mode = 0644,
371 .proc_handler = proc_dointvec_minmax, 273 .proc_handler = proc_dointvec_minmax,
372 .strategy = sysctl_intvec,
373 .extra1 = &min_decnet_time_wait, 274 .extra1 = &min_decnet_time_wait,
374 .extra2 = &max_decnet_time_wait 275 .extra2 = &max_decnet_time_wait
375 }, 276 },
376 { 277 {
377 .ctl_name = NET_DECNET_DN_COUNT,
378 .procname = "dn_count", 278 .procname = "dn_count",
379 .data = &decnet_dn_count, 279 .data = &decnet_dn_count,
380 .maxlen = sizeof(int), 280 .maxlen = sizeof(int),
381 .mode = 0644, 281 .mode = 0644,
382 .proc_handler = proc_dointvec_minmax, 282 .proc_handler = proc_dointvec_minmax,
383 .strategy = sysctl_intvec,
384 .extra1 = &min_state_count, 283 .extra1 = &min_state_count,
385 .extra2 = &max_state_count 284 .extra2 = &max_state_count
386 }, 285 },
387 { 286 {
388 .ctl_name = NET_DECNET_DI_COUNT,
389 .procname = "di_count", 287 .procname = "di_count",
390 .data = &decnet_di_count, 288 .data = &decnet_di_count,
391 .maxlen = sizeof(int), 289 .maxlen = sizeof(int),
392 .mode = 0644, 290 .mode = 0644,
393 .proc_handler = proc_dointvec_minmax, 291 .proc_handler = proc_dointvec_minmax,
394 .strategy = sysctl_intvec,
395 .extra1 = &min_state_count, 292 .extra1 = &min_state_count,
396 .extra2 = &max_state_count 293 .extra2 = &max_state_count
397 }, 294 },
398 { 295 {
399 .ctl_name = NET_DECNET_DR_COUNT,
400 .procname = "dr_count", 296 .procname = "dr_count",
401 .data = &decnet_dr_count, 297 .data = &decnet_dr_count,
402 .maxlen = sizeof(int), 298 .maxlen = sizeof(int),
403 .mode = 0644, 299 .mode = 0644,
404 .proc_handler = proc_dointvec_minmax, 300 .proc_handler = proc_dointvec_minmax,
405 .strategy = sysctl_intvec,
406 .extra1 = &min_state_count, 301 .extra1 = &min_state_count,
407 .extra2 = &max_state_count 302 .extra2 = &max_state_count
408 }, 303 },
409 { 304 {
410 .ctl_name = NET_DECNET_DST_GC_INTERVAL,
411 .procname = "dst_gc_interval", 305 .procname = "dst_gc_interval",
412 .data = &decnet_dst_gc_interval, 306 .data = &decnet_dst_gc_interval,
413 .maxlen = sizeof(int), 307 .maxlen = sizeof(int),
414 .mode = 0644, 308 .mode = 0644,
415 .proc_handler = proc_dointvec_minmax, 309 .proc_handler = proc_dointvec_minmax,
416 .strategy = sysctl_intvec,
417 .extra1 = &min_decnet_dst_gc_interval, 310 .extra1 = &min_decnet_dst_gc_interval,
418 .extra2 = &max_decnet_dst_gc_interval 311 .extra2 = &max_decnet_dst_gc_interval
419 }, 312 },
420 { 313 {
421 .ctl_name = NET_DECNET_NO_FC_MAX_CWND,
422 .procname = "no_fc_max_cwnd", 314 .procname = "no_fc_max_cwnd",
423 .data = &decnet_no_fc_max_cwnd, 315 .data = &decnet_no_fc_max_cwnd,
424 .maxlen = sizeof(int), 316 .maxlen = sizeof(int),
425 .mode = 0644, 317 .mode = 0644,
426 .proc_handler = proc_dointvec_minmax, 318 .proc_handler = proc_dointvec_minmax,
427 .strategy = sysctl_intvec,
428 .extra1 = &min_decnet_no_fc_max_cwnd, 319 .extra1 = &min_decnet_no_fc_max_cwnd,
429 .extra2 = &max_decnet_no_fc_max_cwnd 320 .extra2 = &max_decnet_no_fc_max_cwnd
430 }, 321 },
431 { 322 {
432 .ctl_name = NET_DECNET_MEM,
433 .procname = "decnet_mem", 323 .procname = "decnet_mem",
434 .data = &sysctl_decnet_mem, 324 .data = &sysctl_decnet_mem,
435 .maxlen = sizeof(sysctl_decnet_mem), 325 .maxlen = sizeof(sysctl_decnet_mem),
436 .mode = 0644, 326 .mode = 0644,
437 .proc_handler = proc_dointvec, 327 .proc_handler = proc_dointvec,
438 .strategy = sysctl_intvec,
439 }, 328 },
440 { 329 {
441 .ctl_name = NET_DECNET_RMEM,
442 .procname = "decnet_rmem", 330 .procname = "decnet_rmem",
443 .data = &sysctl_decnet_rmem, 331 .data = &sysctl_decnet_rmem,
444 .maxlen = sizeof(sysctl_decnet_rmem), 332 .maxlen = sizeof(sysctl_decnet_rmem),
445 .mode = 0644, 333 .mode = 0644,
446 .proc_handler = proc_dointvec, 334 .proc_handler = proc_dointvec,
447 .strategy = sysctl_intvec,
448 }, 335 },
449 { 336 {
450 .ctl_name = NET_DECNET_WMEM,
451 .procname = "decnet_wmem", 337 .procname = "decnet_wmem",
452 .data = &sysctl_decnet_wmem, 338 .data = &sysctl_decnet_wmem,
453 .maxlen = sizeof(sysctl_decnet_wmem), 339 .maxlen = sizeof(sysctl_decnet_wmem),
454 .mode = 0644, 340 .mode = 0644,
455 .proc_handler = proc_dointvec, 341 .proc_handler = proc_dointvec,
456 .strategy = sysctl_intvec,
457 }, 342 },
458 { 343 {
459 .ctl_name = NET_DECNET_DEBUG_LEVEL,
460 .procname = "debug", 344 .procname = "debug",
461 .data = &decnet_debug_level, 345 .data = &decnet_debug_level,
462 .maxlen = sizeof(int), 346 .maxlen = sizeof(int),
463 .mode = 0644, 347 .mode = 0644,
464 .proc_handler = proc_dointvec, 348 .proc_handler = proc_dointvec,
465 .strategy = sysctl_intvec,
466 }, 349 },
467 {0} 350 { }
468}; 351};
469 352
470static struct ctl_path dn_path[] = { 353static struct ctl_path dn_path[] = {
471 { .procname = "net", .ctl_name = CTL_NET, }, 354 { .procname = "net", },
472 { .procname = "decnet", .ctl_name = NET_DECNET, }, 355 { .procname = "decnet", },
473 { } 356 { }
474}; 357};
475 358
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 4e80f336c0cf..c95cd93acf29 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -1240,7 +1240,7 @@ void __init arp_init(void)
1240 arp_proc_init(); 1240 arp_proc_init();
1241#ifdef CONFIG_SYSCTL 1241#ifdef CONFIG_SYSCTL
1242 neigh_sysctl_register(NULL, &arp_tbl.parms, NET_IPV4, 1242 neigh_sysctl_register(NULL, &arp_tbl.parms, NET_IPV4,
1243 NET_IPV4_NEIGH, "ipv4", NULL, NULL); 1243 NET_IPV4_NEIGH, "ipv4", NULL);
1244#endif 1244#endif
1245 register_netdevice_notifier(&arp_netdev_notifier); 1245 register_netdevice_notifier(&arp_netdev_notifier);
1246} 1246}
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 5df2f6a0b0f0..e049da8311b5 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -1293,58 +1293,6 @@ static int devinet_conf_proc(ctl_table *ctl, int write,
1293 return ret; 1293 return ret;
1294} 1294}
1295 1295
1296static int devinet_conf_sysctl(ctl_table *table,
1297 void __user *oldval, size_t __user *oldlenp,
1298 void __user *newval, size_t newlen)
1299{
1300 struct ipv4_devconf *cnf;
1301 struct net *net;
1302 int *valp = table->data;
1303 int new;
1304 int i;
1305
1306 if (!newval || !newlen)
1307 return 0;
1308
1309 if (newlen != sizeof(int))
1310 return -EINVAL;
1311
1312 if (get_user(new, (int __user *)newval))
1313 return -EFAULT;
1314
1315 if (new == *valp)
1316 return 0;
1317
1318 if (oldval && oldlenp) {
1319 size_t len;
1320
1321 if (get_user(len, oldlenp))
1322 return -EFAULT;
1323
1324 if (len) {
1325 if (len > table->maxlen)
1326 len = table->maxlen;
1327 if (copy_to_user(oldval, valp, len))
1328 return -EFAULT;
1329 if (put_user(len, oldlenp))
1330 return -EFAULT;
1331 }
1332 }
1333
1334 *valp = new;
1335
1336 cnf = table->extra1;
1337 net = table->extra2;
1338 i = (int *)table->data - cnf->data;
1339
1340 set_bit(i, cnf->state);
1341
1342 if (cnf == net->ipv4.devconf_dflt)
1343 devinet_copy_dflt_conf(net, i);
1344
1345 return 1;
1346}
1347
1348static int devinet_sysctl_forward(ctl_table *ctl, int write, 1296static int devinet_sysctl_forward(ctl_table *ctl, int write,
1349 void __user *buffer, 1297 void __user *buffer,
1350 size_t *lenp, loff_t *ppos) 1298 size_t *lenp, loff_t *ppos)
@@ -1390,47 +1338,28 @@ int ipv4_doint_and_flush(ctl_table *ctl, int write,
1390 return ret; 1338 return ret;
1391} 1339}
1392 1340
1393int ipv4_doint_and_flush_strategy(ctl_table *table, 1341#define DEVINET_SYSCTL_ENTRY(attr, name, mval, proc) \
1394 void __user *oldval, size_t __user *oldlenp,
1395 void __user *newval, size_t newlen)
1396{
1397 int ret = devinet_conf_sysctl(table, oldval, oldlenp, newval, newlen);
1398 struct net *net = table->extra2;
1399
1400 if (ret == 1)
1401 rt_cache_flush(net, 0);
1402
1403 return ret;
1404}
1405
1406
1407#define DEVINET_SYSCTL_ENTRY(attr, name, mval, proc, sysctl) \
1408 { \ 1342 { \
1409 .ctl_name = NET_IPV4_CONF_ ## attr, \
1410 .procname = name, \ 1343 .procname = name, \
1411 .data = ipv4_devconf.data + \ 1344 .data = ipv4_devconf.data + \
1412 NET_IPV4_CONF_ ## attr - 1, \ 1345 NET_IPV4_CONF_ ## attr - 1, \
1413 .maxlen = sizeof(int), \ 1346 .maxlen = sizeof(int), \
1414 .mode = mval, \ 1347 .mode = mval, \
1415 .proc_handler = proc, \ 1348 .proc_handler = proc, \
1416 .strategy = sysctl, \
1417 .extra1 = &ipv4_devconf, \ 1349 .extra1 = &ipv4_devconf, \
1418 } 1350 }
1419 1351
1420#define DEVINET_SYSCTL_RW_ENTRY(attr, name) \ 1352#define DEVINET_SYSCTL_RW_ENTRY(attr, name) \
1421 DEVINET_SYSCTL_ENTRY(attr, name, 0644, devinet_conf_proc, \ 1353 DEVINET_SYSCTL_ENTRY(attr, name, 0644, devinet_conf_proc)
1422 devinet_conf_sysctl)
1423 1354
1424#define DEVINET_SYSCTL_RO_ENTRY(attr, name) \ 1355#define DEVINET_SYSCTL_RO_ENTRY(attr, name) \
1425 DEVINET_SYSCTL_ENTRY(attr, name, 0444, devinet_conf_proc, \ 1356 DEVINET_SYSCTL_ENTRY(attr, name, 0444, devinet_conf_proc)
1426 devinet_conf_sysctl)
1427 1357
1428#define DEVINET_SYSCTL_COMPLEX_ENTRY(attr, name, proc, sysctl) \ 1358#define DEVINET_SYSCTL_COMPLEX_ENTRY(attr, name, proc) \
1429 DEVINET_SYSCTL_ENTRY(attr, name, 0644, proc, sysctl) 1359 DEVINET_SYSCTL_ENTRY(attr, name, 0644, proc)
1430 1360
1431#define DEVINET_SYSCTL_FLUSHING_ENTRY(attr, name) \ 1361#define DEVINET_SYSCTL_FLUSHING_ENTRY(attr, name) \
1432 DEVINET_SYSCTL_COMPLEX_ENTRY(attr, name, ipv4_doint_and_flush, \ 1362 DEVINET_SYSCTL_COMPLEX_ENTRY(attr, name, ipv4_doint_and_flush)
1433 ipv4_doint_and_flush_strategy)
1434 1363
1435static struct devinet_sysctl_table { 1364static struct devinet_sysctl_table {
1436 struct ctl_table_header *sysctl_header; 1365 struct ctl_table_header *sysctl_header;
@@ -1439,8 +1368,7 @@ static struct devinet_sysctl_table {
1439} devinet_sysctl = { 1368} devinet_sysctl = {
1440 .devinet_vars = { 1369 .devinet_vars = {
1441 DEVINET_SYSCTL_COMPLEX_ENTRY(FORWARDING, "forwarding", 1370 DEVINET_SYSCTL_COMPLEX_ENTRY(FORWARDING, "forwarding",
1442 devinet_sysctl_forward, 1371 devinet_sysctl_forward),
1443 devinet_conf_sysctl),
1444 DEVINET_SYSCTL_RO_ENTRY(MC_FORWARDING, "mc_forwarding"), 1372 DEVINET_SYSCTL_RO_ENTRY(MC_FORWARDING, "mc_forwarding"),
1445 1373
1446 DEVINET_SYSCTL_RW_ENTRY(ACCEPT_REDIRECTS, "accept_redirects"), 1374 DEVINET_SYSCTL_RW_ENTRY(ACCEPT_REDIRECTS, "accept_redirects"),
@@ -1471,7 +1399,7 @@ static struct devinet_sysctl_table {
1471}; 1399};
1472 1400
1473static int __devinet_sysctl_register(struct net *net, char *dev_name, 1401static int __devinet_sysctl_register(struct net *net, char *dev_name,
1474 int ctl_name, struct ipv4_devconf *p) 1402 struct ipv4_devconf *p)
1475{ 1403{
1476 int i; 1404 int i;
1477 struct devinet_sysctl_table *t; 1405 struct devinet_sysctl_table *t;
@@ -1479,9 +1407,9 @@ static int __devinet_sysctl_register(struct net *net, char *dev_name,
1479#define DEVINET_CTL_PATH_DEV 3 1407#define DEVINET_CTL_PATH_DEV 3
1480 1408
1481 struct ctl_path devinet_ctl_path[] = { 1409 struct ctl_path devinet_ctl_path[] = {
1482 { .procname = "net", .ctl_name = CTL_NET, }, 1410 { .procname = "net", },
1483 { .procname = "ipv4", .ctl_name = NET_IPV4, }, 1411 { .procname = "ipv4", },
1484 { .procname = "conf", .ctl_name = NET_IPV4_CONF, }, 1412 { .procname = "conf", },
1485 { /* to be set */ }, 1413 { /* to be set */ },
1486 { }, 1414 { },
1487 }; 1415 };
@@ -1506,7 +1434,6 @@ static int __devinet_sysctl_register(struct net *net, char *dev_name,
1506 goto free; 1434 goto free;
1507 1435
1508 devinet_ctl_path[DEVINET_CTL_PATH_DEV].procname = t->dev_name; 1436 devinet_ctl_path[DEVINET_CTL_PATH_DEV].procname = t->dev_name;
1509 devinet_ctl_path[DEVINET_CTL_PATH_DEV].ctl_name = ctl_name;
1510 1437
1511 t->sysctl_header = register_net_sysctl_table(net, devinet_ctl_path, 1438 t->sysctl_header = register_net_sysctl_table(net, devinet_ctl_path,
1512 t->devinet_vars); 1439 t->devinet_vars);
@@ -1540,9 +1467,9 @@ static void __devinet_sysctl_unregister(struct ipv4_devconf *cnf)
1540static void devinet_sysctl_register(struct in_device *idev) 1467static void devinet_sysctl_register(struct in_device *idev)
1541{ 1468{
1542 neigh_sysctl_register(idev->dev, idev->arp_parms, NET_IPV4, 1469 neigh_sysctl_register(idev->dev, idev->arp_parms, NET_IPV4,
1543 NET_IPV4_NEIGH, "ipv4", NULL, NULL); 1470 NET_IPV4_NEIGH, "ipv4", NULL);
1544 __devinet_sysctl_register(dev_net(idev->dev), idev->dev->name, 1471 __devinet_sysctl_register(dev_net(idev->dev), idev->dev->name,
1545 idev->dev->ifindex, &idev->cnf); 1472 &idev->cnf);
1546} 1473}
1547 1474
1548static void devinet_sysctl_unregister(struct in_device *idev) 1475static void devinet_sysctl_unregister(struct in_device *idev)
@@ -1553,14 +1480,12 @@ static void devinet_sysctl_unregister(struct in_device *idev)
1553 1480
1554static struct ctl_table ctl_forward_entry[] = { 1481static struct ctl_table ctl_forward_entry[] = {
1555 { 1482 {
1556 .ctl_name = NET_IPV4_FORWARD,
1557 .procname = "ip_forward", 1483 .procname = "ip_forward",
1558 .data = &ipv4_devconf.data[ 1484 .data = &ipv4_devconf.data[
1559 NET_IPV4_CONF_FORWARDING - 1], 1485 NET_IPV4_CONF_FORWARDING - 1],
1560 .maxlen = sizeof(int), 1486 .maxlen = sizeof(int),
1561 .mode = 0644, 1487 .mode = 0644,
1562 .proc_handler = devinet_sysctl_forward, 1488 .proc_handler = devinet_sysctl_forward,
1563 .strategy = devinet_conf_sysctl,
1564 .extra1 = &ipv4_devconf, 1489 .extra1 = &ipv4_devconf,
1565 .extra2 = &init_net, 1490 .extra2 = &init_net,
1566 }, 1491 },
@@ -1568,8 +1493,8 @@ static struct ctl_table ctl_forward_entry[] = {
1568}; 1493};
1569 1494
1570static __net_initdata struct ctl_path net_ipv4_path[] = { 1495static __net_initdata struct ctl_path net_ipv4_path[] = {
1571 { .procname = "net", .ctl_name = CTL_NET, }, 1496 { .procname = "net", },
1572 { .procname = "ipv4", .ctl_name = NET_IPV4, }, 1497 { .procname = "ipv4", },
1573 { }, 1498 { },
1574}; 1499};
1575#endif 1500#endif
@@ -1608,13 +1533,11 @@ static __net_init int devinet_init_net(struct net *net)
1608 } 1533 }
1609 1534
1610#ifdef CONFIG_SYSCTL 1535#ifdef CONFIG_SYSCTL
1611 err = __devinet_sysctl_register(net, "all", 1536 err = __devinet_sysctl_register(net, "all", all);
1612 NET_PROTO_CONF_ALL, all);
1613 if (err < 0) 1537 if (err < 0)
1614 goto err_reg_all; 1538 goto err_reg_all;
1615 1539
1616 err = __devinet_sysctl_register(net, "default", 1540 err = __devinet_sysctl_register(net, "default", dflt);
1617 NET_PROTO_CONF_DEFAULT, dflt);
1618 if (err < 0) 1541 if (err < 0)
1619 goto err_reg_dflt; 1542 goto err_reg_dflt;
1620 1543
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index 575f9bd51ccd..ef24497436fd 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -603,7 +603,6 @@ static int zero;
603 603
604static struct ctl_table ip4_frags_ns_ctl_table[] = { 604static struct ctl_table ip4_frags_ns_ctl_table[] = {
605 { 605 {
606 .ctl_name = NET_IPV4_IPFRAG_HIGH_THRESH,
607 .procname = "ipfrag_high_thresh", 606 .procname = "ipfrag_high_thresh",
608 .data = &init_net.ipv4.frags.high_thresh, 607 .data = &init_net.ipv4.frags.high_thresh,
609 .maxlen = sizeof(int), 608 .maxlen = sizeof(int),
@@ -611,7 +610,6 @@ static struct ctl_table ip4_frags_ns_ctl_table[] = {
611 .proc_handler = proc_dointvec 610 .proc_handler = proc_dointvec
612 }, 611 },
613 { 612 {
614 .ctl_name = NET_IPV4_IPFRAG_LOW_THRESH,
615 .procname = "ipfrag_low_thresh", 613 .procname = "ipfrag_low_thresh",
616 .data = &init_net.ipv4.frags.low_thresh, 614 .data = &init_net.ipv4.frags.low_thresh,
617 .maxlen = sizeof(int), 615 .maxlen = sizeof(int),
@@ -619,26 +617,22 @@ static struct ctl_table ip4_frags_ns_ctl_table[] = {
619 .proc_handler = proc_dointvec 617 .proc_handler = proc_dointvec
620 }, 618 },
621 { 619 {
622 .ctl_name = NET_IPV4_IPFRAG_TIME,
623 .procname = "ipfrag_time", 620 .procname = "ipfrag_time",
624 .data = &init_net.ipv4.frags.timeout, 621 .data = &init_net.ipv4.frags.timeout,
625 .maxlen = sizeof(int), 622 .maxlen = sizeof(int),
626 .mode = 0644, 623 .mode = 0644,
627 .proc_handler = proc_dointvec_jiffies, 624 .proc_handler = proc_dointvec_jiffies,
628 .strategy = sysctl_jiffies
629 }, 625 },
630 { } 626 { }
631}; 627};
632 628
633static struct ctl_table ip4_frags_ctl_table[] = { 629static struct ctl_table ip4_frags_ctl_table[] = {
634 { 630 {
635 .ctl_name = NET_IPV4_IPFRAG_SECRET_INTERVAL,
636 .procname = "ipfrag_secret_interval", 631 .procname = "ipfrag_secret_interval",
637 .data = &ip4_frags.secret_interval, 632 .data = &ip4_frags.secret_interval,
638 .maxlen = sizeof(int), 633 .maxlen = sizeof(int),
639 .mode = 0644, 634 .mode = 0644,
640 .proc_handler = proc_dointvec_jiffies, 635 .proc_handler = proc_dointvec_jiffies,
641 .strategy = sysctl_jiffies
642 }, 636 },
643 { 637 {
644 .procname = "ipfrag_max_dist", 638 .procname = "ipfrag_max_dist",
diff --git a/net/ipv4/netfilter.c b/net/ipv4/netfilter.c
index 1725dc0ef688..db52c0cb0c11 100644
--- a/net/ipv4/netfilter.c
+++ b/net/ipv4/netfilter.c
@@ -248,9 +248,9 @@ module_exit(ipv4_netfilter_fini);
248 248
249#ifdef CONFIG_SYSCTL 249#ifdef CONFIG_SYSCTL
250struct ctl_path nf_net_ipv4_netfilter_sysctl_path[] = { 250struct ctl_path nf_net_ipv4_netfilter_sysctl_path[] = {
251 { .procname = "net", .ctl_name = CTL_NET, }, 251 { .procname = "net", },
252 { .procname = "ipv4", .ctl_name = NET_IPV4, }, 252 { .procname = "ipv4", },
253 { .procname = "netfilter", .ctl_name = NET_IPV4_NETFILTER, }, 253 { .procname = "netfilter", },
254 { } 254 { }
255}; 255};
256EXPORT_SYMBOL_GPL(nf_net_ipv4_netfilter_sysctl_path); 256EXPORT_SYMBOL_GPL(nf_net_ipv4_netfilter_sysctl_path);
diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c
index c156db215987..c9f90e8c5191 100644
--- a/net/ipv4/netfilter/ip_queue.c
+++ b/net/ipv4/netfilter/ip_queue.c
@@ -516,14 +516,13 @@ static struct ctl_table_header *ipq_sysctl_header;
516 516
517static ctl_table ipq_table[] = { 517static ctl_table ipq_table[] = {
518 { 518 {
519 .ctl_name = NET_IPQ_QMAX,
520 .procname = NET_IPQ_QMAX_NAME, 519 .procname = NET_IPQ_QMAX_NAME,
521 .data = &queue_maxlen, 520 .data = &queue_maxlen,
522 .maxlen = sizeof(queue_maxlen), 521 .maxlen = sizeof(queue_maxlen),
523 .mode = 0644, 522 .mode = 0644,
524 .proc_handler = proc_dointvec 523 .proc_handler = proc_dointvec
525 }, 524 },
526 { .ctl_name = 0 } 525 { }
527}; 526};
528#endif 527#endif
529 528
diff --git a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
index aa95bb82ee6c..092d68f916e6 100644
--- a/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
+++ b/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
@@ -195,7 +195,6 @@ static int log_invalid_proto_max = 255;
195 195
196static ctl_table ip_ct_sysctl_table[] = { 196static ctl_table ip_ct_sysctl_table[] = {
197 { 197 {
198 .ctl_name = NET_IPV4_NF_CONNTRACK_MAX,
199 .procname = "ip_conntrack_max", 198 .procname = "ip_conntrack_max",
200 .data = &nf_conntrack_max, 199 .data = &nf_conntrack_max,
201 .maxlen = sizeof(int), 200 .maxlen = sizeof(int),
@@ -203,7 +202,6 @@ static ctl_table ip_ct_sysctl_table[] = {
203 .proc_handler = proc_dointvec, 202 .proc_handler = proc_dointvec,
204 }, 203 },
205 { 204 {
206 .ctl_name = NET_IPV4_NF_CONNTRACK_COUNT,
207 .procname = "ip_conntrack_count", 205 .procname = "ip_conntrack_count",
208 .data = &init_net.ct.count, 206 .data = &init_net.ct.count,
209 .maxlen = sizeof(int), 207 .maxlen = sizeof(int),
@@ -211,7 +209,6 @@ static ctl_table ip_ct_sysctl_table[] = {
211 .proc_handler = proc_dointvec, 209 .proc_handler = proc_dointvec,
212 }, 210 },
213 { 211 {
214 .ctl_name = NET_IPV4_NF_CONNTRACK_BUCKETS,
215 .procname = "ip_conntrack_buckets", 212 .procname = "ip_conntrack_buckets",
216 .data = &nf_conntrack_htable_size, 213 .data = &nf_conntrack_htable_size,
217 .maxlen = sizeof(unsigned int), 214 .maxlen = sizeof(unsigned int),
@@ -219,7 +216,6 @@ static ctl_table ip_ct_sysctl_table[] = {
219 .proc_handler = proc_dointvec, 216 .proc_handler = proc_dointvec,
220 }, 217 },
221 { 218 {
222 .ctl_name = NET_IPV4_NF_CONNTRACK_CHECKSUM,
223 .procname = "ip_conntrack_checksum", 219 .procname = "ip_conntrack_checksum",
224 .data = &init_net.ct.sysctl_checksum, 220 .data = &init_net.ct.sysctl_checksum,
225 .maxlen = sizeof(int), 221 .maxlen = sizeof(int),
@@ -227,19 +223,15 @@ static ctl_table ip_ct_sysctl_table[] = {
227 .proc_handler = proc_dointvec, 223 .proc_handler = proc_dointvec,
228 }, 224 },
229 { 225 {
230 .ctl_name = NET_IPV4_NF_CONNTRACK_LOG_INVALID,
231 .procname = "ip_conntrack_log_invalid", 226 .procname = "ip_conntrack_log_invalid",
232 .data = &init_net.ct.sysctl_log_invalid, 227 .data = &init_net.ct.sysctl_log_invalid,
233 .maxlen = sizeof(unsigned int), 228 .maxlen = sizeof(unsigned int),
234 .mode = 0644, 229 .mode = 0644,
235 .proc_handler = proc_dointvec_minmax, 230 .proc_handler = proc_dointvec_minmax,
236 .strategy = sysctl_intvec,
237 .extra1 = &log_invalid_proto_min, 231 .extra1 = &log_invalid_proto_min,
238 .extra2 = &log_invalid_proto_max, 232 .extra2 = &log_invalid_proto_max,
239 }, 233 },
240 { 234 { }
241 .ctl_name = 0
242 }
243}; 235};
244#endif /* CONFIG_SYSCTL && CONFIG_NF_CONNTRACK_PROC_COMPAT */ 236#endif /* CONFIG_SYSCTL && CONFIG_NF_CONNTRACK_PROC_COMPAT */
245 237
diff --git a/net/ipv4/netfilter/nf_conntrack_proto_icmp.c b/net/ipv4/netfilter/nf_conntrack_proto_icmp.c
index d71ba7677344..9072058778b8 100644
--- a/net/ipv4/netfilter/nf_conntrack_proto_icmp.c
+++ b/net/ipv4/netfilter/nf_conntrack_proto_icmp.c
@@ -270,9 +270,7 @@ static struct ctl_table icmp_sysctl_table[] = {
270 .mode = 0644, 270 .mode = 0644,
271 .proc_handler = proc_dointvec_jiffies, 271 .proc_handler = proc_dointvec_jiffies,
272 }, 272 },
273 { 273 { }
274 .ctl_name = 0
275 }
276}; 274};
277#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT 275#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
278static struct ctl_table icmp_compat_sysctl_table[] = { 276static struct ctl_table icmp_compat_sysctl_table[] = {
@@ -283,9 +281,7 @@ static struct ctl_table icmp_compat_sysctl_table[] = {
283 .mode = 0644, 281 .mode = 0644,
284 .proc_handler = proc_dointvec_jiffies, 282 .proc_handler = proc_dointvec_jiffies,
285 }, 283 },
286 { 284 { }
287 .ctl_name = 0
288 }
289}; 285};
290#endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */ 286#endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */
291#endif /* CONFIG_SYSCTL */ 287#endif /* CONFIG_SYSCTL */
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 5b1050a5d874..0d9f584a3811 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -3056,23 +3056,6 @@ static int ipv4_sysctl_rtcache_flush(ctl_table *__ctl, int write,
3056 return -EINVAL; 3056 return -EINVAL;
3057} 3057}
3058 3058
3059static int ipv4_sysctl_rtcache_flush_strategy(ctl_table *table,
3060 void __user *oldval,
3061 size_t __user *oldlenp,
3062 void __user *newval,
3063 size_t newlen)
3064{
3065 int delay;
3066 struct net *net;
3067 if (newlen != sizeof(int))
3068 return -EINVAL;
3069 if (get_user(delay, (int __user *)newval))
3070 return -EFAULT;
3071 net = (struct net *)table->extra1;
3072 rt_cache_flush(net, delay);
3073 return 0;
3074}
3075
3076static void rt_secret_reschedule(int old) 3059static void rt_secret_reschedule(int old)
3077{ 3060{
3078 struct net *net; 3061 struct net *net;
@@ -3117,23 +3100,8 @@ static int ipv4_sysctl_rt_secret_interval(ctl_table *ctl, int write,
3117 return ret; 3100 return ret;
3118} 3101}
3119 3102
3120static int ipv4_sysctl_rt_secret_interval_strategy(ctl_table *table,
3121 void __user *oldval,
3122 size_t __user *oldlenp,
3123 void __user *newval,
3124 size_t newlen)
3125{
3126 int old = ip_rt_secret_interval;
3127 int ret = sysctl_jiffies(table, oldval, oldlenp, newval, newlen);
3128
3129 rt_secret_reschedule(old);
3130
3131 return ret;
3132}
3133
3134static ctl_table ipv4_route_table[] = { 3103static ctl_table ipv4_route_table[] = {
3135 { 3104 {
3136 .ctl_name = NET_IPV4_ROUTE_GC_THRESH,
3137 .procname = "gc_thresh", 3105 .procname = "gc_thresh",
3138 .data = &ipv4_dst_ops.gc_thresh, 3106 .data = &ipv4_dst_ops.gc_thresh,
3139 .maxlen = sizeof(int), 3107 .maxlen = sizeof(int),
@@ -3141,7 +3109,6 @@ static ctl_table ipv4_route_table[] = {
3141 .proc_handler = proc_dointvec, 3109 .proc_handler = proc_dointvec,
3142 }, 3110 },
3143 { 3111 {
3144 .ctl_name = NET_IPV4_ROUTE_MAX_SIZE,
3145 .procname = "max_size", 3112 .procname = "max_size",
3146 .data = &ip_rt_max_size, 3113 .data = &ip_rt_max_size,
3147 .maxlen = sizeof(int), 3114 .maxlen = sizeof(int),
@@ -3151,43 +3118,34 @@ static ctl_table ipv4_route_table[] = {
3151 { 3118 {
3152 /* Deprecated. Use gc_min_interval_ms */ 3119 /* Deprecated. Use gc_min_interval_ms */
3153 3120
3154 .ctl_name = NET_IPV4_ROUTE_GC_MIN_INTERVAL,
3155 .procname = "gc_min_interval", 3121 .procname = "gc_min_interval",
3156 .data = &ip_rt_gc_min_interval, 3122 .data = &ip_rt_gc_min_interval,
3157 .maxlen = sizeof(int), 3123 .maxlen = sizeof(int),
3158 .mode = 0644, 3124 .mode = 0644,
3159 .proc_handler = proc_dointvec_jiffies, 3125 .proc_handler = proc_dointvec_jiffies,
3160 .strategy = sysctl_jiffies,
3161 }, 3126 },
3162 { 3127 {
3163 .ctl_name = NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS,
3164 .procname = "gc_min_interval_ms", 3128 .procname = "gc_min_interval_ms",
3165 .data = &ip_rt_gc_min_interval, 3129 .data = &ip_rt_gc_min_interval,
3166 .maxlen = sizeof(int), 3130 .maxlen = sizeof(int),
3167 .mode = 0644, 3131 .mode = 0644,
3168 .proc_handler = proc_dointvec_ms_jiffies, 3132 .proc_handler = proc_dointvec_ms_jiffies,
3169 .strategy = sysctl_ms_jiffies,
3170 }, 3133 },
3171 { 3134 {
3172 .ctl_name = NET_IPV4_ROUTE_GC_TIMEOUT,
3173 .procname = "gc_timeout", 3135 .procname = "gc_timeout",
3174 .data = &ip_rt_gc_timeout, 3136 .data = &ip_rt_gc_timeout,
3175 .maxlen = sizeof(int), 3137 .maxlen = sizeof(int),
3176 .mode = 0644, 3138 .mode = 0644,
3177 .proc_handler = proc_dointvec_jiffies, 3139 .proc_handler = proc_dointvec_jiffies,
3178 .strategy = sysctl_jiffies,
3179 }, 3140 },
3180 { 3141 {
3181 .ctl_name = NET_IPV4_ROUTE_GC_INTERVAL,
3182 .procname = "gc_interval", 3142 .procname = "gc_interval",
3183 .data = &ip_rt_gc_interval, 3143 .data = &ip_rt_gc_interval,
3184 .maxlen = sizeof(int), 3144 .maxlen = sizeof(int),
3185 .mode = 0644, 3145 .mode = 0644,
3186 .proc_handler = proc_dointvec_jiffies, 3146 .proc_handler = proc_dointvec_jiffies,
3187 .strategy = sysctl_jiffies,
3188 }, 3147 },
3189 { 3148 {
3190 .ctl_name = NET_IPV4_ROUTE_REDIRECT_LOAD,
3191 .procname = "redirect_load", 3149 .procname = "redirect_load",
3192 .data = &ip_rt_redirect_load, 3150 .data = &ip_rt_redirect_load,
3193 .maxlen = sizeof(int), 3151 .maxlen = sizeof(int),
@@ -3195,7 +3153,6 @@ static ctl_table ipv4_route_table[] = {
3195 .proc_handler = proc_dointvec, 3153 .proc_handler = proc_dointvec,
3196 }, 3154 },
3197 { 3155 {
3198 .ctl_name = NET_IPV4_ROUTE_REDIRECT_NUMBER,
3199 .procname = "redirect_number", 3156 .procname = "redirect_number",
3200 .data = &ip_rt_redirect_number, 3157 .data = &ip_rt_redirect_number,
3201 .maxlen = sizeof(int), 3158 .maxlen = sizeof(int),
@@ -3203,7 +3160,6 @@ static ctl_table ipv4_route_table[] = {
3203 .proc_handler = proc_dointvec, 3160 .proc_handler = proc_dointvec,
3204 }, 3161 },
3205 { 3162 {
3206 .ctl_name = NET_IPV4_ROUTE_REDIRECT_SILENCE,
3207 .procname = "redirect_silence", 3163 .procname = "redirect_silence",
3208 .data = &ip_rt_redirect_silence, 3164 .data = &ip_rt_redirect_silence,
3209 .maxlen = sizeof(int), 3165 .maxlen = sizeof(int),
@@ -3211,7 +3167,6 @@ static ctl_table ipv4_route_table[] = {
3211 .proc_handler = proc_dointvec, 3167 .proc_handler = proc_dointvec,
3212 }, 3168 },
3213 { 3169 {
3214 .ctl_name = NET_IPV4_ROUTE_ERROR_COST,
3215 .procname = "error_cost", 3170 .procname = "error_cost",
3216 .data = &ip_rt_error_cost, 3171 .data = &ip_rt_error_cost,
3217 .maxlen = sizeof(int), 3172 .maxlen = sizeof(int),
@@ -3219,7 +3174,6 @@ static ctl_table ipv4_route_table[] = {
3219 .proc_handler = proc_dointvec, 3174 .proc_handler = proc_dointvec,
3220 }, 3175 },
3221 { 3176 {
3222 .ctl_name = NET_IPV4_ROUTE_ERROR_BURST,
3223 .procname = "error_burst", 3177 .procname = "error_burst",
3224 .data = &ip_rt_error_burst, 3178 .data = &ip_rt_error_burst,
3225 .maxlen = sizeof(int), 3179 .maxlen = sizeof(int),
@@ -3227,7 +3181,6 @@ static ctl_table ipv4_route_table[] = {
3227 .proc_handler = proc_dointvec, 3181 .proc_handler = proc_dointvec,
3228 }, 3182 },
3229 { 3183 {
3230 .ctl_name = NET_IPV4_ROUTE_GC_ELASTICITY,
3231 .procname = "gc_elasticity", 3184 .procname = "gc_elasticity",
3232 .data = &ip_rt_gc_elasticity, 3185 .data = &ip_rt_gc_elasticity,
3233 .maxlen = sizeof(int), 3186 .maxlen = sizeof(int),
@@ -3235,16 +3188,13 @@ static ctl_table ipv4_route_table[] = {
3235 .proc_handler = proc_dointvec, 3188 .proc_handler = proc_dointvec,
3236 }, 3189 },
3237 { 3190 {
3238 .ctl_name = NET_IPV4_ROUTE_MTU_EXPIRES,
3239 .procname = "mtu_expires", 3191 .procname = "mtu_expires",
3240 .data = &ip_rt_mtu_expires, 3192 .data = &ip_rt_mtu_expires,
3241 .maxlen = sizeof(int), 3193 .maxlen = sizeof(int),
3242 .mode = 0644, 3194 .mode = 0644,
3243 .proc_handler = proc_dointvec_jiffies, 3195 .proc_handler = proc_dointvec_jiffies,
3244 .strategy = sysctl_jiffies,
3245 }, 3196 },
3246 { 3197 {
3247 .ctl_name = NET_IPV4_ROUTE_MIN_PMTU,
3248 .procname = "min_pmtu", 3198 .procname = "min_pmtu",
3249 .data = &ip_rt_min_pmtu, 3199 .data = &ip_rt_min_pmtu,
3250 .maxlen = sizeof(int), 3200 .maxlen = sizeof(int),
@@ -3252,7 +3202,6 @@ static ctl_table ipv4_route_table[] = {
3252 .proc_handler = proc_dointvec, 3202 .proc_handler = proc_dointvec,
3253 }, 3203 },
3254 { 3204 {
3255 .ctl_name = NET_IPV4_ROUTE_MIN_ADVMSS,
3256 .procname = "min_adv_mss", 3205 .procname = "min_adv_mss",
3257 .data = &ip_rt_min_advmss, 3206 .data = &ip_rt_min_advmss,
3258 .maxlen = sizeof(int), 3207 .maxlen = sizeof(int),
@@ -3260,50 +3209,46 @@ static ctl_table ipv4_route_table[] = {
3260 .proc_handler = proc_dointvec, 3209 .proc_handler = proc_dointvec,
3261 }, 3210 },
3262 { 3211 {
3263 .ctl_name = NET_IPV4_ROUTE_SECRET_INTERVAL,
3264 .procname = "secret_interval", 3212 .procname = "secret_interval",
3265 .data = &ip_rt_secret_interval, 3213 .data = &ip_rt_secret_interval,
3266 .maxlen = sizeof(int), 3214 .maxlen = sizeof(int),
3267 .mode = 0644, 3215 .mode = 0644,
3268 .proc_handler = ipv4_sysctl_rt_secret_interval, 3216 .proc_handler = ipv4_sysctl_rt_secret_interval,
3269 .strategy = ipv4_sysctl_rt_secret_interval_strategy,
3270 }, 3217 },
3271 { .ctl_name = 0 } 3218 { }
3272}; 3219};
3273 3220
3274static struct ctl_table empty[1]; 3221static struct ctl_table empty[1];
3275 3222
3276static struct ctl_table ipv4_skeleton[] = 3223static struct ctl_table ipv4_skeleton[] =
3277{ 3224{
3278 { .procname = "route", .ctl_name = NET_IPV4_ROUTE, 3225 { .procname = "route",
3279 .mode = 0555, .child = ipv4_route_table}, 3226 .mode = 0555, .child = ipv4_route_table},
3280 { .procname = "neigh", .ctl_name = NET_IPV4_NEIGH, 3227 { .procname = "neigh",
3281 .mode = 0555, .child = empty}, 3228 .mode = 0555, .child = empty},
3282 { } 3229 { }
3283}; 3230};
3284 3231
3285static __net_initdata struct ctl_path ipv4_path[] = { 3232static __net_initdata struct ctl_path ipv4_path[] = {
3286 { .procname = "net", .ctl_name = CTL_NET, }, 3233 { .procname = "net", },
3287 { .procname = "ipv4", .ctl_name = NET_IPV4, }, 3234 { .procname = "ipv4", },
3288 { }, 3235 { },
3289}; 3236};
3290 3237
3291static struct ctl_table ipv4_route_flush_table[] = { 3238static struct ctl_table ipv4_route_flush_table[] = {
3292 { 3239 {
3293 .ctl_name = NET_IPV4_ROUTE_FLUSH,
3294 .procname = "flush", 3240 .procname = "flush",
3295 .maxlen = sizeof(int), 3241 .maxlen = sizeof(int),
3296 .mode = 0200, 3242 .mode = 0200,
3297 .proc_handler = ipv4_sysctl_rtcache_flush, 3243 .proc_handler = ipv4_sysctl_rtcache_flush,
3298 .strategy = ipv4_sysctl_rtcache_flush_strategy,
3299 }, 3244 },
3300 { .ctl_name = 0 }, 3245 { },
3301}; 3246};
3302 3247
3303static __net_initdata struct ctl_path ipv4_route_path[] = { 3248static __net_initdata struct ctl_path ipv4_route_path[] = {
3304 { .procname = "net", .ctl_name = CTL_NET, }, 3249 { .procname = "net", },
3305 { .procname = "ipv4", .ctl_name = NET_IPV4, }, 3250 { .procname = "ipv4", },
3306 { .procname = "route", .ctl_name = NET_IPV4_ROUTE, }, 3251 { .procname = "route", },
3307 { }, 3252 { },
3308}; 3253};
3309 3254
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index 2dcf04d9b005..300056732953 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -63,34 +63,6 @@ static int ipv4_local_port_range(ctl_table *table, int write,
63 return ret; 63 return ret;
64} 64}
65 65
66/* Validate changes from sysctl interface. */
67static int ipv4_sysctl_local_port_range(ctl_table *table,
68 void __user *oldval,
69 size_t __user *oldlenp,
70 void __user *newval, size_t newlen)
71{
72 int ret;
73 int range[2];
74 ctl_table tmp = {
75 .data = &range,
76 .maxlen = sizeof(range),
77 .mode = table->mode,
78 .extra1 = &ip_local_port_range_min,
79 .extra2 = &ip_local_port_range_max,
80 };
81
82 inet_get_local_port_range(range, range + 1);
83 ret = sysctl_intvec(&tmp, oldval, oldlenp, newval, newlen);
84 if (ret == 0 && newval && newlen) {
85 if (range[1] < range[0])
86 ret = -EINVAL;
87 else
88 set_local_port_range(range);
89 }
90 return ret;
91}
92
93
94static int proc_tcp_congestion_control(ctl_table *ctl, int write, 66static int proc_tcp_congestion_control(ctl_table *ctl, int write,
95 void __user *buffer, size_t *lenp, loff_t *ppos) 67 void __user *buffer, size_t *lenp, loff_t *ppos)
96{ 68{
@@ -109,25 +81,6 @@ static int proc_tcp_congestion_control(ctl_table *ctl, int write,
109 return ret; 81 return ret;
110} 82}
111 83
112static int sysctl_tcp_congestion_control(ctl_table *table,
113 void __user *oldval,
114 size_t __user *oldlenp,
115 void __user *newval, size_t newlen)
116{
117 char val[TCP_CA_NAME_MAX];
118 ctl_table tbl = {
119 .data = val,
120 .maxlen = TCP_CA_NAME_MAX,
121 };
122 int ret;
123
124 tcp_get_default_congestion_control(val);
125 ret = sysctl_string(&tbl, oldval, oldlenp, newval, newlen);
126 if (ret == 1 && newval && newlen)
127 ret = tcp_set_default_congestion_control(val);
128 return ret;
129}
130
131static int proc_tcp_available_congestion_control(ctl_table *ctl, 84static int proc_tcp_available_congestion_control(ctl_table *ctl,
132 int write, 85 int write,
133 void __user *buffer, size_t *lenp, 86 void __user *buffer, size_t *lenp,
@@ -165,32 +118,8 @@ static int proc_allowed_congestion_control(ctl_table *ctl,
165 return ret; 118 return ret;
166} 119}
167 120
168static int strategy_allowed_congestion_control(ctl_table *table,
169 void __user *oldval,
170 size_t __user *oldlenp,
171 void __user *newval,
172 size_t newlen)
173{
174 ctl_table tbl = { .maxlen = TCP_CA_BUF_MAX };
175 int ret;
176
177 tbl.data = kmalloc(tbl.maxlen, GFP_USER);
178 if (!tbl.data)
179 return -ENOMEM;
180
181 tcp_get_available_congestion_control(tbl.data, tbl.maxlen);
182 ret = sysctl_string(&tbl, oldval, oldlenp, newval, newlen);
183 if (ret == 1 && newval && newlen)
184 ret = tcp_set_allowed_congestion_control(tbl.data);
185 kfree(tbl.data);
186
187 return ret;
188
189}
190
191static struct ctl_table ipv4_table[] = { 121static struct ctl_table ipv4_table[] = {
192 { 122 {
193 .ctl_name = NET_IPV4_TCP_TIMESTAMPS,
194 .procname = "tcp_timestamps", 123 .procname = "tcp_timestamps",
195 .data = &sysctl_tcp_timestamps, 124 .data = &sysctl_tcp_timestamps,
196 .maxlen = sizeof(int), 125 .maxlen = sizeof(int),
@@ -198,7 +127,6 @@ static struct ctl_table ipv4_table[] = {
198 .proc_handler = proc_dointvec 127 .proc_handler = proc_dointvec
199 }, 128 },
200 { 129 {
201 .ctl_name = NET_IPV4_TCP_WINDOW_SCALING,
202 .procname = "tcp_window_scaling", 130 .procname = "tcp_window_scaling",
203 .data = &sysctl_tcp_window_scaling, 131 .data = &sysctl_tcp_window_scaling,
204 .maxlen = sizeof(int), 132 .maxlen = sizeof(int),
@@ -206,7 +134,6 @@ static struct ctl_table ipv4_table[] = {
206 .proc_handler = proc_dointvec 134 .proc_handler = proc_dointvec
207 }, 135 },
208 { 136 {
209 .ctl_name = NET_IPV4_TCP_SACK,
210 .procname = "tcp_sack", 137 .procname = "tcp_sack",
211 .data = &sysctl_tcp_sack, 138 .data = &sysctl_tcp_sack,
212 .maxlen = sizeof(int), 139 .maxlen = sizeof(int),
@@ -214,7 +141,6 @@ static struct ctl_table ipv4_table[] = {
214 .proc_handler = proc_dointvec 141 .proc_handler = proc_dointvec
215 }, 142 },
216 { 143 {
217 .ctl_name = NET_IPV4_TCP_RETRANS_COLLAPSE,
218 .procname = "tcp_retrans_collapse", 144 .procname = "tcp_retrans_collapse",
219 .data = &sysctl_tcp_retrans_collapse, 145 .data = &sysctl_tcp_retrans_collapse,
220 .maxlen = sizeof(int), 146 .maxlen = sizeof(int),
@@ -222,17 +148,14 @@ static struct ctl_table ipv4_table[] = {
222 .proc_handler = proc_dointvec 148 .proc_handler = proc_dointvec
223 }, 149 },
224 { 150 {
225 .ctl_name = NET_IPV4_DEFAULT_TTL,
226 .procname = "ip_default_ttl", 151 .procname = "ip_default_ttl",
227 .data = &sysctl_ip_default_ttl, 152 .data = &sysctl_ip_default_ttl,
228 .maxlen = sizeof(int), 153 .maxlen = sizeof(int),
229 .mode = 0644, 154 .mode = 0644,
230 .proc_handler = ipv4_doint_and_flush, 155 .proc_handler = ipv4_doint_and_flush,
231 .strategy = ipv4_doint_and_flush_strategy,
232 .extra2 = &init_net, 156 .extra2 = &init_net,
233 }, 157 },
234 { 158 {
235 .ctl_name = NET_IPV4_NO_PMTU_DISC,
236 .procname = "ip_no_pmtu_disc", 159 .procname = "ip_no_pmtu_disc",
237 .data = &ipv4_config.no_pmtu_disc, 160 .data = &ipv4_config.no_pmtu_disc,
238 .maxlen = sizeof(int), 161 .maxlen = sizeof(int),
@@ -240,7 +163,6 @@ static struct ctl_table ipv4_table[] = {
240 .proc_handler = proc_dointvec 163 .proc_handler = proc_dointvec
241 }, 164 },
242 { 165 {
243 .ctl_name = NET_IPV4_NONLOCAL_BIND,
244 .procname = "ip_nonlocal_bind", 166 .procname = "ip_nonlocal_bind",
245 .data = &sysctl_ip_nonlocal_bind, 167 .data = &sysctl_ip_nonlocal_bind,
246 .maxlen = sizeof(int), 168 .maxlen = sizeof(int),
@@ -248,7 +170,6 @@ static struct ctl_table ipv4_table[] = {
248 .proc_handler = proc_dointvec 170 .proc_handler = proc_dointvec
249 }, 171 },
250 { 172 {
251 .ctl_name = NET_IPV4_TCP_SYN_RETRIES,
252 .procname = "tcp_syn_retries", 173 .procname = "tcp_syn_retries",
253 .data = &sysctl_tcp_syn_retries, 174 .data = &sysctl_tcp_syn_retries,
254 .maxlen = sizeof(int), 175 .maxlen = sizeof(int),
@@ -256,7 +177,6 @@ static struct ctl_table ipv4_table[] = {
256 .proc_handler = proc_dointvec 177 .proc_handler = proc_dointvec
257 }, 178 },
258 { 179 {
259 .ctl_name = NET_TCP_SYNACK_RETRIES,
260 .procname = "tcp_synack_retries", 180 .procname = "tcp_synack_retries",
261 .data = &sysctl_tcp_synack_retries, 181 .data = &sysctl_tcp_synack_retries,
262 .maxlen = sizeof(int), 182 .maxlen = sizeof(int),
@@ -264,7 +184,6 @@ static struct ctl_table ipv4_table[] = {
264 .proc_handler = proc_dointvec 184 .proc_handler = proc_dointvec
265 }, 185 },
266 { 186 {
267 .ctl_name = NET_TCP_MAX_ORPHANS,
268 .procname = "tcp_max_orphans", 187 .procname = "tcp_max_orphans",
269 .data = &sysctl_tcp_max_orphans, 188 .data = &sysctl_tcp_max_orphans,
270 .maxlen = sizeof(int), 189 .maxlen = sizeof(int),
@@ -272,7 +191,6 @@ static struct ctl_table ipv4_table[] = {
272 .proc_handler = proc_dointvec 191 .proc_handler = proc_dointvec
273 }, 192 },
274 { 193 {
275 .ctl_name = NET_TCP_MAX_TW_BUCKETS,
276 .procname = "tcp_max_tw_buckets", 194 .procname = "tcp_max_tw_buckets",
277 .data = &tcp_death_row.sysctl_max_tw_buckets, 195 .data = &tcp_death_row.sysctl_max_tw_buckets,
278 .maxlen = sizeof(int), 196 .maxlen = sizeof(int),
@@ -280,7 +198,6 @@ static struct ctl_table ipv4_table[] = {
280 .proc_handler = proc_dointvec 198 .proc_handler = proc_dointvec
281 }, 199 },
282 { 200 {
283 .ctl_name = NET_IPV4_DYNADDR,
284 .procname = "ip_dynaddr", 201 .procname = "ip_dynaddr",
285 .data = &sysctl_ip_dynaddr, 202 .data = &sysctl_ip_dynaddr,
286 .maxlen = sizeof(int), 203 .maxlen = sizeof(int),
@@ -288,16 +205,13 @@ static struct ctl_table ipv4_table[] = {
288 .proc_handler = proc_dointvec 205 .proc_handler = proc_dointvec
289 }, 206 },
290 { 207 {
291 .ctl_name = NET_IPV4_TCP_KEEPALIVE_TIME,
292 .procname = "tcp_keepalive_time", 208 .procname = "tcp_keepalive_time",
293 .data = &sysctl_tcp_keepalive_time, 209 .data = &sysctl_tcp_keepalive_time,
294 .maxlen = sizeof(int), 210 .maxlen = sizeof(int),
295 .mode = 0644, 211 .mode = 0644,
296 .proc_handler = proc_dointvec_jiffies, 212 .proc_handler = proc_dointvec_jiffies,
297 .strategy = sysctl_jiffies
298 }, 213 },
299 { 214 {
300 .ctl_name = NET_IPV4_TCP_KEEPALIVE_PROBES,
301 .procname = "tcp_keepalive_probes", 215 .procname = "tcp_keepalive_probes",
302 .data = &sysctl_tcp_keepalive_probes, 216 .data = &sysctl_tcp_keepalive_probes,
303 .maxlen = sizeof(int), 217 .maxlen = sizeof(int),
@@ -305,26 +219,21 @@ static struct ctl_table ipv4_table[] = {
305 .proc_handler = proc_dointvec 219 .proc_handler = proc_dointvec
306 }, 220 },
307 { 221 {
308 .ctl_name = NET_IPV4_TCP_KEEPALIVE_INTVL,
309 .procname = "tcp_keepalive_intvl", 222 .procname = "tcp_keepalive_intvl",
310 .data = &sysctl_tcp_keepalive_intvl, 223 .data = &sysctl_tcp_keepalive_intvl,
311 .maxlen = sizeof(int), 224 .maxlen = sizeof(int),
312 .mode = 0644, 225 .mode = 0644,
313 .proc_handler = proc_dointvec_jiffies, 226 .proc_handler = proc_dointvec_jiffies,
314 .strategy = sysctl_jiffies
315 }, 227 },
316 { 228 {
317 .ctl_name = NET_IPV4_TCP_RETRIES1,
318 .procname = "tcp_retries1", 229 .procname = "tcp_retries1",
319 .data = &sysctl_tcp_retries1, 230 .data = &sysctl_tcp_retries1,
320 .maxlen = sizeof(int), 231 .maxlen = sizeof(int),
321 .mode = 0644, 232 .mode = 0644,
322 .proc_handler = proc_dointvec_minmax, 233 .proc_handler = proc_dointvec_minmax,
323 .strategy = sysctl_intvec,
324 .extra2 = &tcp_retr1_max 234 .extra2 = &tcp_retr1_max
325 }, 235 },
326 { 236 {
327 .ctl_name = NET_IPV4_TCP_RETRIES2,
328 .procname = "tcp_retries2", 237 .procname = "tcp_retries2",
329 .data = &sysctl_tcp_retries2, 238 .data = &sysctl_tcp_retries2,
330 .maxlen = sizeof(int), 239 .maxlen = sizeof(int),
@@ -332,17 +241,14 @@ static struct ctl_table ipv4_table[] = {
332 .proc_handler = proc_dointvec 241 .proc_handler = proc_dointvec
333 }, 242 },
334 { 243 {
335 .ctl_name = NET_IPV4_TCP_FIN_TIMEOUT,
336 .procname = "tcp_fin_timeout", 244 .procname = "tcp_fin_timeout",
337 .data = &sysctl_tcp_fin_timeout, 245 .data = &sysctl_tcp_fin_timeout,
338 .maxlen = sizeof(int), 246 .maxlen = sizeof(int),
339 .mode = 0644, 247 .mode = 0644,
340 .proc_handler = proc_dointvec_jiffies, 248 .proc_handler = proc_dointvec_jiffies,
341 .strategy = sysctl_jiffies
342 }, 249 },
343#ifdef CONFIG_SYN_COOKIES 250#ifdef CONFIG_SYN_COOKIES
344 { 251 {
345 .ctl_name = NET_TCP_SYNCOOKIES,
346 .procname = "tcp_syncookies", 252 .procname = "tcp_syncookies",
347 .data = &sysctl_tcp_syncookies, 253 .data = &sysctl_tcp_syncookies,
348 .maxlen = sizeof(int), 254 .maxlen = sizeof(int),
@@ -351,7 +257,6 @@ static struct ctl_table ipv4_table[] = {
351 }, 257 },
352#endif 258#endif
353 { 259 {
354 .ctl_name = NET_TCP_TW_RECYCLE,
355 .procname = "tcp_tw_recycle", 260 .procname = "tcp_tw_recycle",
356 .data = &tcp_death_row.sysctl_tw_recycle, 261 .data = &tcp_death_row.sysctl_tw_recycle,
357 .maxlen = sizeof(int), 262 .maxlen = sizeof(int),
@@ -359,7 +264,6 @@ static struct ctl_table ipv4_table[] = {
359 .proc_handler = proc_dointvec 264 .proc_handler = proc_dointvec
360 }, 265 },
361 { 266 {
362 .ctl_name = NET_TCP_ABORT_ON_OVERFLOW,
363 .procname = "tcp_abort_on_overflow", 267 .procname = "tcp_abort_on_overflow",
364 .data = &sysctl_tcp_abort_on_overflow, 268 .data = &sysctl_tcp_abort_on_overflow,
365 .maxlen = sizeof(int), 269 .maxlen = sizeof(int),
@@ -367,7 +271,6 @@ static struct ctl_table ipv4_table[] = {
367 .proc_handler = proc_dointvec 271 .proc_handler = proc_dointvec
368 }, 272 },
369 { 273 {
370 .ctl_name = NET_TCP_STDURG,
371 .procname = "tcp_stdurg", 274 .procname = "tcp_stdurg",
372 .data = &sysctl_tcp_stdurg, 275 .data = &sysctl_tcp_stdurg,
373 .maxlen = sizeof(int), 276 .maxlen = sizeof(int),
@@ -375,7 +278,6 @@ static struct ctl_table ipv4_table[] = {
375 .proc_handler = proc_dointvec 278 .proc_handler = proc_dointvec
376 }, 279 },
377 { 280 {
378 .ctl_name = NET_TCP_RFC1337,
379 .procname = "tcp_rfc1337", 281 .procname = "tcp_rfc1337",
380 .data = &sysctl_tcp_rfc1337, 282 .data = &sysctl_tcp_rfc1337,
381 .maxlen = sizeof(int), 283 .maxlen = sizeof(int),
@@ -383,7 +285,6 @@ static struct ctl_table ipv4_table[] = {
383 .proc_handler = proc_dointvec 285 .proc_handler = proc_dointvec
384 }, 286 },
385 { 287 {
386 .ctl_name = NET_TCP_MAX_SYN_BACKLOG,
387 .procname = "tcp_max_syn_backlog", 288 .procname = "tcp_max_syn_backlog",
388 .data = &sysctl_max_syn_backlog, 289 .data = &sysctl_max_syn_backlog,
389 .maxlen = sizeof(int), 290 .maxlen = sizeof(int),
@@ -391,17 +292,14 @@ static struct ctl_table ipv4_table[] = {
391 .proc_handler = proc_dointvec 292 .proc_handler = proc_dointvec
392 }, 293 },
393 { 294 {
394 .ctl_name = NET_IPV4_LOCAL_PORT_RANGE,
395 .procname = "ip_local_port_range", 295 .procname = "ip_local_port_range",
396 .data = &sysctl_local_ports.range, 296 .data = &sysctl_local_ports.range,
397 .maxlen = sizeof(sysctl_local_ports.range), 297 .maxlen = sizeof(sysctl_local_ports.range),
398 .mode = 0644, 298 .mode = 0644,
399 .proc_handler = ipv4_local_port_range, 299 .proc_handler = ipv4_local_port_range,
400 .strategy = ipv4_sysctl_local_port_range,
401 }, 300 },
402#ifdef CONFIG_IP_MULTICAST 301#ifdef CONFIG_IP_MULTICAST
403 { 302 {
404 .ctl_name = NET_IPV4_IGMP_MAX_MEMBERSHIPS,
405 .procname = "igmp_max_memberships", 303 .procname = "igmp_max_memberships",
406 .data = &sysctl_igmp_max_memberships, 304 .data = &sysctl_igmp_max_memberships,
407 .maxlen = sizeof(int), 305 .maxlen = sizeof(int),
@@ -411,7 +309,6 @@ static struct ctl_table ipv4_table[] = {
411 309
412#endif 310#endif
413 { 311 {
414 .ctl_name = NET_IPV4_IGMP_MAX_MSF,
415 .procname = "igmp_max_msf", 312 .procname = "igmp_max_msf",
416 .data = &sysctl_igmp_max_msf, 313 .data = &sysctl_igmp_max_msf,
417 .maxlen = sizeof(int), 314 .maxlen = sizeof(int),
@@ -419,7 +316,6 @@ static struct ctl_table ipv4_table[] = {
419 .proc_handler = proc_dointvec 316 .proc_handler = proc_dointvec
420 }, 317 },
421 { 318 {
422 .ctl_name = NET_IPV4_INET_PEER_THRESHOLD,
423 .procname = "inet_peer_threshold", 319 .procname = "inet_peer_threshold",
424 .data = &inet_peer_threshold, 320 .data = &inet_peer_threshold,
425 .maxlen = sizeof(int), 321 .maxlen = sizeof(int),
@@ -427,43 +323,34 @@ static struct ctl_table ipv4_table[] = {
427 .proc_handler = proc_dointvec 323 .proc_handler = proc_dointvec
428 }, 324 },
429 { 325 {
430 .ctl_name = NET_IPV4_INET_PEER_MINTTL,
431 .procname = "inet_peer_minttl", 326 .procname = "inet_peer_minttl",
432 .data = &inet_peer_minttl, 327 .data = &inet_peer_minttl,
433 .maxlen = sizeof(int), 328 .maxlen = sizeof(int),
434 .mode = 0644, 329 .mode = 0644,
435 .proc_handler = proc_dointvec_jiffies, 330 .proc_handler = proc_dointvec_jiffies,
436 .strategy = sysctl_jiffies
437 }, 331 },
438 { 332 {
439 .ctl_name = NET_IPV4_INET_PEER_MAXTTL,
440 .procname = "inet_peer_maxttl", 333 .procname = "inet_peer_maxttl",
441 .data = &inet_peer_maxttl, 334 .data = &inet_peer_maxttl,
442 .maxlen = sizeof(int), 335 .maxlen = sizeof(int),
443 .mode = 0644, 336 .mode = 0644,
444 .proc_handler = proc_dointvec_jiffies, 337 .proc_handler = proc_dointvec_jiffies,
445 .strategy = sysctl_jiffies
446 }, 338 },
447 { 339 {
448 .ctl_name = NET_IPV4_INET_PEER_GC_MINTIME,
449 .procname = "inet_peer_gc_mintime", 340 .procname = "inet_peer_gc_mintime",
450 .data = &inet_peer_gc_mintime, 341 .data = &inet_peer_gc_mintime,
451 .maxlen = sizeof(int), 342 .maxlen = sizeof(int),
452 .mode = 0644, 343 .mode = 0644,
453 .proc_handler = proc_dointvec_jiffies, 344 .proc_handler = proc_dointvec_jiffies,
454 .strategy = sysctl_jiffies
455 }, 345 },
456 { 346 {
457 .ctl_name = NET_IPV4_INET_PEER_GC_MAXTIME,
458 .procname = "inet_peer_gc_maxtime", 347 .procname = "inet_peer_gc_maxtime",
459 .data = &inet_peer_gc_maxtime, 348 .data = &inet_peer_gc_maxtime,
460 .maxlen = sizeof(int), 349 .maxlen = sizeof(int),
461 .mode = 0644, 350 .mode = 0644,
462 .proc_handler = proc_dointvec_jiffies, 351 .proc_handler = proc_dointvec_jiffies,
463 .strategy = sysctl_jiffies
464 }, 352 },
465 { 353 {
466 .ctl_name = NET_TCP_ORPHAN_RETRIES,
467 .procname = "tcp_orphan_retries", 354 .procname = "tcp_orphan_retries",
468 .data = &sysctl_tcp_orphan_retries, 355 .data = &sysctl_tcp_orphan_retries,
469 .maxlen = sizeof(int), 356 .maxlen = sizeof(int),
@@ -471,7 +358,6 @@ static struct ctl_table ipv4_table[] = {
471 .proc_handler = proc_dointvec 358 .proc_handler = proc_dointvec
472 }, 359 },
473 { 360 {
474 .ctl_name = NET_TCP_FACK,
475 .procname = "tcp_fack", 361 .procname = "tcp_fack",
476 .data = &sysctl_tcp_fack, 362 .data = &sysctl_tcp_fack,
477 .maxlen = sizeof(int), 363 .maxlen = sizeof(int),
@@ -479,7 +365,6 @@ static struct ctl_table ipv4_table[] = {
479 .proc_handler = proc_dointvec 365 .proc_handler = proc_dointvec
480 }, 366 },
481 { 367 {
482 .ctl_name = NET_TCP_REORDERING,
483 .procname = "tcp_reordering", 368 .procname = "tcp_reordering",
484 .data = &sysctl_tcp_reordering, 369 .data = &sysctl_tcp_reordering,
485 .maxlen = sizeof(int), 370 .maxlen = sizeof(int),
@@ -487,7 +372,6 @@ static struct ctl_table ipv4_table[] = {
487 .proc_handler = proc_dointvec 372 .proc_handler = proc_dointvec
488 }, 373 },
489 { 374 {
490 .ctl_name = NET_TCP_ECN,
491 .procname = "tcp_ecn", 375 .procname = "tcp_ecn",
492 .data = &sysctl_tcp_ecn, 376 .data = &sysctl_tcp_ecn,
493 .maxlen = sizeof(int), 377 .maxlen = sizeof(int),
@@ -495,7 +379,6 @@ static struct ctl_table ipv4_table[] = {
495 .proc_handler = proc_dointvec 379 .proc_handler = proc_dointvec
496 }, 380 },
497 { 381 {
498 .ctl_name = NET_TCP_DSACK,
499 .procname = "tcp_dsack", 382 .procname = "tcp_dsack",
500 .data = &sysctl_tcp_dsack, 383 .data = &sysctl_tcp_dsack,
501 .maxlen = sizeof(int), 384 .maxlen = sizeof(int),
@@ -503,7 +386,6 @@ static struct ctl_table ipv4_table[] = {
503 .proc_handler = proc_dointvec 386 .proc_handler = proc_dointvec
504 }, 387 },
505 { 388 {
506 .ctl_name = NET_TCP_MEM,
507 .procname = "tcp_mem", 389 .procname = "tcp_mem",
508 .data = &sysctl_tcp_mem, 390 .data = &sysctl_tcp_mem,
509 .maxlen = sizeof(sysctl_tcp_mem), 391 .maxlen = sizeof(sysctl_tcp_mem),
@@ -511,7 +393,6 @@ static struct ctl_table ipv4_table[] = {
511 .proc_handler = proc_dointvec 393 .proc_handler = proc_dointvec
512 }, 394 },
513 { 395 {
514 .ctl_name = NET_TCP_WMEM,
515 .procname = "tcp_wmem", 396 .procname = "tcp_wmem",
516 .data = &sysctl_tcp_wmem, 397 .data = &sysctl_tcp_wmem,
517 .maxlen = sizeof(sysctl_tcp_wmem), 398 .maxlen = sizeof(sysctl_tcp_wmem),
@@ -519,7 +400,6 @@ static struct ctl_table ipv4_table[] = {
519 .proc_handler = proc_dointvec 400 .proc_handler = proc_dointvec
520 }, 401 },
521 { 402 {
522 .ctl_name = NET_TCP_RMEM,
523 .procname = "tcp_rmem", 403 .procname = "tcp_rmem",
524 .data = &sysctl_tcp_rmem, 404 .data = &sysctl_tcp_rmem,
525 .maxlen = sizeof(sysctl_tcp_rmem), 405 .maxlen = sizeof(sysctl_tcp_rmem),
@@ -527,7 +407,6 @@ static struct ctl_table ipv4_table[] = {
527 .proc_handler = proc_dointvec 407 .proc_handler = proc_dointvec
528 }, 408 },
529 { 409 {
530 .ctl_name = NET_TCP_APP_WIN,
531 .procname = "tcp_app_win", 410 .procname = "tcp_app_win",
532 .data = &sysctl_tcp_app_win, 411 .data = &sysctl_tcp_app_win,
533 .maxlen = sizeof(int), 412 .maxlen = sizeof(int),
@@ -535,7 +414,6 @@ static struct ctl_table ipv4_table[] = {
535 .proc_handler = proc_dointvec 414 .proc_handler = proc_dointvec
536 }, 415 },
537 { 416 {
538 .ctl_name = NET_TCP_ADV_WIN_SCALE,
539 .procname = "tcp_adv_win_scale", 417 .procname = "tcp_adv_win_scale",
540 .data = &sysctl_tcp_adv_win_scale, 418 .data = &sysctl_tcp_adv_win_scale,
541 .maxlen = sizeof(int), 419 .maxlen = sizeof(int),
@@ -543,7 +421,6 @@ static struct ctl_table ipv4_table[] = {
543 .proc_handler = proc_dointvec 421 .proc_handler = proc_dointvec
544 }, 422 },
545 { 423 {
546 .ctl_name = NET_TCP_TW_REUSE,
547 .procname = "tcp_tw_reuse", 424 .procname = "tcp_tw_reuse",
548 .data = &sysctl_tcp_tw_reuse, 425 .data = &sysctl_tcp_tw_reuse,
549 .maxlen = sizeof(int), 426 .maxlen = sizeof(int),
@@ -551,7 +428,6 @@ static struct ctl_table ipv4_table[] = {
551 .proc_handler = proc_dointvec 428 .proc_handler = proc_dointvec
552 }, 429 },
553 { 430 {
554 .ctl_name = NET_TCP_FRTO,
555 .procname = "tcp_frto", 431 .procname = "tcp_frto",
556 .data = &sysctl_tcp_frto, 432 .data = &sysctl_tcp_frto,
557 .maxlen = sizeof(int), 433 .maxlen = sizeof(int),
@@ -559,7 +435,6 @@ static struct ctl_table ipv4_table[] = {
559 .proc_handler = proc_dointvec 435 .proc_handler = proc_dointvec
560 }, 436 },
561 { 437 {
562 .ctl_name = NET_TCP_FRTO_RESPONSE,
563 .procname = "tcp_frto_response", 438 .procname = "tcp_frto_response",
564 .data = &sysctl_tcp_frto_response, 439 .data = &sysctl_tcp_frto_response,
565 .maxlen = sizeof(int), 440 .maxlen = sizeof(int),
@@ -567,7 +442,6 @@ static struct ctl_table ipv4_table[] = {
567 .proc_handler = proc_dointvec 442 .proc_handler = proc_dointvec
568 }, 443 },
569 { 444 {
570 .ctl_name = NET_TCP_LOW_LATENCY,
571 .procname = "tcp_low_latency", 445 .procname = "tcp_low_latency",
572 .data = &sysctl_tcp_low_latency, 446 .data = &sysctl_tcp_low_latency,
573 .maxlen = sizeof(int), 447 .maxlen = sizeof(int),
@@ -575,7 +449,6 @@ static struct ctl_table ipv4_table[] = {
575 .proc_handler = proc_dointvec 449 .proc_handler = proc_dointvec
576 }, 450 },
577 { 451 {
578 .ctl_name = NET_TCP_NO_METRICS_SAVE,
579 .procname = "tcp_no_metrics_save", 452 .procname = "tcp_no_metrics_save",
580 .data = &sysctl_tcp_nometrics_save, 453 .data = &sysctl_tcp_nometrics_save,
581 .maxlen = sizeof(int), 454 .maxlen = sizeof(int),
@@ -583,7 +456,6 @@ static struct ctl_table ipv4_table[] = {
583 .proc_handler = proc_dointvec, 456 .proc_handler = proc_dointvec,
584 }, 457 },
585 { 458 {
586 .ctl_name = NET_TCP_MODERATE_RCVBUF,
587 .procname = "tcp_moderate_rcvbuf", 459 .procname = "tcp_moderate_rcvbuf",
588 .data = &sysctl_tcp_moderate_rcvbuf, 460 .data = &sysctl_tcp_moderate_rcvbuf,
589 .maxlen = sizeof(int), 461 .maxlen = sizeof(int),
@@ -591,7 +463,6 @@ static struct ctl_table ipv4_table[] = {
591 .proc_handler = proc_dointvec, 463 .proc_handler = proc_dointvec,
592 }, 464 },
593 { 465 {
594 .ctl_name = NET_TCP_TSO_WIN_DIVISOR,
595 .procname = "tcp_tso_win_divisor", 466 .procname = "tcp_tso_win_divisor",
596 .data = &sysctl_tcp_tso_win_divisor, 467 .data = &sysctl_tcp_tso_win_divisor,
597 .maxlen = sizeof(int), 468 .maxlen = sizeof(int),
@@ -599,15 +470,12 @@ static struct ctl_table ipv4_table[] = {
599 .proc_handler = proc_dointvec, 470 .proc_handler = proc_dointvec,
600 }, 471 },
601 { 472 {
602 .ctl_name = NET_TCP_CONG_CONTROL,
603 .procname = "tcp_congestion_control", 473 .procname = "tcp_congestion_control",
604 .mode = 0644, 474 .mode = 0644,
605 .maxlen = TCP_CA_NAME_MAX, 475 .maxlen = TCP_CA_NAME_MAX,
606 .proc_handler = proc_tcp_congestion_control, 476 .proc_handler = proc_tcp_congestion_control,
607 .strategy = sysctl_tcp_congestion_control,
608 }, 477 },
609 { 478 {
610 .ctl_name = NET_TCP_ABC,
611 .procname = "tcp_abc", 479 .procname = "tcp_abc",
612 .data = &sysctl_tcp_abc, 480 .data = &sysctl_tcp_abc,
613 .maxlen = sizeof(int), 481 .maxlen = sizeof(int),
@@ -615,7 +483,6 @@ static struct ctl_table ipv4_table[] = {
615 .proc_handler = proc_dointvec, 483 .proc_handler = proc_dointvec,
616 }, 484 },
617 { 485 {
618 .ctl_name = NET_TCP_MTU_PROBING,
619 .procname = "tcp_mtu_probing", 486 .procname = "tcp_mtu_probing",
620 .data = &sysctl_tcp_mtu_probing, 487 .data = &sysctl_tcp_mtu_probing,
621 .maxlen = sizeof(int), 488 .maxlen = sizeof(int),
@@ -623,7 +490,6 @@ static struct ctl_table ipv4_table[] = {
623 .proc_handler = proc_dointvec, 490 .proc_handler = proc_dointvec,
624 }, 491 },
625 { 492 {
626 .ctl_name = NET_TCP_BASE_MSS,
627 .procname = "tcp_base_mss", 493 .procname = "tcp_base_mss",
628 .data = &sysctl_tcp_base_mss, 494 .data = &sysctl_tcp_base_mss,
629 .maxlen = sizeof(int), 495 .maxlen = sizeof(int),
@@ -631,7 +497,6 @@ static struct ctl_table ipv4_table[] = {
631 .proc_handler = proc_dointvec, 497 .proc_handler = proc_dointvec,
632 }, 498 },
633 { 499 {
634 .ctl_name = NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS,
635 .procname = "tcp_workaround_signed_windows", 500 .procname = "tcp_workaround_signed_windows",
636 .data = &sysctl_tcp_workaround_signed_windows, 501 .data = &sysctl_tcp_workaround_signed_windows,
637 .maxlen = sizeof(int), 502 .maxlen = sizeof(int),
@@ -640,7 +505,6 @@ static struct ctl_table ipv4_table[] = {
640 }, 505 },
641#ifdef CONFIG_NET_DMA 506#ifdef CONFIG_NET_DMA
642 { 507 {
643 .ctl_name = NET_TCP_DMA_COPYBREAK,
644 .procname = "tcp_dma_copybreak", 508 .procname = "tcp_dma_copybreak",
645 .data = &sysctl_tcp_dma_copybreak, 509 .data = &sysctl_tcp_dma_copybreak,
646 .maxlen = sizeof(int), 510 .maxlen = sizeof(int),
@@ -649,7 +513,6 @@ static struct ctl_table ipv4_table[] = {
649 }, 513 },
650#endif 514#endif
651 { 515 {
652 .ctl_name = NET_TCP_SLOW_START_AFTER_IDLE,
653 .procname = "tcp_slow_start_after_idle", 516 .procname = "tcp_slow_start_after_idle",
654 .data = &sysctl_tcp_slow_start_after_idle, 517 .data = &sysctl_tcp_slow_start_after_idle,
655 .maxlen = sizeof(int), 518 .maxlen = sizeof(int),
@@ -658,7 +521,6 @@ static struct ctl_table ipv4_table[] = {
658 }, 521 },
659#ifdef CONFIG_NETLABEL 522#ifdef CONFIG_NETLABEL
660 { 523 {
661 .ctl_name = NET_CIPSOV4_CACHE_ENABLE,
662 .procname = "cipso_cache_enable", 524 .procname = "cipso_cache_enable",
663 .data = &cipso_v4_cache_enabled, 525 .data = &cipso_v4_cache_enabled,
664 .maxlen = sizeof(int), 526 .maxlen = sizeof(int),
@@ -666,7 +528,6 @@ static struct ctl_table ipv4_table[] = {
666 .proc_handler = proc_dointvec, 528 .proc_handler = proc_dointvec,
667 }, 529 },
668 { 530 {
669 .ctl_name = NET_CIPSOV4_CACHE_BUCKET_SIZE,
670 .procname = "cipso_cache_bucket_size", 531 .procname = "cipso_cache_bucket_size",
671 .data = &cipso_v4_cache_bucketsize, 532 .data = &cipso_v4_cache_bucketsize,
672 .maxlen = sizeof(int), 533 .maxlen = sizeof(int),
@@ -674,7 +535,6 @@ static struct ctl_table ipv4_table[] = {
674 .proc_handler = proc_dointvec, 535 .proc_handler = proc_dointvec,
675 }, 536 },
676 { 537 {
677 .ctl_name = NET_CIPSOV4_RBM_OPTFMT,
678 .procname = "cipso_rbm_optfmt", 538 .procname = "cipso_rbm_optfmt",
679 .data = &cipso_v4_rbm_optfmt, 539 .data = &cipso_v4_rbm_optfmt,
680 .maxlen = sizeof(int), 540 .maxlen = sizeof(int),
@@ -682,7 +542,6 @@ static struct ctl_table ipv4_table[] = {
682 .proc_handler = proc_dointvec, 542 .proc_handler = proc_dointvec,
683 }, 543 },
684 { 544 {
685 .ctl_name = NET_CIPSOV4_RBM_STRICTVALID,
686 .procname = "cipso_rbm_strictvalid", 545 .procname = "cipso_rbm_strictvalid",
687 .data = &cipso_v4_rbm_strictvalid, 546 .data = &cipso_v4_rbm_strictvalid,
688 .maxlen = sizeof(int), 547 .maxlen = sizeof(int),
@@ -697,15 +556,12 @@ static struct ctl_table ipv4_table[] = {
697 .proc_handler = proc_tcp_available_congestion_control, 556 .proc_handler = proc_tcp_available_congestion_control,
698 }, 557 },
699 { 558 {
700 .ctl_name = NET_TCP_ALLOWED_CONG_CONTROL,
701 .procname = "tcp_allowed_congestion_control", 559 .procname = "tcp_allowed_congestion_control",
702 .maxlen = TCP_CA_BUF_MAX, 560 .maxlen = TCP_CA_BUF_MAX,
703 .mode = 0644, 561 .mode = 0644,
704 .proc_handler = proc_allowed_congestion_control, 562 .proc_handler = proc_allowed_congestion_control,
705 .strategy = strategy_allowed_congestion_control,
706 }, 563 },
707 { 564 {
708 .ctl_name = NET_TCP_MAX_SSTHRESH,
709 .procname = "tcp_max_ssthresh", 565 .procname = "tcp_max_ssthresh",
710 .data = &sysctl_tcp_max_ssthresh, 566 .data = &sysctl_tcp_max_ssthresh,
711 .maxlen = sizeof(int), 567 .maxlen = sizeof(int),
@@ -713,41 +569,34 @@ static struct ctl_table ipv4_table[] = {
713 .proc_handler = proc_dointvec, 569 .proc_handler = proc_dointvec,
714 }, 570 },
715 { 571 {
716 .ctl_name = CTL_UNNUMBERED,
717 .procname = "udp_mem", 572 .procname = "udp_mem",
718 .data = &sysctl_udp_mem, 573 .data = &sysctl_udp_mem,
719 .maxlen = sizeof(sysctl_udp_mem), 574 .maxlen = sizeof(sysctl_udp_mem),
720 .mode = 0644, 575 .mode = 0644,
721 .proc_handler = proc_dointvec_minmax, 576 .proc_handler = proc_dointvec_minmax,
722 .strategy = sysctl_intvec,
723 .extra1 = &zero 577 .extra1 = &zero
724 }, 578 },
725 { 579 {
726 .ctl_name = CTL_UNNUMBERED,
727 .procname = "udp_rmem_min", 580 .procname = "udp_rmem_min",
728 .data = &sysctl_udp_rmem_min, 581 .data = &sysctl_udp_rmem_min,
729 .maxlen = sizeof(sysctl_udp_rmem_min), 582 .maxlen = sizeof(sysctl_udp_rmem_min),
730 .mode = 0644, 583 .mode = 0644,
731 .proc_handler = proc_dointvec_minmax, 584 .proc_handler = proc_dointvec_minmax,
732 .strategy = sysctl_intvec,
733 .extra1 = &zero 585 .extra1 = &zero
734 }, 586 },
735 { 587 {
736 .ctl_name = CTL_UNNUMBERED,
737 .procname = "udp_wmem_min", 588 .procname = "udp_wmem_min",
738 .data = &sysctl_udp_wmem_min, 589 .data = &sysctl_udp_wmem_min,
739 .maxlen = sizeof(sysctl_udp_wmem_min), 590 .maxlen = sizeof(sysctl_udp_wmem_min),
740 .mode = 0644, 591 .mode = 0644,
741 .proc_handler = proc_dointvec_minmax, 592 .proc_handler = proc_dointvec_minmax,
742 .strategy = sysctl_intvec,
743 .extra1 = &zero 593 .extra1 = &zero
744 }, 594 },
745 { .ctl_name = 0 } 595 { }
746}; 596};
747 597
748static struct ctl_table ipv4_net_table[] = { 598static struct ctl_table ipv4_net_table[] = {
749 { 599 {
750 .ctl_name = NET_IPV4_ICMP_ECHO_IGNORE_ALL,
751 .procname = "icmp_echo_ignore_all", 600 .procname = "icmp_echo_ignore_all",
752 .data = &init_net.ipv4.sysctl_icmp_echo_ignore_all, 601 .data = &init_net.ipv4.sysctl_icmp_echo_ignore_all,
753 .maxlen = sizeof(int), 602 .maxlen = sizeof(int),
@@ -755,7 +604,6 @@ static struct ctl_table ipv4_net_table[] = {
755 .proc_handler = proc_dointvec 604 .proc_handler = proc_dointvec
756 }, 605 },
757 { 606 {
758 .ctl_name = NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS,
759 .procname = "icmp_echo_ignore_broadcasts", 607 .procname = "icmp_echo_ignore_broadcasts",
760 .data = &init_net.ipv4.sysctl_icmp_echo_ignore_broadcasts, 608 .data = &init_net.ipv4.sysctl_icmp_echo_ignore_broadcasts,
761 .maxlen = sizeof(int), 609 .maxlen = sizeof(int),
@@ -763,7 +611,6 @@ static struct ctl_table ipv4_net_table[] = {
763 .proc_handler = proc_dointvec 611 .proc_handler = proc_dointvec
764 }, 612 },
765 { 613 {
766 .ctl_name = NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES,
767 .procname = "icmp_ignore_bogus_error_responses", 614 .procname = "icmp_ignore_bogus_error_responses",
768 .data = &init_net.ipv4.sysctl_icmp_ignore_bogus_error_responses, 615 .data = &init_net.ipv4.sysctl_icmp_ignore_bogus_error_responses,
769 .maxlen = sizeof(int), 616 .maxlen = sizeof(int),
@@ -771,7 +618,6 @@ static struct ctl_table ipv4_net_table[] = {
771 .proc_handler = proc_dointvec 618 .proc_handler = proc_dointvec
772 }, 619 },
773 { 620 {
774 .ctl_name = NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR,
775 .procname = "icmp_errors_use_inbound_ifaddr", 621 .procname = "icmp_errors_use_inbound_ifaddr",
776 .data = &init_net.ipv4.sysctl_icmp_errors_use_inbound_ifaddr, 622 .data = &init_net.ipv4.sysctl_icmp_errors_use_inbound_ifaddr,
777 .maxlen = sizeof(int), 623 .maxlen = sizeof(int),
@@ -779,16 +625,13 @@ static struct ctl_table ipv4_net_table[] = {
779 .proc_handler = proc_dointvec 625 .proc_handler = proc_dointvec
780 }, 626 },
781 { 627 {
782 .ctl_name = NET_IPV4_ICMP_RATELIMIT,
783 .procname = "icmp_ratelimit", 628 .procname = "icmp_ratelimit",
784 .data = &init_net.ipv4.sysctl_icmp_ratelimit, 629 .data = &init_net.ipv4.sysctl_icmp_ratelimit,
785 .maxlen = sizeof(int), 630 .maxlen = sizeof(int),
786 .mode = 0644, 631 .mode = 0644,
787 .proc_handler = proc_dointvec_ms_jiffies, 632 .proc_handler = proc_dointvec_ms_jiffies,
788 .strategy = sysctl_ms_jiffies
789 }, 633 },
790 { 634 {
791 .ctl_name = NET_IPV4_ICMP_RATEMASK,
792 .procname = "icmp_ratemask", 635 .procname = "icmp_ratemask",
793 .data = &init_net.ipv4.sysctl_icmp_ratemask, 636 .data = &init_net.ipv4.sysctl_icmp_ratemask,
794 .maxlen = sizeof(int), 637 .maxlen = sizeof(int),
@@ -796,7 +639,6 @@ static struct ctl_table ipv4_net_table[] = {
796 .proc_handler = proc_dointvec 639 .proc_handler = proc_dointvec
797 }, 640 },
798 { 641 {
799 .ctl_name = CTL_UNNUMBERED,
800 .procname = "rt_cache_rebuild_count", 642 .procname = "rt_cache_rebuild_count",
801 .data = &init_net.ipv4.sysctl_rt_cache_rebuild_count, 643 .data = &init_net.ipv4.sysctl_rt_cache_rebuild_count,
802 .maxlen = sizeof(int), 644 .maxlen = sizeof(int),
@@ -807,8 +649,8 @@ static struct ctl_table ipv4_net_table[] = {
807}; 649};
808 650
809struct ctl_path net_ipv4_ctl_path[] = { 651struct ctl_path net_ipv4_ctl_path[] = {
810 { .procname = "net", .ctl_name = CTL_NET, }, 652 { .procname = "net", },
811 { .procname = "ipv4", .ctl_name = NET_IPV4, }, 653 { .procname = "ipv4", },
812 { }, 654 { },
813}; 655};
814EXPORT_SYMBOL_GPL(net_ipv4_ctl_path); 656EXPORT_SYMBOL_GPL(net_ipv4_ctl_path);
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c
index 74fb2eb833ec..8c08a28d8f83 100644
--- a/net/ipv4/xfrm4_policy.c
+++ b/net/ipv4/xfrm4_policy.c
@@ -267,7 +267,6 @@ static struct xfrm_policy_afinfo xfrm4_policy_afinfo = {
267#ifdef CONFIG_SYSCTL 267#ifdef CONFIG_SYSCTL
268static struct ctl_table xfrm4_policy_table[] = { 268static struct ctl_table xfrm4_policy_table[] = {
269 { 269 {
270 .ctl_name = CTL_UNNUMBERED,
271 .procname = "xfrm4_gc_thresh", 270 .procname = "xfrm4_gc_thresh",
272 .data = &xfrm4_dst_ops.gc_thresh, 271 .data = &xfrm4_dst_ops.gc_thresh,
273 .maxlen = sizeof(int), 272 .maxlen = sizeof(int),
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 1fd0a3d775d2..f918399c985c 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -4000,41 +4000,6 @@ int addrconf_sysctl_forward(ctl_table *ctl, int write,
4000 return ret; 4000 return ret;
4001} 4001}
4002 4002
4003static int addrconf_sysctl_forward_strategy(ctl_table *table,
4004 void __user *oldval,
4005 size_t __user *oldlenp,
4006 void __user *newval, size_t newlen)
4007{
4008 int *valp = table->data;
4009 int val = *valp;
4010 int new;
4011
4012 if (!newval || !newlen)
4013 return 0;
4014 if (newlen != sizeof(int))
4015 return -EINVAL;
4016 if (get_user(new, (int __user *)newval))
4017 return -EFAULT;
4018 if (new == *valp)
4019 return 0;
4020 if (oldval && oldlenp) {
4021 size_t len;
4022 if (get_user(len, oldlenp))
4023 return -EFAULT;
4024 if (len) {
4025 if (len > table->maxlen)
4026 len = table->maxlen;
4027 if (copy_to_user(oldval, valp, len))
4028 return -EFAULT;
4029 if (put_user(len, oldlenp))
4030 return -EFAULT;
4031 }
4032 }
4033
4034 *valp = new;
4035 return addrconf_fixup_forwarding(table, valp, val);
4036}
4037
4038static void dev_disable_change(struct inet6_dev *idev) 4003static void dev_disable_change(struct inet6_dev *idev)
4039{ 4004{
4040 if (!idev || !idev->dev) 4005 if (!idev || !idev->dev)
@@ -4113,16 +4078,13 @@ static struct addrconf_sysctl_table
4113 .sysctl_header = NULL, 4078 .sysctl_header = NULL,
4114 .addrconf_vars = { 4079 .addrconf_vars = {
4115 { 4080 {
4116 .ctl_name = NET_IPV6_FORWARDING,
4117 .procname = "forwarding", 4081 .procname = "forwarding",
4118 .data = &ipv6_devconf.forwarding, 4082 .data = &ipv6_devconf.forwarding,
4119 .maxlen = sizeof(int), 4083 .maxlen = sizeof(int),
4120 .mode = 0644, 4084 .mode = 0644,
4121 .proc_handler = addrconf_sysctl_forward, 4085 .proc_handler = addrconf_sysctl_forward,
4122 .strategy = addrconf_sysctl_forward_strategy,
4123 }, 4086 },
4124 { 4087 {
4125 .ctl_name = NET_IPV6_HOP_LIMIT,
4126 .procname = "hop_limit", 4088 .procname = "hop_limit",
4127 .data = &ipv6_devconf.hop_limit, 4089 .data = &ipv6_devconf.hop_limit,
4128 .maxlen = sizeof(int), 4090 .maxlen = sizeof(int),
@@ -4130,7 +4092,6 @@ static struct addrconf_sysctl_table
4130 .proc_handler = proc_dointvec, 4092 .proc_handler = proc_dointvec,
4131 }, 4093 },
4132 { 4094 {
4133 .ctl_name = NET_IPV6_MTU,
4134 .procname = "mtu", 4095 .procname = "mtu",
4135 .data = &ipv6_devconf.mtu6, 4096 .data = &ipv6_devconf.mtu6,
4136 .maxlen = sizeof(int), 4097 .maxlen = sizeof(int),
@@ -4138,7 +4099,6 @@ static struct addrconf_sysctl_table
4138 .proc_handler = proc_dointvec, 4099 .proc_handler = proc_dointvec,
4139 }, 4100 },
4140 { 4101 {
4141 .ctl_name = NET_IPV6_ACCEPT_RA,
4142 .procname = "accept_ra", 4102 .procname = "accept_ra",
4143 .data = &ipv6_devconf.accept_ra, 4103 .data = &ipv6_devconf.accept_ra,
4144 .maxlen = sizeof(int), 4104 .maxlen = sizeof(int),
@@ -4146,7 +4106,6 @@ static struct addrconf_sysctl_table
4146 .proc_handler = proc_dointvec, 4106 .proc_handler = proc_dointvec,
4147 }, 4107 },
4148 { 4108 {
4149 .ctl_name = NET_IPV6_ACCEPT_REDIRECTS,
4150 .procname = "accept_redirects", 4109 .procname = "accept_redirects",
4151 .data = &ipv6_devconf.accept_redirects, 4110 .data = &ipv6_devconf.accept_redirects,
4152 .maxlen = sizeof(int), 4111 .maxlen = sizeof(int),
@@ -4154,7 +4113,6 @@ static struct addrconf_sysctl_table
4154 .proc_handler = proc_dointvec, 4113 .proc_handler = proc_dointvec,
4155 }, 4114 },
4156 { 4115 {
4157 .ctl_name = NET_IPV6_AUTOCONF,
4158 .procname = "autoconf", 4116 .procname = "autoconf",
4159 .data = &ipv6_devconf.autoconf, 4117 .data = &ipv6_devconf.autoconf,
4160 .maxlen = sizeof(int), 4118 .maxlen = sizeof(int),
@@ -4162,7 +4120,6 @@ static struct addrconf_sysctl_table
4162 .proc_handler = proc_dointvec, 4120 .proc_handler = proc_dointvec,
4163 }, 4121 },
4164 { 4122 {
4165 .ctl_name = NET_IPV6_DAD_TRANSMITS,
4166 .procname = "dad_transmits", 4123 .procname = "dad_transmits",
4167 .data = &ipv6_devconf.dad_transmits, 4124 .data = &ipv6_devconf.dad_transmits,
4168 .maxlen = sizeof(int), 4125 .maxlen = sizeof(int),
@@ -4170,7 +4127,6 @@ static struct addrconf_sysctl_table
4170 .proc_handler = proc_dointvec, 4127 .proc_handler = proc_dointvec,
4171 }, 4128 },
4172 { 4129 {
4173 .ctl_name = NET_IPV6_RTR_SOLICITS,
4174 .procname = "router_solicitations", 4130 .procname = "router_solicitations",
4175 .data = &ipv6_devconf.rtr_solicits, 4131 .data = &ipv6_devconf.rtr_solicits,
4176 .maxlen = sizeof(int), 4132 .maxlen = sizeof(int),
@@ -4178,25 +4134,20 @@ static struct addrconf_sysctl_table
4178 .proc_handler = proc_dointvec, 4134 .proc_handler = proc_dointvec,
4179 }, 4135 },
4180 { 4136 {
4181 .ctl_name = NET_IPV6_RTR_SOLICIT_INTERVAL,
4182 .procname = "router_solicitation_interval", 4137 .procname = "router_solicitation_interval",
4183 .data = &ipv6_devconf.rtr_solicit_interval, 4138 .data = &ipv6_devconf.rtr_solicit_interval,
4184 .maxlen = sizeof(int), 4139 .maxlen = sizeof(int),
4185 .mode = 0644, 4140 .mode = 0644,
4186 .proc_handler = proc_dointvec_jiffies, 4141 .proc_handler = proc_dointvec_jiffies,
4187 .strategy = sysctl_jiffies,
4188 }, 4142 },
4189 { 4143 {
4190 .ctl_name = NET_IPV6_RTR_SOLICIT_DELAY,
4191 .procname = "router_solicitation_delay", 4144 .procname = "router_solicitation_delay",
4192 .data = &ipv6_devconf.rtr_solicit_delay, 4145 .data = &ipv6_devconf.rtr_solicit_delay,
4193 .maxlen = sizeof(int), 4146 .maxlen = sizeof(int),
4194 .mode = 0644, 4147 .mode = 0644,
4195 .proc_handler = proc_dointvec_jiffies, 4148 .proc_handler = proc_dointvec_jiffies,
4196 .strategy = sysctl_jiffies,
4197 }, 4149 },
4198 { 4150 {
4199 .ctl_name = NET_IPV6_FORCE_MLD_VERSION,
4200 .procname = "force_mld_version", 4151 .procname = "force_mld_version",
4201 .data = &ipv6_devconf.force_mld_version, 4152 .data = &ipv6_devconf.force_mld_version,
4202 .maxlen = sizeof(int), 4153 .maxlen = sizeof(int),
@@ -4205,7 +4156,6 @@ static struct addrconf_sysctl_table
4205 }, 4156 },
4206#ifdef CONFIG_IPV6_PRIVACY 4157#ifdef CONFIG_IPV6_PRIVACY
4207 { 4158 {
4208 .ctl_name = NET_IPV6_USE_TEMPADDR,
4209 .procname = "use_tempaddr", 4159 .procname = "use_tempaddr",
4210 .data = &ipv6_devconf.use_tempaddr, 4160 .data = &ipv6_devconf.use_tempaddr,
4211 .maxlen = sizeof(int), 4161 .maxlen = sizeof(int),
@@ -4213,7 +4163,6 @@ static struct addrconf_sysctl_table
4213 .proc_handler = proc_dointvec, 4163 .proc_handler = proc_dointvec,
4214 }, 4164 },
4215 { 4165 {
4216 .ctl_name = NET_IPV6_TEMP_VALID_LFT,
4217 .procname = "temp_valid_lft", 4166 .procname = "temp_valid_lft",
4218 .data = &ipv6_devconf.temp_valid_lft, 4167 .data = &ipv6_devconf.temp_valid_lft,
4219 .maxlen = sizeof(int), 4168 .maxlen = sizeof(int),
@@ -4221,7 +4170,6 @@ static struct addrconf_sysctl_table
4221 .proc_handler = proc_dointvec, 4170 .proc_handler = proc_dointvec,
4222 }, 4171 },
4223 { 4172 {
4224 .ctl_name = NET_IPV6_TEMP_PREFERED_LFT,
4225 .procname = "temp_prefered_lft", 4173 .procname = "temp_prefered_lft",
4226 .data = &ipv6_devconf.temp_prefered_lft, 4174 .data = &ipv6_devconf.temp_prefered_lft,
4227 .maxlen = sizeof(int), 4175 .maxlen = sizeof(int),
@@ -4229,7 +4177,6 @@ static struct addrconf_sysctl_table
4229 .proc_handler = proc_dointvec, 4177 .proc_handler = proc_dointvec,
4230 }, 4178 },
4231 { 4179 {
4232 .ctl_name = NET_IPV6_REGEN_MAX_RETRY,
4233 .procname = "regen_max_retry", 4180 .procname = "regen_max_retry",
4234 .data = &ipv6_devconf.regen_max_retry, 4181 .data = &ipv6_devconf.regen_max_retry,
4235 .maxlen = sizeof(int), 4182 .maxlen = sizeof(int),
@@ -4237,7 +4184,6 @@ static struct addrconf_sysctl_table
4237 .proc_handler = proc_dointvec, 4184 .proc_handler = proc_dointvec,
4238 }, 4185 },
4239 { 4186 {
4240 .ctl_name = NET_IPV6_MAX_DESYNC_FACTOR,
4241 .procname = "max_desync_factor", 4187 .procname = "max_desync_factor",
4242 .data = &ipv6_devconf.max_desync_factor, 4188 .data = &ipv6_devconf.max_desync_factor,
4243 .maxlen = sizeof(int), 4189 .maxlen = sizeof(int),
@@ -4246,7 +4192,6 @@ static struct addrconf_sysctl_table
4246 }, 4192 },
4247#endif 4193#endif
4248 { 4194 {
4249 .ctl_name = NET_IPV6_MAX_ADDRESSES,
4250 .procname = "max_addresses", 4195 .procname = "max_addresses",
4251 .data = &ipv6_devconf.max_addresses, 4196 .data = &ipv6_devconf.max_addresses,
4252 .maxlen = sizeof(int), 4197 .maxlen = sizeof(int),
@@ -4254,7 +4199,6 @@ static struct addrconf_sysctl_table
4254 .proc_handler = proc_dointvec, 4199 .proc_handler = proc_dointvec,
4255 }, 4200 },
4256 { 4201 {
4257 .ctl_name = NET_IPV6_ACCEPT_RA_DEFRTR,
4258 .procname = "accept_ra_defrtr", 4202 .procname = "accept_ra_defrtr",
4259 .data = &ipv6_devconf.accept_ra_defrtr, 4203 .data = &ipv6_devconf.accept_ra_defrtr,
4260 .maxlen = sizeof(int), 4204 .maxlen = sizeof(int),
@@ -4262,7 +4206,6 @@ static struct addrconf_sysctl_table
4262 .proc_handler = proc_dointvec, 4206 .proc_handler = proc_dointvec,
4263 }, 4207 },
4264 { 4208 {
4265 .ctl_name = NET_IPV6_ACCEPT_RA_PINFO,
4266 .procname = "accept_ra_pinfo", 4209 .procname = "accept_ra_pinfo",
4267 .data = &ipv6_devconf.accept_ra_pinfo, 4210 .data = &ipv6_devconf.accept_ra_pinfo,
4268 .maxlen = sizeof(int), 4211 .maxlen = sizeof(int),
@@ -4271,7 +4214,6 @@ static struct addrconf_sysctl_table
4271 }, 4214 },
4272#ifdef CONFIG_IPV6_ROUTER_PREF 4215#ifdef CONFIG_IPV6_ROUTER_PREF
4273 { 4216 {
4274 .ctl_name = NET_IPV6_ACCEPT_RA_RTR_PREF,
4275 .procname = "accept_ra_rtr_pref", 4217 .procname = "accept_ra_rtr_pref",
4276 .data = &ipv6_devconf.accept_ra_rtr_pref, 4218 .data = &ipv6_devconf.accept_ra_rtr_pref,
4277 .maxlen = sizeof(int), 4219 .maxlen = sizeof(int),
@@ -4279,17 +4221,14 @@ static struct addrconf_sysctl_table
4279 .proc_handler = proc_dointvec, 4221 .proc_handler = proc_dointvec,
4280 }, 4222 },
4281 { 4223 {
4282 .ctl_name = NET_IPV6_RTR_PROBE_INTERVAL,
4283 .procname = "router_probe_interval", 4224 .procname = "router_probe_interval",
4284 .data = &ipv6_devconf.rtr_probe_interval, 4225 .data = &ipv6_devconf.rtr_probe_interval,
4285 .maxlen = sizeof(int), 4226 .maxlen = sizeof(int),
4286 .mode = 0644, 4227 .mode = 0644,
4287 .proc_handler = proc_dointvec_jiffies, 4228 .proc_handler = proc_dointvec_jiffies,
4288 .strategy = sysctl_jiffies,
4289 }, 4229 },
4290#ifdef CONFIG_IPV6_ROUTE_INFO 4230#ifdef CONFIG_IPV6_ROUTE_INFO
4291 { 4231 {
4292 .ctl_name = NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN,
4293 .procname = "accept_ra_rt_info_max_plen", 4232 .procname = "accept_ra_rt_info_max_plen",
4294 .data = &ipv6_devconf.accept_ra_rt_info_max_plen, 4233 .data = &ipv6_devconf.accept_ra_rt_info_max_plen,
4295 .maxlen = sizeof(int), 4234 .maxlen = sizeof(int),
@@ -4299,7 +4238,6 @@ static struct addrconf_sysctl_table
4299#endif 4238#endif
4300#endif 4239#endif
4301 { 4240 {
4302 .ctl_name = NET_IPV6_PROXY_NDP,
4303 .procname = "proxy_ndp", 4241 .procname = "proxy_ndp",
4304 .data = &ipv6_devconf.proxy_ndp, 4242 .data = &ipv6_devconf.proxy_ndp,
4305 .maxlen = sizeof(int), 4243 .maxlen = sizeof(int),
@@ -4307,7 +4245,6 @@ static struct addrconf_sysctl_table
4307 .proc_handler = proc_dointvec, 4245 .proc_handler = proc_dointvec,
4308 }, 4246 },
4309 { 4247 {
4310 .ctl_name = NET_IPV6_ACCEPT_SOURCE_ROUTE,
4311 .procname = "accept_source_route", 4248 .procname = "accept_source_route",
4312 .data = &ipv6_devconf.accept_source_route, 4249 .data = &ipv6_devconf.accept_source_route,
4313 .maxlen = sizeof(int), 4250 .maxlen = sizeof(int),
@@ -4316,7 +4253,6 @@ static struct addrconf_sysctl_table
4316 }, 4253 },
4317#ifdef CONFIG_IPV6_OPTIMISTIC_DAD 4254#ifdef CONFIG_IPV6_OPTIMISTIC_DAD
4318 { 4255 {
4319 .ctl_name = CTL_UNNUMBERED,
4320 .procname = "optimistic_dad", 4256 .procname = "optimistic_dad",
4321 .data = &ipv6_devconf.optimistic_dad, 4257 .data = &ipv6_devconf.optimistic_dad,
4322 .maxlen = sizeof(int), 4258 .maxlen = sizeof(int),
@@ -4327,7 +4263,6 @@ static struct addrconf_sysctl_table
4327#endif 4263#endif
4328#ifdef CONFIG_IPV6_MROUTE 4264#ifdef CONFIG_IPV6_MROUTE
4329 { 4265 {
4330 .ctl_name = CTL_UNNUMBERED,
4331 .procname = "mc_forwarding", 4266 .procname = "mc_forwarding",
4332 .data = &ipv6_devconf.mc_forwarding, 4267 .data = &ipv6_devconf.mc_forwarding,
4333 .maxlen = sizeof(int), 4268 .maxlen = sizeof(int),
@@ -4336,16 +4271,13 @@ static struct addrconf_sysctl_table
4336 }, 4271 },
4337#endif 4272#endif
4338 { 4273 {
4339 .ctl_name = CTL_UNNUMBERED,
4340 .procname = "disable_ipv6", 4274 .procname = "disable_ipv6",
4341 .data = &ipv6_devconf.disable_ipv6, 4275 .data = &ipv6_devconf.disable_ipv6,
4342 .maxlen = sizeof(int), 4276 .maxlen = sizeof(int),
4343 .mode = 0644, 4277 .mode = 0644,
4344 .proc_handler = addrconf_sysctl_disable, 4278 .proc_handler = addrconf_sysctl_disable,
4345 .strategy = sysctl_intvec,
4346 }, 4279 },
4347 { 4280 {
4348 .ctl_name = CTL_UNNUMBERED,
4349 .procname = "accept_dad", 4281 .procname = "accept_dad",
4350 .data = &ipv6_devconf.accept_dad, 4282 .data = &ipv6_devconf.accept_dad,
4351 .maxlen = sizeof(int), 4283 .maxlen = sizeof(int),
@@ -4353,13 +4285,13 @@ static struct addrconf_sysctl_table
4353 .proc_handler = proc_dointvec, 4285 .proc_handler = proc_dointvec,
4354 }, 4286 },
4355 { 4287 {
4356 .ctl_name = 0, /* sentinel */ 4288 /* sentinel */
4357 } 4289 }
4358 }, 4290 },
4359}; 4291};
4360 4292
4361static int __addrconf_sysctl_register(struct net *net, char *dev_name, 4293static int __addrconf_sysctl_register(struct net *net, char *dev_name,
4362 int ctl_name, struct inet6_dev *idev, struct ipv6_devconf *p) 4294 struct inet6_dev *idev, struct ipv6_devconf *p)
4363{ 4295{
4364 int i; 4296 int i;
4365 struct addrconf_sysctl_table *t; 4297 struct addrconf_sysctl_table *t;
@@ -4367,9 +4299,9 @@ static int __addrconf_sysctl_register(struct net *net, char *dev_name,
4367#define ADDRCONF_CTL_PATH_DEV 3 4299#define ADDRCONF_CTL_PATH_DEV 3
4368 4300
4369 struct ctl_path addrconf_ctl_path[] = { 4301 struct ctl_path addrconf_ctl_path[] = {
4370 { .procname = "net", .ctl_name = CTL_NET, }, 4302 { .procname = "net", },
4371 { .procname = "ipv6", .ctl_name = NET_IPV6, }, 4303 { .procname = "ipv6", },
4372 { .procname = "conf", .ctl_name = NET_IPV6_CONF, }, 4304 { .procname = "conf", },
4373 { /* to be set */ }, 4305 { /* to be set */ },
4374 { }, 4306 { },
4375 }; 4307 };
@@ -4395,7 +4327,6 @@ static int __addrconf_sysctl_register(struct net *net, char *dev_name,
4395 goto free; 4327 goto free;
4396 4328
4397 addrconf_ctl_path[ADDRCONF_CTL_PATH_DEV].procname = t->dev_name; 4329 addrconf_ctl_path[ADDRCONF_CTL_PATH_DEV].procname = t->dev_name;
4398 addrconf_ctl_path[ADDRCONF_CTL_PATH_DEV].ctl_name = ctl_name;
4399 4330
4400 t->sysctl_header = register_net_sysctl_table(net, addrconf_ctl_path, 4331 t->sysctl_header = register_net_sysctl_table(net, addrconf_ctl_path,
4401 t->addrconf_vars); 4332 t->addrconf_vars);
@@ -4431,10 +4362,9 @@ static void addrconf_sysctl_register(struct inet6_dev *idev)
4431{ 4362{
4432 neigh_sysctl_register(idev->dev, idev->nd_parms, NET_IPV6, 4363 neigh_sysctl_register(idev->dev, idev->nd_parms, NET_IPV6,
4433 NET_IPV6_NEIGH, "ipv6", 4364 NET_IPV6_NEIGH, "ipv6",
4434 &ndisc_ifinfo_sysctl_change, 4365 &ndisc_ifinfo_sysctl_change);
4435 ndisc_ifinfo_sysctl_strategy);
4436 __addrconf_sysctl_register(dev_net(idev->dev), idev->dev->name, 4366 __addrconf_sysctl_register(dev_net(idev->dev), idev->dev->name,
4437 idev->dev->ifindex, idev, &idev->cnf); 4367 idev, &idev->cnf);
4438} 4368}
4439 4369
4440static void addrconf_sysctl_unregister(struct inet6_dev *idev) 4370static void addrconf_sysctl_unregister(struct inet6_dev *idev)
@@ -4473,13 +4403,11 @@ static int addrconf_init_net(struct net *net)
4473 net->ipv6.devconf_dflt = dflt; 4403 net->ipv6.devconf_dflt = dflt;
4474 4404
4475#ifdef CONFIG_SYSCTL 4405#ifdef CONFIG_SYSCTL
4476 err = __addrconf_sysctl_register(net, "all", NET_PROTO_CONF_ALL, 4406 err = __addrconf_sysctl_register(net, "all", NULL, all);
4477 NULL, all);
4478 if (err < 0) 4407 if (err < 0)
4479 goto err_reg_all; 4408 goto err_reg_all;
4480 4409
4481 err = __addrconf_sysctl_register(net, "default", NET_PROTO_CONF_DEFAULT, 4410 err = __addrconf_sysctl_register(net, "default", NULL, dflt);
4482 NULL, dflt);
4483 if (err < 0) 4411 if (err < 0)
4484 goto err_reg_dflt; 4412 goto err_reg_dflt;
4485#endif 4413#endif
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index f23ebbec0631..4ae661bc3677 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -942,15 +942,13 @@ EXPORT_SYMBOL(icmpv6_err_convert);
942#ifdef CONFIG_SYSCTL 942#ifdef CONFIG_SYSCTL
943ctl_table ipv6_icmp_table_template[] = { 943ctl_table ipv6_icmp_table_template[] = {
944 { 944 {
945 .ctl_name = NET_IPV6_ICMP_RATELIMIT,
946 .procname = "ratelimit", 945 .procname = "ratelimit",
947 .data = &init_net.ipv6.sysctl.icmpv6_time, 946 .data = &init_net.ipv6.sysctl.icmpv6_time,
948 .maxlen = sizeof(int), 947 .maxlen = sizeof(int),
949 .mode = 0644, 948 .mode = 0644,
950 .proc_handler = proc_dointvec_ms_jiffies, 949 .proc_handler = proc_dointvec_ms_jiffies,
951 .strategy = sysctl_ms_jiffies
952 }, 950 },
953 { .ctl_name = 0 }, 951 { },
954}; 952};
955 953
956struct ctl_table *ipv6_icmp_sysctl_init(struct net *net) 954struct ctl_table *ipv6_icmp_sysctl_init(struct net *net)
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index f74e4e2cdd06..3d0520e455d8 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -1768,42 +1768,6 @@ int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write, void __user *bu
1768 return ret; 1768 return ret;
1769} 1769}
1770 1770
1771int ndisc_ifinfo_sysctl_strategy(ctl_table *ctl,
1772 void __user *oldval, size_t __user *oldlenp,
1773 void __user *newval, size_t newlen)
1774{
1775 struct net_device *dev = ctl->extra1;
1776 struct inet6_dev *idev;
1777 int ret;
1778
1779 if (ctl->ctl_name == NET_NEIGH_RETRANS_TIME ||
1780 ctl->ctl_name == NET_NEIGH_REACHABLE_TIME)
1781 ndisc_warn_deprecated_sysctl(ctl, "procfs", dev ? dev->name : "default");
1782
1783 switch (ctl->ctl_name) {
1784 case NET_NEIGH_REACHABLE_TIME:
1785 ret = sysctl_jiffies(ctl, oldval, oldlenp, newval, newlen);
1786 break;
1787 case NET_NEIGH_RETRANS_TIME_MS:
1788 case NET_NEIGH_REACHABLE_TIME_MS:
1789 ret = sysctl_ms_jiffies(ctl, oldval, oldlenp, newval, newlen);
1790 break;
1791 default:
1792 ret = 0;
1793 }
1794
1795 if (newval && newlen && ret > 0 &&
1796 dev && (idev = in6_dev_get(dev)) != NULL) {
1797 if (ctl->ctl_name == NET_NEIGH_REACHABLE_TIME ||
1798 ctl->ctl_name == NET_NEIGH_REACHABLE_TIME_MS)
1799 idev->nd_parms->reachable_time = neigh_rand_reach_time(idev->nd_parms->base_reachable_time);
1800 idev->tstamp = jiffies;
1801 inet6_ifinfo_notify(RTM_NEWLINK, idev);
1802 in6_dev_put(idev);
1803 }
1804
1805 return ret;
1806}
1807 1771
1808#endif 1772#endif
1809 1773
@@ -1857,8 +1821,7 @@ int __init ndisc_init(void)
1857#ifdef CONFIG_SYSCTL 1821#ifdef CONFIG_SYSCTL
1858 err = neigh_sysctl_register(NULL, &nd_tbl.parms, NET_IPV6, 1822 err = neigh_sysctl_register(NULL, &nd_tbl.parms, NET_IPV6,
1859 NET_IPV6_NEIGH, "ipv6", 1823 NET_IPV6_NEIGH, "ipv6",
1860 &ndisc_ifinfo_sysctl_change, 1824 &ndisc_ifinfo_sysctl_change);
1861 &ndisc_ifinfo_sysctl_strategy);
1862 if (err) 1825 if (err)
1863 goto out_unregister_pernet; 1826 goto out_unregister_pernet;
1864#endif 1827#endif
diff --git a/net/ipv6/netfilter/ip6_queue.c b/net/ipv6/netfilter/ip6_queue.c
index 1cf3f0c6a959..14e52aa624c2 100644
--- a/net/ipv6/netfilter/ip6_queue.c
+++ b/net/ipv6/netfilter/ip6_queue.c
@@ -36,7 +36,6 @@
36 36
37#define IPQ_QMAX_DEFAULT 1024 37#define IPQ_QMAX_DEFAULT 1024
38#define IPQ_PROC_FS_NAME "ip6_queue" 38#define IPQ_PROC_FS_NAME "ip6_queue"
39#define NET_IPQ_QMAX 2088
40#define NET_IPQ_QMAX_NAME "ip6_queue_maxlen" 39#define NET_IPQ_QMAX_NAME "ip6_queue_maxlen"
41 40
42typedef int (*ipq_cmpfn)(struct nf_queue_entry *, unsigned long); 41typedef int (*ipq_cmpfn)(struct nf_queue_entry *, unsigned long);
@@ -518,14 +517,13 @@ static struct ctl_table_header *ipq_sysctl_header;
518 517
519static ctl_table ipq_table[] = { 518static ctl_table ipq_table[] = {
520 { 519 {
521 .ctl_name = NET_IPQ_QMAX,
522 .procname = NET_IPQ_QMAX_NAME, 520 .procname = NET_IPQ_QMAX_NAME,
523 .data = &queue_maxlen, 521 .data = &queue_maxlen,
524 .maxlen = sizeof(queue_maxlen), 522 .maxlen = sizeof(queue_maxlen),
525 .mode = 0644, 523 .mode = 0644,
526 .proc_handler = proc_dointvec 524 .proc_handler = proc_dointvec
527 }, 525 },
528 { .ctl_name = 0 } 526 { }
529}; 527};
530#endif 528#endif
531 529
diff --git a/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c b/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
index 642dcb127bab..2acadc8c7883 100644
--- a/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
+++ b/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
@@ -277,9 +277,7 @@ static struct ctl_table icmpv6_sysctl_table[] = {
277 .mode = 0644, 277 .mode = 0644,
278 .proc_handler = proc_dointvec_jiffies, 278 .proc_handler = proc_dointvec_jiffies,
279 }, 279 },
280 { 280 { }
281 .ctl_name = 0
282 }
283}; 281};
284#endif /* CONFIG_SYSCTL */ 282#endif /* CONFIG_SYSCTL */
285 283
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
index f3aba255ad9f..e0b9424fa1b2 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -83,7 +83,6 @@ struct ctl_table nf_ct_ipv6_sysctl_table[] = {
83 .proc_handler = proc_dointvec_jiffies, 83 .proc_handler = proc_dointvec_jiffies,
84 }, 84 },
85 { 85 {
86 .ctl_name = NET_NF_CONNTRACK_FRAG6_LOW_THRESH,
87 .procname = "nf_conntrack_frag6_low_thresh", 86 .procname = "nf_conntrack_frag6_low_thresh",
88 .data = &nf_init_frags.low_thresh, 87 .data = &nf_init_frags.low_thresh,
89 .maxlen = sizeof(unsigned int), 88 .maxlen = sizeof(unsigned int),
@@ -91,14 +90,13 @@ struct ctl_table nf_ct_ipv6_sysctl_table[] = {
91 .proc_handler = proc_dointvec, 90 .proc_handler = proc_dointvec,
92 }, 91 },
93 { 92 {
94 .ctl_name = NET_NF_CONNTRACK_FRAG6_HIGH_THRESH,
95 .procname = "nf_conntrack_frag6_high_thresh", 93 .procname = "nf_conntrack_frag6_high_thresh",
96 .data = &nf_init_frags.high_thresh, 94 .data = &nf_init_frags.high_thresh,
97 .maxlen = sizeof(unsigned int), 95 .maxlen = sizeof(unsigned int),
98 .mode = 0644, 96 .mode = 0644,
99 .proc_handler = proc_dointvec, 97 .proc_handler = proc_dointvec,
100 }, 98 },
101 { .ctl_name = 0 } 99 { }
102}; 100};
103#endif 101#endif
104 102
diff --git a/net/ipv6/reassembly.c b/net/ipv6/reassembly.c
index da5bd0ed83df..2499e9712031 100644
--- a/net/ipv6/reassembly.c
+++ b/net/ipv6/reassembly.c
@@ -636,7 +636,6 @@ static const struct inet6_protocol frag_protocol =
636#ifdef CONFIG_SYSCTL 636#ifdef CONFIG_SYSCTL
637static struct ctl_table ip6_frags_ns_ctl_table[] = { 637static struct ctl_table ip6_frags_ns_ctl_table[] = {
638 { 638 {
639 .ctl_name = NET_IPV6_IP6FRAG_HIGH_THRESH,
640 .procname = "ip6frag_high_thresh", 639 .procname = "ip6frag_high_thresh",
641 .data = &init_net.ipv6.frags.high_thresh, 640 .data = &init_net.ipv6.frags.high_thresh,
642 .maxlen = sizeof(int), 641 .maxlen = sizeof(int),
@@ -644,7 +643,6 @@ static struct ctl_table ip6_frags_ns_ctl_table[] = {
644 .proc_handler = proc_dointvec 643 .proc_handler = proc_dointvec
645 }, 644 },
646 { 645 {
647 .ctl_name = NET_IPV6_IP6FRAG_LOW_THRESH,
648 .procname = "ip6frag_low_thresh", 646 .procname = "ip6frag_low_thresh",
649 .data = &init_net.ipv6.frags.low_thresh, 647 .data = &init_net.ipv6.frags.low_thresh,
650 .maxlen = sizeof(int), 648 .maxlen = sizeof(int),
@@ -652,26 +650,22 @@ static struct ctl_table ip6_frags_ns_ctl_table[] = {
652 .proc_handler = proc_dointvec 650 .proc_handler = proc_dointvec
653 }, 651 },
654 { 652 {
655 .ctl_name = NET_IPV6_IP6FRAG_TIME,
656 .procname = "ip6frag_time", 653 .procname = "ip6frag_time",
657 .data = &init_net.ipv6.frags.timeout, 654 .data = &init_net.ipv6.frags.timeout,
658 .maxlen = sizeof(int), 655 .maxlen = sizeof(int),
659 .mode = 0644, 656 .mode = 0644,
660 .proc_handler = proc_dointvec_jiffies, 657 .proc_handler = proc_dointvec_jiffies,
661 .strategy = sysctl_jiffies,
662 }, 658 },
663 { } 659 { }
664}; 660};
665 661
666static struct ctl_table ip6_frags_ctl_table[] = { 662static struct ctl_table ip6_frags_ctl_table[] = {
667 { 663 {
668 .ctl_name = NET_IPV6_IP6FRAG_SECRET_INTERVAL,
669 .procname = "ip6frag_secret_interval", 664 .procname = "ip6frag_secret_interval",
670 .data = &ip6_frags.secret_interval, 665 .data = &ip6_frags.secret_interval,
671 .maxlen = sizeof(int), 666 .maxlen = sizeof(int),
672 .mode = 0644, 667 .mode = 0644,
673 .proc_handler = proc_dointvec_jiffies, 668 .proc_handler = proc_dointvec_jiffies,
674 .strategy = sysctl_jiffies
675 }, 669 },
676 { } 670 { }
677}; 671};
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index d6fe7646a8ff..6aa202e26f97 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2546,7 +2546,6 @@ ctl_table ipv6_route_table_template[] = {
2546 .proc_handler = ipv6_sysctl_rtcache_flush 2546 .proc_handler = ipv6_sysctl_rtcache_flush
2547 }, 2547 },
2548 { 2548 {
2549 .ctl_name = NET_IPV6_ROUTE_GC_THRESH,
2550 .procname = "gc_thresh", 2549 .procname = "gc_thresh",
2551 .data = &ip6_dst_ops_template.gc_thresh, 2550 .data = &ip6_dst_ops_template.gc_thresh,
2552 .maxlen = sizeof(int), 2551 .maxlen = sizeof(int),
@@ -2554,7 +2553,6 @@ ctl_table ipv6_route_table_template[] = {
2554 .proc_handler = proc_dointvec, 2553 .proc_handler = proc_dointvec,
2555 }, 2554 },
2556 { 2555 {
2557 .ctl_name = NET_IPV6_ROUTE_MAX_SIZE,
2558 .procname = "max_size", 2556 .procname = "max_size",
2559 .data = &init_net.ipv6.sysctl.ip6_rt_max_size, 2557 .data = &init_net.ipv6.sysctl.ip6_rt_max_size,
2560 .maxlen = sizeof(int), 2558 .maxlen = sizeof(int),
@@ -2562,69 +2560,55 @@ ctl_table ipv6_route_table_template[] = {
2562 .proc_handler = proc_dointvec, 2560 .proc_handler = proc_dointvec,
2563 }, 2561 },
2564 { 2562 {
2565 .ctl_name = NET_IPV6_ROUTE_GC_MIN_INTERVAL,
2566 .procname = "gc_min_interval", 2563 .procname = "gc_min_interval",
2567 .data = &init_net.ipv6.sysctl.ip6_rt_gc_min_interval, 2564 .data = &init_net.ipv6.sysctl.ip6_rt_gc_min_interval,
2568 .maxlen = sizeof(int), 2565 .maxlen = sizeof(int),
2569 .mode = 0644, 2566 .mode = 0644,
2570 .proc_handler = proc_dointvec_jiffies, 2567 .proc_handler = proc_dointvec_jiffies,
2571 .strategy = sysctl_jiffies,
2572 }, 2568 },
2573 { 2569 {
2574 .ctl_name = NET_IPV6_ROUTE_GC_TIMEOUT,
2575 .procname = "gc_timeout", 2570 .procname = "gc_timeout",
2576 .data = &init_net.ipv6.sysctl.ip6_rt_gc_timeout, 2571 .data = &init_net.ipv6.sysctl.ip6_rt_gc_timeout,
2577 .maxlen = sizeof(int), 2572 .maxlen = sizeof(int),
2578 .mode = 0644, 2573 .mode = 0644,
2579 .proc_handler = proc_dointvec_jiffies, 2574 .proc_handler = proc_dointvec_jiffies,
2580 .strategy = sysctl_jiffies,
2581 }, 2575 },
2582 { 2576 {
2583 .ctl_name = NET_IPV6_ROUTE_GC_INTERVAL,
2584 .procname = "gc_interval", 2577 .procname = "gc_interval",
2585 .data = &init_net.ipv6.sysctl.ip6_rt_gc_interval, 2578 .data = &init_net.ipv6.sysctl.ip6_rt_gc_interval,
2586 .maxlen = sizeof(int), 2579 .maxlen = sizeof(int),
2587 .mode = 0644, 2580 .mode = 0644,
2588 .proc_handler = proc_dointvec_jiffies, 2581 .proc_handler = proc_dointvec_jiffies,
2589 .strategy = sysctl_jiffies,
2590 }, 2582 },
2591 { 2583 {
2592 .ctl_name = NET_IPV6_ROUTE_GC_ELASTICITY,
2593 .procname = "gc_elasticity", 2584 .procname = "gc_elasticity",
2594 .data = &init_net.ipv6.sysctl.ip6_rt_gc_elasticity, 2585 .data = &init_net.ipv6.sysctl.ip6_rt_gc_elasticity,
2595 .maxlen = sizeof(int), 2586 .maxlen = sizeof(int),
2596 .mode = 0644, 2587 .mode = 0644,
2597 .proc_handler = proc_dointvec_jiffies, 2588 .proc_handler = proc_dointvec_jiffies,
2598 .strategy = sysctl_jiffies,
2599 }, 2589 },
2600 { 2590 {
2601 .ctl_name = NET_IPV6_ROUTE_MTU_EXPIRES,
2602 .procname = "mtu_expires", 2591 .procname = "mtu_expires",
2603 .data = &init_net.ipv6.sysctl.ip6_rt_mtu_expires, 2592 .data = &init_net.ipv6.sysctl.ip6_rt_mtu_expires,
2604 .maxlen = sizeof(int), 2593 .maxlen = sizeof(int),
2605 .mode = 0644, 2594 .mode = 0644,
2606 .proc_handler = proc_dointvec_jiffies, 2595 .proc_handler = proc_dointvec_jiffies,
2607 .strategy = sysctl_jiffies,
2608 }, 2596 },
2609 { 2597 {
2610 .ctl_name = NET_IPV6_ROUTE_MIN_ADVMSS,
2611 .procname = "min_adv_mss", 2598 .procname = "min_adv_mss",
2612 .data = &init_net.ipv6.sysctl.ip6_rt_min_advmss, 2599 .data = &init_net.ipv6.sysctl.ip6_rt_min_advmss,
2613 .maxlen = sizeof(int), 2600 .maxlen = sizeof(int),
2614 .mode = 0644, 2601 .mode = 0644,
2615 .proc_handler = proc_dointvec_jiffies, 2602 .proc_handler = proc_dointvec_jiffies,
2616 .strategy = sysctl_jiffies,
2617 }, 2603 },
2618 { 2604 {
2619 .ctl_name = NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS,
2620 .procname = "gc_min_interval_ms", 2605 .procname = "gc_min_interval_ms",
2621 .data = &init_net.ipv6.sysctl.ip6_rt_gc_min_interval, 2606 .data = &init_net.ipv6.sysctl.ip6_rt_gc_min_interval,
2622 .maxlen = sizeof(int), 2607 .maxlen = sizeof(int),
2623 .mode = 0644, 2608 .mode = 0644,
2624 .proc_handler = proc_dointvec_ms_jiffies, 2609 .proc_handler = proc_dointvec_ms_jiffies,
2625 .strategy = sysctl_ms_jiffies,
2626 }, 2610 },
2627 { .ctl_name = 0 } 2611 { }
2628}; 2612};
2629 2613
2630struct ctl_table *ipv6_route_sysctl_init(struct net *net) 2614struct ctl_table *ipv6_route_sysctl_init(struct net *net)
diff --git a/net/ipv6/sysctl_net_ipv6.c b/net/ipv6/sysctl_net_ipv6.c
index 0dc6a4e5ed4a..c690736885b4 100644
--- a/net/ipv6/sysctl_net_ipv6.c
+++ b/net/ipv6/sysctl_net_ipv6.c
@@ -16,45 +16,41 @@
16 16
17static ctl_table ipv6_table_template[] = { 17static ctl_table ipv6_table_template[] = {
18 { 18 {
19 .ctl_name = NET_IPV6_ROUTE,
20 .procname = "route", 19 .procname = "route",
21 .maxlen = 0, 20 .maxlen = 0,
22 .mode = 0555, 21 .mode = 0555,
23 .child = ipv6_route_table_template 22 .child = ipv6_route_table_template
24 }, 23 },
25 { 24 {
26 .ctl_name = NET_IPV6_ICMP,
27 .procname = "icmp", 25 .procname = "icmp",
28 .maxlen = 0, 26 .maxlen = 0,
29 .mode = 0555, 27 .mode = 0555,
30 .child = ipv6_icmp_table_template 28 .child = ipv6_icmp_table_template
31 }, 29 },
32 { 30 {
33 .ctl_name = NET_IPV6_BINDV6ONLY,
34 .procname = "bindv6only", 31 .procname = "bindv6only",
35 .data = &init_net.ipv6.sysctl.bindv6only, 32 .data = &init_net.ipv6.sysctl.bindv6only,
36 .maxlen = sizeof(int), 33 .maxlen = sizeof(int),
37 .mode = 0644, 34 .mode = 0644,
38 .proc_handler = proc_dointvec 35 .proc_handler = proc_dointvec
39 }, 36 },
40 { .ctl_name = 0 } 37 { }
41}; 38};
42 39
43static ctl_table ipv6_rotable[] = { 40static ctl_table ipv6_rotable[] = {
44 { 41 {
45 .ctl_name = NET_IPV6_MLD_MAX_MSF,
46 .procname = "mld_max_msf", 42 .procname = "mld_max_msf",
47 .data = &sysctl_mld_max_msf, 43 .data = &sysctl_mld_max_msf,
48 .maxlen = sizeof(int), 44 .maxlen = sizeof(int),
49 .mode = 0644, 45 .mode = 0644,
50 .proc_handler = proc_dointvec 46 .proc_handler = proc_dointvec
51 }, 47 },
52 { .ctl_name = 0 } 48 { }
53}; 49};
54 50
55struct ctl_path net_ipv6_ctl_path[] = { 51struct ctl_path net_ipv6_ctl_path[] = {
56 { .procname = "net", .ctl_name = CTL_NET, }, 52 { .procname = "net", },
57 { .procname = "ipv6", .ctl_name = NET_IPV6, }, 53 { .procname = "ipv6", },
58 { }, 54 { },
59}; 55};
60EXPORT_SYMBOL_GPL(net_ipv6_ctl_path); 56EXPORT_SYMBOL_GPL(net_ipv6_ctl_path);
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c
index 8ec3d45cd1d9..7254e3f899a7 100644
--- a/net/ipv6/xfrm6_policy.c
+++ b/net/ipv6/xfrm6_policy.c
@@ -309,7 +309,6 @@ static void xfrm6_policy_fini(void)
309#ifdef CONFIG_SYSCTL 309#ifdef CONFIG_SYSCTL
310static struct ctl_table xfrm6_policy_table[] = { 310static struct ctl_table xfrm6_policy_table[] = {
311 { 311 {
312 .ctl_name = CTL_UNNUMBERED,
313 .procname = "xfrm6_gc_thresh", 312 .procname = "xfrm6_gc_thresh",
314 .data = &xfrm6_dst_ops.gc_thresh, 313 .data = &xfrm6_dst_ops.gc_thresh,
315 .maxlen = sizeof(int), 314 .maxlen = sizeof(int),
diff --git a/net/ipx/sysctl_net_ipx.c b/net/ipx/sysctl_net_ipx.c
index 633fcab35580..bd6dca00fb85 100644
--- a/net/ipx/sysctl_net_ipx.c
+++ b/net/ipx/sysctl_net_ipx.c
@@ -18,19 +18,18 @@ extern int sysctl_ipx_pprop_broadcasting;
18 18
19static struct ctl_table ipx_table[] = { 19static struct ctl_table ipx_table[] = {
20 { 20 {
21 .ctl_name = NET_IPX_PPROP_BROADCASTING,
22 .procname = "ipx_pprop_broadcasting", 21 .procname = "ipx_pprop_broadcasting",
23 .data = &sysctl_ipx_pprop_broadcasting, 22 .data = &sysctl_ipx_pprop_broadcasting,
24 .maxlen = sizeof(int), 23 .maxlen = sizeof(int),
25 .mode = 0644, 24 .mode = 0644,
26 .proc_handler = proc_dointvec, 25 .proc_handler = proc_dointvec,
27 }, 26 },
28 { 0 }, 27 { },
29}; 28};
30 29
31static struct ctl_path ipx_path[] = { 30static struct ctl_path ipx_path[] = {
32 { .procname = "net", .ctl_name = CTL_NET, }, 31 { .procname = "net", },
33 { .procname = "ipx", .ctl_name = NET_IPX, }, 32 { .procname = "ipx", },
34 { } 33 { }
35}; 34};
36 35
diff --git a/net/irda/irsysctl.c b/net/irda/irsysctl.c
index 5c86567e5a78..d0b70dadf73b 100644
--- a/net/irda/irsysctl.c
+++ b/net/irda/irsysctl.c
@@ -113,26 +113,21 @@ static int do_discovery(ctl_table *table, int write,
113/* One file */ 113/* One file */
114static ctl_table irda_table[] = { 114static ctl_table irda_table[] = {
115 { 115 {
116 .ctl_name = NET_IRDA_DISCOVERY,
117 .procname = "discovery", 116 .procname = "discovery",
118 .data = &sysctl_discovery, 117 .data = &sysctl_discovery,
119 .maxlen = sizeof(int), 118 .maxlen = sizeof(int),
120 .mode = 0644, 119 .mode = 0644,
121 .proc_handler = do_discovery, 120 .proc_handler = do_discovery,
122 .strategy = sysctl_intvec
123 }, 121 },
124 { 122 {
125 .ctl_name = NET_IRDA_DEVNAME,
126 .procname = "devname", 123 .procname = "devname",
127 .data = sysctl_devname, 124 .data = sysctl_devname,
128 .maxlen = 65, 125 .maxlen = 65,
129 .mode = 0644, 126 .mode = 0644,
130 .proc_handler = do_devname, 127 .proc_handler = do_devname,
131 .strategy = sysctl_string
132 }, 128 },
133#ifdef CONFIG_IRDA_DEBUG 129#ifdef CONFIG_IRDA_DEBUG
134 { 130 {
135 .ctl_name = NET_IRDA_DEBUG,
136 .procname = "debug", 131 .procname = "debug",
137 .data = &irda_debug, 132 .data = &irda_debug,
138 .maxlen = sizeof(int), 133 .maxlen = sizeof(int),
@@ -142,7 +137,6 @@ static ctl_table irda_table[] = {
142#endif 137#endif
143#ifdef CONFIG_IRDA_FAST_RR 138#ifdef CONFIG_IRDA_FAST_RR
144 { 139 {
145 .ctl_name = NET_IRDA_FAST_POLL,
146 .procname = "fast_poll_increase", 140 .procname = "fast_poll_increase",
147 .data = &sysctl_fast_poll_increase, 141 .data = &sysctl_fast_poll_increase,
148 .maxlen = sizeof(int), 142 .maxlen = sizeof(int),
@@ -151,18 +145,15 @@ static ctl_table irda_table[] = {
151 }, 145 },
152#endif 146#endif
153 { 147 {
154 .ctl_name = NET_IRDA_DISCOVERY_SLOTS,
155 .procname = "discovery_slots", 148 .procname = "discovery_slots",
156 .data = &sysctl_discovery_slots, 149 .data = &sysctl_discovery_slots,
157 .maxlen = sizeof(int), 150 .maxlen = sizeof(int),
158 .mode = 0644, 151 .mode = 0644,
159 .proc_handler = proc_dointvec_minmax, 152 .proc_handler = proc_dointvec_minmax,
160 .strategy = sysctl_intvec,
161 .extra1 = &min_discovery_slots, 153 .extra1 = &min_discovery_slots,
162 .extra2 = &max_discovery_slots 154 .extra2 = &max_discovery_slots
163 }, 155 },
164 { 156 {
165 .ctl_name = NET_IRDA_DISCOVERY_TIMEOUT,
166 .procname = "discovery_timeout", 157 .procname = "discovery_timeout",
167 .data = &sysctl_discovery_timeout, 158 .data = &sysctl_discovery_timeout,
168 .maxlen = sizeof(int), 159 .maxlen = sizeof(int),
@@ -170,99 +161,83 @@ static ctl_table irda_table[] = {
170 .proc_handler = proc_dointvec 161 .proc_handler = proc_dointvec
171 }, 162 },
172 { 163 {
173 .ctl_name = NET_IRDA_SLOT_TIMEOUT,
174 .procname = "slot_timeout", 164 .procname = "slot_timeout",
175 .data = &sysctl_slot_timeout, 165 .data = &sysctl_slot_timeout,
176 .maxlen = sizeof(int), 166 .maxlen = sizeof(int),
177 .mode = 0644, 167 .mode = 0644,
178 .proc_handler = proc_dointvec_minmax, 168 .proc_handler = proc_dointvec_minmax,
179 .strategy = sysctl_intvec,
180 .extra1 = &min_slot_timeout, 169 .extra1 = &min_slot_timeout,
181 .extra2 = &max_slot_timeout 170 .extra2 = &max_slot_timeout
182 }, 171 },
183 { 172 {
184 .ctl_name = NET_IRDA_MAX_BAUD_RATE,
185 .procname = "max_baud_rate", 173 .procname = "max_baud_rate",
186 .data = &sysctl_max_baud_rate, 174 .data = &sysctl_max_baud_rate,
187 .maxlen = sizeof(int), 175 .maxlen = sizeof(int),
188 .mode = 0644, 176 .mode = 0644,
189 .proc_handler = proc_dointvec_minmax, 177 .proc_handler = proc_dointvec_minmax,
190 .strategy = sysctl_intvec,
191 .extra1 = &min_max_baud_rate, 178 .extra1 = &min_max_baud_rate,
192 .extra2 = &max_max_baud_rate 179 .extra2 = &max_max_baud_rate
193 }, 180 },
194 { 181 {
195 .ctl_name = NET_IRDA_MIN_TX_TURN_TIME,
196 .procname = "min_tx_turn_time", 182 .procname = "min_tx_turn_time",
197 .data = &sysctl_min_tx_turn_time, 183 .data = &sysctl_min_tx_turn_time,
198 .maxlen = sizeof(int), 184 .maxlen = sizeof(int),
199 .mode = 0644, 185 .mode = 0644,
200 .proc_handler = proc_dointvec_minmax, 186 .proc_handler = proc_dointvec_minmax,
201 .strategy = sysctl_intvec,
202 .extra1 = &min_min_tx_turn_time, 187 .extra1 = &min_min_tx_turn_time,
203 .extra2 = &max_min_tx_turn_time 188 .extra2 = &max_min_tx_turn_time
204 }, 189 },
205 { 190 {
206 .ctl_name = NET_IRDA_MAX_TX_DATA_SIZE,
207 .procname = "max_tx_data_size", 191 .procname = "max_tx_data_size",
208 .data = &sysctl_max_tx_data_size, 192 .data = &sysctl_max_tx_data_size,
209 .maxlen = sizeof(int), 193 .maxlen = sizeof(int),
210 .mode = 0644, 194 .mode = 0644,
211 .proc_handler = proc_dointvec_minmax, 195 .proc_handler = proc_dointvec_minmax,
212 .strategy = sysctl_intvec,
213 .extra1 = &min_max_tx_data_size, 196 .extra1 = &min_max_tx_data_size,
214 .extra2 = &max_max_tx_data_size 197 .extra2 = &max_max_tx_data_size
215 }, 198 },
216 { 199 {
217 .ctl_name = NET_IRDA_MAX_TX_WINDOW,
218 .procname = "max_tx_window", 200 .procname = "max_tx_window",
219 .data = &sysctl_max_tx_window, 201 .data = &sysctl_max_tx_window,
220 .maxlen = sizeof(int), 202 .maxlen = sizeof(int),
221 .mode = 0644, 203 .mode = 0644,
222 .proc_handler = proc_dointvec_minmax, 204 .proc_handler = proc_dointvec_minmax,
223 .strategy = sysctl_intvec,
224 .extra1 = &min_max_tx_window, 205 .extra1 = &min_max_tx_window,
225 .extra2 = &max_max_tx_window 206 .extra2 = &max_max_tx_window
226 }, 207 },
227 { 208 {
228 .ctl_name = NET_IRDA_MAX_NOREPLY_TIME,
229 .procname = "max_noreply_time", 209 .procname = "max_noreply_time",
230 .data = &sysctl_max_noreply_time, 210 .data = &sysctl_max_noreply_time,
231 .maxlen = sizeof(int), 211 .maxlen = sizeof(int),
232 .mode = 0644, 212 .mode = 0644,
233 .proc_handler = proc_dointvec_minmax, 213 .proc_handler = proc_dointvec_minmax,
234 .strategy = sysctl_intvec,
235 .extra1 = &min_max_noreply_time, 214 .extra1 = &min_max_noreply_time,
236 .extra2 = &max_max_noreply_time 215 .extra2 = &max_max_noreply_time
237 }, 216 },
238 { 217 {
239 .ctl_name = NET_IRDA_WARN_NOREPLY_TIME,
240 .procname = "warn_noreply_time", 218 .procname = "warn_noreply_time",
241 .data = &sysctl_warn_noreply_time, 219 .data = &sysctl_warn_noreply_time,
242 .maxlen = sizeof(int), 220 .maxlen = sizeof(int),
243 .mode = 0644, 221 .mode = 0644,
244 .proc_handler = proc_dointvec_minmax, 222 .proc_handler = proc_dointvec_minmax,
245 .strategy = sysctl_intvec,
246 .extra1 = &min_warn_noreply_time, 223 .extra1 = &min_warn_noreply_time,
247 .extra2 = &max_warn_noreply_time 224 .extra2 = &max_warn_noreply_time
248 }, 225 },
249 { 226 {
250 .ctl_name = NET_IRDA_LAP_KEEPALIVE_TIME,
251 .procname = "lap_keepalive_time", 227 .procname = "lap_keepalive_time",
252 .data = &sysctl_lap_keepalive_time, 228 .data = &sysctl_lap_keepalive_time,
253 .maxlen = sizeof(int), 229 .maxlen = sizeof(int),
254 .mode = 0644, 230 .mode = 0644,
255 .proc_handler = proc_dointvec_minmax, 231 .proc_handler = proc_dointvec_minmax,
256 .strategy = sysctl_intvec,
257 .extra1 = &min_lap_keepalive_time, 232 .extra1 = &min_lap_keepalive_time,
258 .extra2 = &max_lap_keepalive_time 233 .extra2 = &max_lap_keepalive_time
259 }, 234 },
260 { .ctl_name = 0 } 235 { }
261}; 236};
262 237
263static struct ctl_path irda_path[] = { 238static struct ctl_path irda_path[] = {
264 { .procname = "net", .ctl_name = CTL_NET, }, 239 { .procname = "net", },
265 { .procname = "irda", .ctl_name = NET_IRDA, }, 240 { .procname = "irda", },
266 { } 241 { }
267}; 242};
268 243
diff --git a/net/llc/sysctl_net_llc.c b/net/llc/sysctl_net_llc.c
index 57b9304d444c..e2ebe3586263 100644
--- a/net/llc/sysctl_net_llc.c
+++ b/net/llc/sysctl_net_llc.c
@@ -15,86 +15,73 @@
15 15
16static struct ctl_table llc2_timeout_table[] = { 16static struct ctl_table llc2_timeout_table[] = {
17 { 17 {
18 .ctl_name = NET_LLC2_ACK_TIMEOUT,
19 .procname = "ack", 18 .procname = "ack",
20 .data = &sysctl_llc2_ack_timeout, 19 .data = &sysctl_llc2_ack_timeout,
21 .maxlen = sizeof(long), 20 .maxlen = sizeof(long),
22 .mode = 0644, 21 .mode = 0644,
23 .proc_handler = proc_dointvec_jiffies, 22 .proc_handler = proc_dointvec_jiffies,
24 .strategy = sysctl_jiffies,
25 }, 23 },
26 { 24 {
27 .ctl_name = NET_LLC2_BUSY_TIMEOUT,
28 .procname = "busy", 25 .procname = "busy",
29 .data = &sysctl_llc2_busy_timeout, 26 .data = &sysctl_llc2_busy_timeout,
30 .maxlen = sizeof(long), 27 .maxlen = sizeof(long),
31 .mode = 0644, 28 .mode = 0644,
32 .proc_handler = proc_dointvec_jiffies, 29 .proc_handler = proc_dointvec_jiffies,
33 .strategy = sysctl_jiffies,
34 }, 30 },
35 { 31 {
36 .ctl_name = NET_LLC2_P_TIMEOUT,
37 .procname = "p", 32 .procname = "p",
38 .data = &sysctl_llc2_p_timeout, 33 .data = &sysctl_llc2_p_timeout,
39 .maxlen = sizeof(long), 34 .maxlen = sizeof(long),
40 .mode = 0644, 35 .mode = 0644,
41 .proc_handler = proc_dointvec_jiffies, 36 .proc_handler = proc_dointvec_jiffies,
42 .strategy = sysctl_jiffies,
43 }, 37 },
44 { 38 {
45 .ctl_name = NET_LLC2_REJ_TIMEOUT,
46 .procname = "rej", 39 .procname = "rej",
47 .data = &sysctl_llc2_rej_timeout, 40 .data = &sysctl_llc2_rej_timeout,
48 .maxlen = sizeof(long), 41 .maxlen = sizeof(long),
49 .mode = 0644, 42 .mode = 0644,
50 .proc_handler = proc_dointvec_jiffies, 43 .proc_handler = proc_dointvec_jiffies,
51 .strategy = sysctl_jiffies,
52 }, 44 },
53 { 0 }, 45 { },
54}; 46};
55 47
56static struct ctl_table llc_station_table[] = { 48static struct ctl_table llc_station_table[] = {
57 { 49 {
58 .ctl_name = NET_LLC_STATION_ACK_TIMEOUT,
59 .procname = "ack_timeout", 50 .procname = "ack_timeout",
60 .data = &sysctl_llc_station_ack_timeout, 51 .data = &sysctl_llc_station_ack_timeout,
61 .maxlen = sizeof(long), 52 .maxlen = sizeof(long),
62 .mode = 0644, 53 .mode = 0644,
63 .proc_handler = proc_dointvec_jiffies, 54 .proc_handler = proc_dointvec_jiffies,
64 .strategy = sysctl_jiffies,
65 }, 55 },
66 { 0 }, 56 { },
67}; 57};
68 58
69static struct ctl_table llc2_dir_timeout_table[] = { 59static struct ctl_table llc2_dir_timeout_table[] = {
70 { 60 {
71 .ctl_name = NET_LLC2,
72 .procname = "timeout", 61 .procname = "timeout",
73 .mode = 0555, 62 .mode = 0555,
74 .child = llc2_timeout_table, 63 .child = llc2_timeout_table,
75 }, 64 },
76 { 0 }, 65 { },
77}; 66};
78 67
79static struct ctl_table llc_table[] = { 68static struct ctl_table llc_table[] = {
80 { 69 {
81 .ctl_name = NET_LLC2,
82 .procname = "llc2", 70 .procname = "llc2",
83 .mode = 0555, 71 .mode = 0555,
84 .child = llc2_dir_timeout_table, 72 .child = llc2_dir_timeout_table,
85 }, 73 },
86 { 74 {
87 .ctl_name = NET_LLC_STATION,
88 .procname = "station", 75 .procname = "station",
89 .mode = 0555, 76 .mode = 0555,
90 .child = llc_station_table, 77 .child = llc_station_table,
91 }, 78 },
92 { 0 }, 79 { },
93}; 80};
94 81
95static struct ctl_path llc_path[] = { 82static struct ctl_path llc_path[] = {
96 { .procname = "net", .ctl_name = CTL_NET, }, 83 { .procname = "net", },
97 { .procname = "llc", .ctl_name = NET_LLC, }, 84 { .procname = "llc", },
98 { } 85 { }
99}; 86};
100 87
diff --git a/net/netfilter/core.c b/net/netfilter/core.c
index 5bb34737501f..60ec4e4badaa 100644
--- a/net/netfilter/core.c
+++ b/net/netfilter/core.c
@@ -273,8 +273,8 @@ void __init netfilter_init(void)
273 273
274#ifdef CONFIG_SYSCTL 274#ifdef CONFIG_SYSCTL
275struct ctl_path nf_net_netfilter_sysctl_path[] = { 275struct ctl_path nf_net_netfilter_sysctl_path[] = {
276 { .procname = "net", .ctl_name = CTL_NET, }, 276 { .procname = "net", },
277 { .procname = "netfilter", .ctl_name = NET_NETFILTER, }, 277 { .procname = "netfilter", },
278 { } 278 { }
279}; 279};
280EXPORT_SYMBOL_GPL(nf_net_netfilter_sysctl_path); 280EXPORT_SYMBOL_GPL(nf_net_netfilter_sysctl_path);
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 446e9bd4b4bc..e55a6861d26f 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -1706,12 +1706,12 @@ static struct ctl_table vs_vars[] = {
1706 .mode = 0644, 1706 .mode = 0644,
1707 .proc_handler = proc_dointvec, 1707 .proc_handler = proc_dointvec,
1708 }, 1708 },
1709 { .ctl_name = 0 } 1709 { }
1710}; 1710};
1711 1711
1712const struct ctl_path net_vs_ctl_path[] = { 1712const struct ctl_path net_vs_ctl_path[] = {
1713 { .procname = "net", .ctl_name = CTL_NET, }, 1713 { .procname = "net", },
1714 { .procname = "ipv4", .ctl_name = NET_IPV4, }, 1714 { .procname = "ipv4", },
1715 { .procname = "vs", }, 1715 { .procname = "vs", },
1716 { } 1716 { }
1717}; 1717};
diff --git a/net/netfilter/ipvs/ip_vs_lblc.c b/net/netfilter/ipvs/ip_vs_lblc.c
index c1757f3620cd..1b9370db2305 100644
--- a/net/netfilter/ipvs/ip_vs_lblc.c
+++ b/net/netfilter/ipvs/ip_vs_lblc.c
@@ -121,7 +121,7 @@ static ctl_table vs_vars_table[] = {
121 .mode = 0644, 121 .mode = 0644,
122 .proc_handler = proc_dointvec_jiffies, 122 .proc_handler = proc_dointvec_jiffies,
123 }, 123 },
124 { .ctl_name = 0 } 124 { }
125}; 125};
126 126
127static struct ctl_table_header * sysctl_header; 127static struct ctl_table_header * sysctl_header;
diff --git a/net/netfilter/ipvs/ip_vs_lblcr.c b/net/netfilter/ipvs/ip_vs_lblcr.c
index 715b57f9540d..f7476b95ab46 100644
--- a/net/netfilter/ipvs/ip_vs_lblcr.c
+++ b/net/netfilter/ipvs/ip_vs_lblcr.c
@@ -302,7 +302,7 @@ static ctl_table vs_vars_table[] = {
302 .mode = 0644, 302 .mode = 0644,
303 .proc_handler = proc_dointvec_jiffies, 303 .proc_handler = proc_dointvec_jiffies,
304 }, 304 },
305 { .ctl_name = 0 } 305 { }
306}; 306};
307 307
308static struct ctl_table_header * sysctl_header; 308static struct ctl_table_header * sysctl_header;
diff --git a/net/netfilter/nf_conntrack_acct.c b/net/netfilter/nf_conntrack_acct.c
index 4a1d94aac20b..018f90db511c 100644
--- a/net/netfilter/nf_conntrack_acct.c
+++ b/net/netfilter/nf_conntrack_acct.c
@@ -30,7 +30,6 @@ MODULE_PARM_DESC(acct, "Enable connection tracking flow accounting.");
30#ifdef CONFIG_SYSCTL 30#ifdef CONFIG_SYSCTL
31static struct ctl_table acct_sysctl_table[] = { 31static struct ctl_table acct_sysctl_table[] = {
32 { 32 {
33 .ctl_name = CTL_UNNUMBERED,
34 .procname = "nf_conntrack_acct", 33 .procname = "nf_conntrack_acct",
35 .data = &init_net.ct.sysctl_acct, 34 .data = &init_net.ct.sysctl_acct,
36 .maxlen = sizeof(unsigned int), 35 .maxlen = sizeof(unsigned int),
diff --git a/net/netfilter/nf_conntrack_ecache.c b/net/netfilter/nf_conntrack_ecache.c
index aee560b4768d..d5a9bcd7d61b 100644
--- a/net/netfilter/nf_conntrack_ecache.c
+++ b/net/netfilter/nf_conntrack_ecache.c
@@ -151,7 +151,6 @@ static int nf_ct_events_retry_timeout __read_mostly = 15*HZ;
151#ifdef CONFIG_SYSCTL 151#ifdef CONFIG_SYSCTL
152static struct ctl_table event_sysctl_table[] = { 152static struct ctl_table event_sysctl_table[] = {
153 { 153 {
154 .ctl_name = CTL_UNNUMBERED,
155 .procname = "nf_conntrack_events", 154 .procname = "nf_conntrack_events",
156 .data = &init_net.ct.sysctl_events, 155 .data = &init_net.ct.sysctl_events,
157 .maxlen = sizeof(unsigned int), 156 .maxlen = sizeof(unsigned int),
@@ -159,7 +158,6 @@ static struct ctl_table event_sysctl_table[] = {
159 .proc_handler = proc_dointvec, 158 .proc_handler = proc_dointvec,
160 }, 159 },
161 { 160 {
162 .ctl_name = CTL_UNNUMBERED,
163 .procname = "nf_conntrack_events_retry_timeout", 161 .procname = "nf_conntrack_events_retry_timeout",
164 .data = &init_net.ct.sysctl_events_retry_timeout, 162 .data = &init_net.ct.sysctl_events_retry_timeout,
165 .maxlen = sizeof(unsigned int), 163 .maxlen = sizeof(unsigned int),
diff --git a/net/netfilter/nf_conntrack_proto_dccp.c b/net/netfilter/nf_conntrack_proto_dccp.c
index 1b816a2ea813..7bf1395b4158 100644
--- a/net/netfilter/nf_conntrack_proto_dccp.c
+++ b/net/netfilter/nf_conntrack_proto_dccp.c
@@ -703,64 +703,54 @@ static int dccp_nlattr_size(void)
703/* template, data assigned later */ 703/* template, data assigned later */
704static struct ctl_table dccp_sysctl_table[] = { 704static struct ctl_table dccp_sysctl_table[] = {
705 { 705 {
706 .ctl_name = CTL_UNNUMBERED,
707 .procname = "nf_conntrack_dccp_timeout_request", 706 .procname = "nf_conntrack_dccp_timeout_request",
708 .maxlen = sizeof(unsigned int), 707 .maxlen = sizeof(unsigned int),
709 .mode = 0644, 708 .mode = 0644,
710 .proc_handler = proc_dointvec_jiffies, 709 .proc_handler = proc_dointvec_jiffies,
711 }, 710 },
712 { 711 {
713 .ctl_name = CTL_UNNUMBERED,
714 .procname = "nf_conntrack_dccp_timeout_respond", 712 .procname = "nf_conntrack_dccp_timeout_respond",
715 .maxlen = sizeof(unsigned int), 713 .maxlen = sizeof(unsigned int),
716 .mode = 0644, 714 .mode = 0644,
717 .proc_handler = proc_dointvec_jiffies, 715 .proc_handler = proc_dointvec_jiffies,
718 }, 716 },
719 { 717 {
720 .ctl_name = CTL_UNNUMBERED,
721 .procname = "nf_conntrack_dccp_timeout_partopen", 718 .procname = "nf_conntrack_dccp_timeout_partopen",
722 .maxlen = sizeof(unsigned int), 719 .maxlen = sizeof(unsigned int),
723 .mode = 0644, 720 .mode = 0644,
724 .proc_handler = proc_dointvec_jiffies, 721 .proc_handler = proc_dointvec_jiffies,
725 }, 722 },
726 { 723 {
727 .ctl_name = CTL_UNNUMBERED,
728 .procname = "nf_conntrack_dccp_timeout_open", 724 .procname = "nf_conntrack_dccp_timeout_open",
729 .maxlen = sizeof(unsigned int), 725 .maxlen = sizeof(unsigned int),
730 .mode = 0644, 726 .mode = 0644,
731 .proc_handler = proc_dointvec_jiffies, 727 .proc_handler = proc_dointvec_jiffies,
732 }, 728 },
733 { 729 {
734 .ctl_name = CTL_UNNUMBERED,
735 .procname = "nf_conntrack_dccp_timeout_closereq", 730 .procname = "nf_conntrack_dccp_timeout_closereq",
736 .maxlen = sizeof(unsigned int), 731 .maxlen = sizeof(unsigned int),
737 .mode = 0644, 732 .mode = 0644,
738 .proc_handler = proc_dointvec_jiffies, 733 .proc_handler = proc_dointvec_jiffies,
739 }, 734 },
740 { 735 {
741 .ctl_name = CTL_UNNUMBERED,
742 .procname = "nf_conntrack_dccp_timeout_closing", 736 .procname = "nf_conntrack_dccp_timeout_closing",
743 .maxlen = sizeof(unsigned int), 737 .maxlen = sizeof(unsigned int),
744 .mode = 0644, 738 .mode = 0644,
745 .proc_handler = proc_dointvec_jiffies, 739 .proc_handler = proc_dointvec_jiffies,
746 }, 740 },
747 { 741 {
748 .ctl_name = CTL_UNNUMBERED,
749 .procname = "nf_conntrack_dccp_timeout_timewait", 742 .procname = "nf_conntrack_dccp_timeout_timewait",
750 .maxlen = sizeof(unsigned int), 743 .maxlen = sizeof(unsigned int),
751 .mode = 0644, 744 .mode = 0644,
752 .proc_handler = proc_dointvec_jiffies, 745 .proc_handler = proc_dointvec_jiffies,
753 }, 746 },
754 { 747 {
755 .ctl_name = CTL_UNNUMBERED,
756 .procname = "nf_conntrack_dccp_loose", 748 .procname = "nf_conntrack_dccp_loose",
757 .maxlen = sizeof(int), 749 .maxlen = sizeof(int),
758 .mode = 0644, 750 .mode = 0644,
759 .proc_handler = proc_dointvec, 751 .proc_handler = proc_dointvec,
760 }, 752 },
761 { 753 { }
762 .ctl_name = 0,
763 }
764}; 754};
765#endif /* CONFIG_SYSCTL */ 755#endif /* CONFIG_SYSCTL */
766 756
diff --git a/net/netfilter/nf_conntrack_proto_generic.c b/net/netfilter/nf_conntrack_proto_generic.c
index 829374f426c4..e2091d0c7a2f 100644
--- a/net/netfilter/nf_conntrack_proto_generic.c
+++ b/net/netfilter/nf_conntrack_proto_generic.c
@@ -69,9 +69,7 @@ static struct ctl_table generic_sysctl_table[] = {
69 .mode = 0644, 69 .mode = 0644,
70 .proc_handler = proc_dointvec_jiffies, 70 .proc_handler = proc_dointvec_jiffies,
71 }, 71 },
72 { 72 { }
73 .ctl_name = 0
74 }
75}; 73};
76#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT 74#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
77static struct ctl_table generic_compat_sysctl_table[] = { 75static struct ctl_table generic_compat_sysctl_table[] = {
@@ -82,9 +80,7 @@ static struct ctl_table generic_compat_sysctl_table[] = {
82 .mode = 0644, 80 .mode = 0644,
83 .proc_handler = proc_dointvec_jiffies, 81 .proc_handler = proc_dointvec_jiffies,
84 }, 82 },
85 { 83 { }
86 .ctl_name = 0
87 }
88}; 84};
89#endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */ 85#endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */
90#endif /* CONFIG_SYSCTL */ 86#endif /* CONFIG_SYSCTL */
diff --git a/net/netfilter/nf_conntrack_proto_sctp.c b/net/netfilter/nf_conntrack_proto_sctp.c
index c10e6f36e31e..f9d930f80276 100644
--- a/net/netfilter/nf_conntrack_proto_sctp.c
+++ b/net/netfilter/nf_conntrack_proto_sctp.c
@@ -595,9 +595,7 @@ static struct ctl_table sctp_sysctl_table[] = {
595 .mode = 0644, 595 .mode = 0644,
596 .proc_handler = proc_dointvec_jiffies, 596 .proc_handler = proc_dointvec_jiffies,
597 }, 597 },
598 { 598 { }
599 .ctl_name = 0
600 }
601}; 599};
602 600
603#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT 601#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
@@ -651,9 +649,7 @@ static struct ctl_table sctp_compat_sysctl_table[] = {
651 .mode = 0644, 649 .mode = 0644,
652 .proc_handler = proc_dointvec_jiffies, 650 .proc_handler = proc_dointvec_jiffies,
653 }, 651 },
654 { 652 { }
655 .ctl_name = 0
656 }
657}; 653};
658#endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */ 654#endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */
659#endif 655#endif
diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c
index ba2b76937283..7eda8b8e36a0 100644
--- a/net/netfilter/nf_conntrack_proto_tcp.c
+++ b/net/netfilter/nf_conntrack_proto_tcp.c
@@ -1291,7 +1291,6 @@ static struct ctl_table tcp_sysctl_table[] = {
1291 .proc_handler = proc_dointvec_jiffies, 1291 .proc_handler = proc_dointvec_jiffies,
1292 }, 1292 },
1293 { 1293 {
1294 .ctl_name = NET_NF_CONNTRACK_TCP_LOOSE,
1295 .procname = "nf_conntrack_tcp_loose", 1294 .procname = "nf_conntrack_tcp_loose",
1296 .data = &nf_ct_tcp_loose, 1295 .data = &nf_ct_tcp_loose,
1297 .maxlen = sizeof(unsigned int), 1296 .maxlen = sizeof(unsigned int),
@@ -1299,7 +1298,6 @@ static struct ctl_table tcp_sysctl_table[] = {
1299 .proc_handler = proc_dointvec, 1298 .proc_handler = proc_dointvec,
1300 }, 1299 },
1301 { 1300 {
1302 .ctl_name = NET_NF_CONNTRACK_TCP_BE_LIBERAL,
1303 .procname = "nf_conntrack_tcp_be_liberal", 1301 .procname = "nf_conntrack_tcp_be_liberal",
1304 .data = &nf_ct_tcp_be_liberal, 1302 .data = &nf_ct_tcp_be_liberal,
1305 .maxlen = sizeof(unsigned int), 1303 .maxlen = sizeof(unsigned int),
@@ -1307,16 +1305,13 @@ static struct ctl_table tcp_sysctl_table[] = {
1307 .proc_handler = proc_dointvec, 1305 .proc_handler = proc_dointvec,
1308 }, 1306 },
1309 { 1307 {
1310 .ctl_name = NET_NF_CONNTRACK_TCP_MAX_RETRANS,
1311 .procname = "nf_conntrack_tcp_max_retrans", 1308 .procname = "nf_conntrack_tcp_max_retrans",
1312 .data = &nf_ct_tcp_max_retrans, 1309 .data = &nf_ct_tcp_max_retrans,
1313 .maxlen = sizeof(unsigned int), 1310 .maxlen = sizeof(unsigned int),
1314 .mode = 0644, 1311 .mode = 0644,
1315 .proc_handler = proc_dointvec, 1312 .proc_handler = proc_dointvec,
1316 }, 1313 },
1317 { 1314 { }
1318 .ctl_name = 0
1319 }
1320}; 1315};
1321 1316
1322#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT 1317#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
@@ -1392,7 +1387,6 @@ static struct ctl_table tcp_compat_sysctl_table[] = {
1392 .proc_handler = proc_dointvec_jiffies, 1387 .proc_handler = proc_dointvec_jiffies,
1393 }, 1388 },
1394 { 1389 {
1395 .ctl_name = NET_IPV4_NF_CONNTRACK_TCP_LOOSE,
1396 .procname = "ip_conntrack_tcp_loose", 1390 .procname = "ip_conntrack_tcp_loose",
1397 .data = &nf_ct_tcp_loose, 1391 .data = &nf_ct_tcp_loose,
1398 .maxlen = sizeof(unsigned int), 1392 .maxlen = sizeof(unsigned int),
@@ -1400,7 +1394,6 @@ static struct ctl_table tcp_compat_sysctl_table[] = {
1400 .proc_handler = proc_dointvec, 1394 .proc_handler = proc_dointvec,
1401 }, 1395 },
1402 { 1396 {
1403 .ctl_name = NET_IPV4_NF_CONNTRACK_TCP_BE_LIBERAL,
1404 .procname = "ip_conntrack_tcp_be_liberal", 1397 .procname = "ip_conntrack_tcp_be_liberal",
1405 .data = &nf_ct_tcp_be_liberal, 1398 .data = &nf_ct_tcp_be_liberal,
1406 .maxlen = sizeof(unsigned int), 1399 .maxlen = sizeof(unsigned int),
@@ -1408,16 +1401,13 @@ static struct ctl_table tcp_compat_sysctl_table[] = {
1408 .proc_handler = proc_dointvec, 1401 .proc_handler = proc_dointvec,
1409 }, 1402 },
1410 { 1403 {
1411 .ctl_name = NET_IPV4_NF_CONNTRACK_TCP_MAX_RETRANS,
1412 .procname = "ip_conntrack_tcp_max_retrans", 1404 .procname = "ip_conntrack_tcp_max_retrans",
1413 .data = &nf_ct_tcp_max_retrans, 1405 .data = &nf_ct_tcp_max_retrans,
1414 .maxlen = sizeof(unsigned int), 1406 .maxlen = sizeof(unsigned int),
1415 .mode = 0644, 1407 .mode = 0644,
1416 .proc_handler = proc_dointvec, 1408 .proc_handler = proc_dointvec,
1417 }, 1409 },
1418 { 1410 { }
1419 .ctl_name = 0
1420 }
1421}; 1411};
1422#endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */ 1412#endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */
1423#endif /* CONFIG_SYSCTL */ 1413#endif /* CONFIG_SYSCTL */
diff --git a/net/netfilter/nf_conntrack_proto_udp.c b/net/netfilter/nf_conntrack_proto_udp.c
index 70809d117b91..5c5518bedb4b 100644
--- a/net/netfilter/nf_conntrack_proto_udp.c
+++ b/net/netfilter/nf_conntrack_proto_udp.c
@@ -154,9 +154,7 @@ static struct ctl_table udp_sysctl_table[] = {
154 .mode = 0644, 154 .mode = 0644,
155 .proc_handler = proc_dointvec_jiffies, 155 .proc_handler = proc_dointvec_jiffies,
156 }, 156 },
157 { 157 { }
158 .ctl_name = 0
159 }
160}; 158};
161#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT 159#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
162static struct ctl_table udp_compat_sysctl_table[] = { 160static struct ctl_table udp_compat_sysctl_table[] = {
@@ -174,9 +172,7 @@ static struct ctl_table udp_compat_sysctl_table[] = {
174 .mode = 0644, 172 .mode = 0644,
175 .proc_handler = proc_dointvec_jiffies, 173 .proc_handler = proc_dointvec_jiffies,
176 }, 174 },
177 { 175 { }
178 .ctl_name = 0
179 }
180}; 176};
181#endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */ 177#endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */
182#endif /* CONFIG_SYSCTL */ 178#endif /* CONFIG_SYSCTL */
diff --git a/net/netfilter/nf_conntrack_proto_udplite.c b/net/netfilter/nf_conntrack_proto_udplite.c
index 0badedc542d3..458655bb2106 100644
--- a/net/netfilter/nf_conntrack_proto_udplite.c
+++ b/net/netfilter/nf_conntrack_proto_udplite.c
@@ -146,7 +146,6 @@ static unsigned int udplite_sysctl_table_users;
146static struct ctl_table_header *udplite_sysctl_header; 146static struct ctl_table_header *udplite_sysctl_header;
147static struct ctl_table udplite_sysctl_table[] = { 147static struct ctl_table udplite_sysctl_table[] = {
148 { 148 {
149 .ctl_name = CTL_UNNUMBERED,
150 .procname = "nf_conntrack_udplite_timeout", 149 .procname = "nf_conntrack_udplite_timeout",
151 .data = &nf_ct_udplite_timeout, 150 .data = &nf_ct_udplite_timeout,
152 .maxlen = sizeof(unsigned int), 151 .maxlen = sizeof(unsigned int),
@@ -154,16 +153,13 @@ static struct ctl_table udplite_sysctl_table[] = {
154 .proc_handler = proc_dointvec_jiffies, 153 .proc_handler = proc_dointvec_jiffies,
155 }, 154 },
156 { 155 {
157 .ctl_name = CTL_UNNUMBERED,
158 .procname = "nf_conntrack_udplite_timeout_stream", 156 .procname = "nf_conntrack_udplite_timeout_stream",
159 .data = &nf_ct_udplite_timeout_stream, 157 .data = &nf_ct_udplite_timeout_stream,
160 .maxlen = sizeof(unsigned int), 158 .maxlen = sizeof(unsigned int),
161 .mode = 0644, 159 .mode = 0644,
162 .proc_handler = proc_dointvec_jiffies, 160 .proc_handler = proc_dointvec_jiffies,
163 }, 161 },
164 { 162 { }
165 .ctl_name = 0
166 }
167}; 163};
168#endif /* CONFIG_SYSCTL */ 164#endif /* CONFIG_SYSCTL */
169 165
diff --git a/net/netfilter/nf_conntrack_standalone.c b/net/netfilter/nf_conntrack_standalone.c
index 193515381970..028aba667ef7 100644
--- a/net/netfilter/nf_conntrack_standalone.c
+++ b/net/netfilter/nf_conntrack_standalone.c
@@ -340,7 +340,6 @@ static struct ctl_table_header *nf_ct_netfilter_header;
340 340
341static ctl_table nf_ct_sysctl_table[] = { 341static ctl_table nf_ct_sysctl_table[] = {
342 { 342 {
343 .ctl_name = NET_NF_CONNTRACK_MAX,
344 .procname = "nf_conntrack_max", 343 .procname = "nf_conntrack_max",
345 .data = &nf_conntrack_max, 344 .data = &nf_conntrack_max,
346 .maxlen = sizeof(int), 345 .maxlen = sizeof(int),
@@ -348,7 +347,6 @@ static ctl_table nf_ct_sysctl_table[] = {
348 .proc_handler = proc_dointvec, 347 .proc_handler = proc_dointvec,
349 }, 348 },
350 { 349 {
351 .ctl_name = NET_NF_CONNTRACK_COUNT,
352 .procname = "nf_conntrack_count", 350 .procname = "nf_conntrack_count",
353 .data = &init_net.ct.count, 351 .data = &init_net.ct.count,
354 .maxlen = sizeof(int), 352 .maxlen = sizeof(int),
@@ -356,7 +354,6 @@ static ctl_table nf_ct_sysctl_table[] = {
356 .proc_handler = proc_dointvec, 354 .proc_handler = proc_dointvec,
357 }, 355 },
358 { 356 {
359 .ctl_name = NET_NF_CONNTRACK_BUCKETS,
360 .procname = "nf_conntrack_buckets", 357 .procname = "nf_conntrack_buckets",
361 .data = &nf_conntrack_htable_size, 358 .data = &nf_conntrack_htable_size,
362 .maxlen = sizeof(unsigned int), 359 .maxlen = sizeof(unsigned int),
@@ -364,7 +361,6 @@ static ctl_table nf_ct_sysctl_table[] = {
364 .proc_handler = proc_dointvec, 361 .proc_handler = proc_dointvec,
365 }, 362 },
366 { 363 {
367 .ctl_name = NET_NF_CONNTRACK_CHECKSUM,
368 .procname = "nf_conntrack_checksum", 364 .procname = "nf_conntrack_checksum",
369 .data = &init_net.ct.sysctl_checksum, 365 .data = &init_net.ct.sysctl_checksum,
370 .maxlen = sizeof(unsigned int), 366 .maxlen = sizeof(unsigned int),
@@ -372,43 +368,39 @@ static ctl_table nf_ct_sysctl_table[] = {
372 .proc_handler = proc_dointvec, 368 .proc_handler = proc_dointvec,
373 }, 369 },
374 { 370 {
375 .ctl_name = NET_NF_CONNTRACK_LOG_INVALID,
376 .procname = "nf_conntrack_log_invalid", 371 .procname = "nf_conntrack_log_invalid",
377 .data = &init_net.ct.sysctl_log_invalid, 372 .data = &init_net.ct.sysctl_log_invalid,
378 .maxlen = sizeof(unsigned int), 373 .maxlen = sizeof(unsigned int),
379 .mode = 0644, 374 .mode = 0644,
380 .proc_handler = proc_dointvec_minmax, 375 .proc_handler = proc_dointvec_minmax,
381 .strategy = sysctl_intvec,
382 .extra1 = &log_invalid_proto_min, 376 .extra1 = &log_invalid_proto_min,
383 .extra2 = &log_invalid_proto_max, 377 .extra2 = &log_invalid_proto_max,
384 }, 378 },
385 { 379 {
386 .ctl_name = CTL_UNNUMBERED,
387 .procname = "nf_conntrack_expect_max", 380 .procname = "nf_conntrack_expect_max",
388 .data = &nf_ct_expect_max, 381 .data = &nf_ct_expect_max,
389 .maxlen = sizeof(int), 382 .maxlen = sizeof(int),
390 .mode = 0644, 383 .mode = 0644,
391 .proc_handler = proc_dointvec, 384 .proc_handler = proc_dointvec,
392 }, 385 },
393 { .ctl_name = 0 } 386 { }
394}; 387};
395 388
396#define NET_NF_CONNTRACK_MAX 2089 389#define NET_NF_CONNTRACK_MAX 2089
397 390
398static ctl_table nf_ct_netfilter_table[] = { 391static ctl_table nf_ct_netfilter_table[] = {
399 { 392 {
400 .ctl_name = NET_NF_CONNTRACK_MAX,
401 .procname = "nf_conntrack_max", 393 .procname = "nf_conntrack_max",
402 .data = &nf_conntrack_max, 394 .data = &nf_conntrack_max,
403 .maxlen = sizeof(int), 395 .maxlen = sizeof(int),
404 .mode = 0644, 396 .mode = 0644,
405 .proc_handler = proc_dointvec, 397 .proc_handler = proc_dointvec,
406 }, 398 },
407 { .ctl_name = 0 } 399 { }
408}; 400};
409 401
410static struct ctl_path nf_ct_path[] = { 402static struct ctl_path nf_ct_path[] = {
411 { .procname = "net", .ctl_name = CTL_NET, }, 403 { .procname = "net", },
412 { } 404 { }
413}; 405};
414 406
diff --git a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c
index c93494fef8ef..565e0a31d521 100644
--- a/net/netfilter/nf_log.c
+++ b/net/netfilter/nf_log.c
@@ -216,9 +216,9 @@ static const struct file_operations nflog_file_ops = {
216 216
217#ifdef CONFIG_SYSCTL 217#ifdef CONFIG_SYSCTL
218static struct ctl_path nf_log_sysctl_path[] = { 218static struct ctl_path nf_log_sysctl_path[] = {
219 { .procname = "net", .ctl_name = CTL_NET, }, 219 { .procname = "net", },
220 { .procname = "netfilter", .ctl_name = NET_NETFILTER, }, 220 { .procname = "netfilter", },
221 { .procname = "nf_log", .ctl_name = CTL_UNNUMBERED, }, 221 { .procname = "nf_log", },
222 { } 222 { }
223}; 223};
224 224
@@ -273,7 +273,6 @@ static __init int netfilter_log_sysctl_init(void)
273 273
274 for (i = NFPROTO_UNSPEC; i < NFPROTO_NUMPROTO; i++) { 274 for (i = NFPROTO_UNSPEC; i < NFPROTO_NUMPROTO; i++) {
275 snprintf(nf_log_sysctl_fnames[i-NFPROTO_UNSPEC], 3, "%d", i); 275 snprintf(nf_log_sysctl_fnames[i-NFPROTO_UNSPEC], 3, "%d", i);
276 nf_log_sysctl_table[i].ctl_name = CTL_UNNUMBERED;
277 nf_log_sysctl_table[i].procname = 276 nf_log_sysctl_table[i].procname =
278 nf_log_sysctl_fnames[i-NFPROTO_UNSPEC]; 277 nf_log_sysctl_fnames[i-NFPROTO_UNSPEC];
279 nf_log_sysctl_table[i].data = NULL; 278 nf_log_sysctl_table[i].data = NULL;
diff --git a/net/netrom/sysctl_net_netrom.c b/net/netrom/sysctl_net_netrom.c
index 7b49591fe87c..1e0fa9e57aac 100644
--- a/net/netrom/sysctl_net_netrom.c
+++ b/net/netrom/sysctl_net_netrom.c
@@ -36,143 +36,119 @@ static struct ctl_table_header *nr_table_header;
36 36
37static ctl_table nr_table[] = { 37static ctl_table nr_table[] = {
38 { 38 {
39 .ctl_name = NET_NETROM_DEFAULT_PATH_QUALITY,
40 .procname = "default_path_quality", 39 .procname = "default_path_quality",
41 .data = &sysctl_netrom_default_path_quality, 40 .data = &sysctl_netrom_default_path_quality,
42 .maxlen = sizeof(int), 41 .maxlen = sizeof(int),
43 .mode = 0644, 42 .mode = 0644,
44 .proc_handler = proc_dointvec_minmax, 43 .proc_handler = proc_dointvec_minmax,
45 .strategy = sysctl_intvec,
46 .extra1 = &min_quality, 44 .extra1 = &min_quality,
47 .extra2 = &max_quality 45 .extra2 = &max_quality
48 }, 46 },
49 { 47 {
50 .ctl_name = NET_NETROM_OBSOLESCENCE_COUNT_INITIALISER,
51 .procname = "obsolescence_count_initialiser", 48 .procname = "obsolescence_count_initialiser",
52 .data = &sysctl_netrom_obsolescence_count_initialiser, 49 .data = &sysctl_netrom_obsolescence_count_initialiser,
53 .maxlen = sizeof(int), 50 .maxlen = sizeof(int),
54 .mode = 0644, 51 .mode = 0644,
55 .proc_handler = proc_dointvec_minmax, 52 .proc_handler = proc_dointvec_minmax,
56 .strategy = sysctl_intvec,
57 .extra1 = &min_obs, 53 .extra1 = &min_obs,
58 .extra2 = &max_obs 54 .extra2 = &max_obs
59 }, 55 },
60 { 56 {
61 .ctl_name = NET_NETROM_NETWORK_TTL_INITIALISER,
62 .procname = "network_ttl_initialiser", 57 .procname = "network_ttl_initialiser",
63 .data = &sysctl_netrom_network_ttl_initialiser, 58 .data = &sysctl_netrom_network_ttl_initialiser,
64 .maxlen = sizeof(int), 59 .maxlen = sizeof(int),
65 .mode = 0644, 60 .mode = 0644,
66 .proc_handler = proc_dointvec_minmax, 61 .proc_handler = proc_dointvec_minmax,
67 .strategy = sysctl_intvec,
68 .extra1 = &min_ttl, 62 .extra1 = &min_ttl,
69 .extra2 = &max_ttl 63 .extra2 = &max_ttl
70 }, 64 },
71 { 65 {
72 .ctl_name = NET_NETROM_TRANSPORT_TIMEOUT,
73 .procname = "transport_timeout", 66 .procname = "transport_timeout",
74 .data = &sysctl_netrom_transport_timeout, 67 .data = &sysctl_netrom_transport_timeout,
75 .maxlen = sizeof(int), 68 .maxlen = sizeof(int),
76 .mode = 0644, 69 .mode = 0644,
77 .proc_handler = proc_dointvec_minmax, 70 .proc_handler = proc_dointvec_minmax,
78 .strategy = sysctl_intvec,
79 .extra1 = &min_t1, 71 .extra1 = &min_t1,
80 .extra2 = &max_t1 72 .extra2 = &max_t1
81 }, 73 },
82 { 74 {
83 .ctl_name = NET_NETROM_TRANSPORT_MAXIMUM_TRIES,
84 .procname = "transport_maximum_tries", 75 .procname = "transport_maximum_tries",
85 .data = &sysctl_netrom_transport_maximum_tries, 76 .data = &sysctl_netrom_transport_maximum_tries,
86 .maxlen = sizeof(int), 77 .maxlen = sizeof(int),
87 .mode = 0644, 78 .mode = 0644,
88 .proc_handler = proc_dointvec_minmax, 79 .proc_handler = proc_dointvec_minmax,
89 .strategy = sysctl_intvec,
90 .extra1 = &min_n2, 80 .extra1 = &min_n2,
91 .extra2 = &max_n2 81 .extra2 = &max_n2
92 }, 82 },
93 { 83 {
94 .ctl_name = NET_NETROM_TRANSPORT_ACKNOWLEDGE_DELAY,
95 .procname = "transport_acknowledge_delay", 84 .procname = "transport_acknowledge_delay",
96 .data = &sysctl_netrom_transport_acknowledge_delay, 85 .data = &sysctl_netrom_transport_acknowledge_delay,
97 .maxlen = sizeof(int), 86 .maxlen = sizeof(int),
98 .mode = 0644, 87 .mode = 0644,
99 .proc_handler = proc_dointvec_minmax, 88 .proc_handler = proc_dointvec_minmax,
100 .strategy = sysctl_intvec,
101 .extra1 = &min_t2, 89 .extra1 = &min_t2,
102 .extra2 = &max_t2 90 .extra2 = &max_t2
103 }, 91 },
104 { 92 {
105 .ctl_name = NET_NETROM_TRANSPORT_BUSY_DELAY,
106 .procname = "transport_busy_delay", 93 .procname = "transport_busy_delay",
107 .data = &sysctl_netrom_transport_busy_delay, 94 .data = &sysctl_netrom_transport_busy_delay,
108 .maxlen = sizeof(int), 95 .maxlen = sizeof(int),
109 .mode = 0644, 96 .mode = 0644,
110 .proc_handler = proc_dointvec_minmax, 97 .proc_handler = proc_dointvec_minmax,
111 .strategy = sysctl_intvec,
112 .extra1 = &min_t4, 98 .extra1 = &min_t4,
113 .extra2 = &max_t4 99 .extra2 = &max_t4
114 }, 100 },
115 { 101 {
116 .ctl_name = NET_NETROM_TRANSPORT_REQUESTED_WINDOW_SIZE,
117 .procname = "transport_requested_window_size", 102 .procname = "transport_requested_window_size",
118 .data = &sysctl_netrom_transport_requested_window_size, 103 .data = &sysctl_netrom_transport_requested_window_size,
119 .maxlen = sizeof(int), 104 .maxlen = sizeof(int),
120 .mode = 0644, 105 .mode = 0644,
121 .proc_handler = proc_dointvec_minmax, 106 .proc_handler = proc_dointvec_minmax,
122 .strategy = sysctl_intvec,
123 .extra1 = &min_window, 107 .extra1 = &min_window,
124 .extra2 = &max_window 108 .extra2 = &max_window
125 }, 109 },
126 { 110 {
127 .ctl_name = NET_NETROM_TRANSPORT_NO_ACTIVITY_TIMEOUT,
128 .procname = "transport_no_activity_timeout", 111 .procname = "transport_no_activity_timeout",
129 .data = &sysctl_netrom_transport_no_activity_timeout, 112 .data = &sysctl_netrom_transport_no_activity_timeout,
130 .maxlen = sizeof(int), 113 .maxlen = sizeof(int),
131 .mode = 0644, 114 .mode = 0644,
132 .proc_handler = proc_dointvec_minmax, 115 .proc_handler = proc_dointvec_minmax,
133 .strategy = sysctl_intvec,
134 .extra1 = &min_idle, 116 .extra1 = &min_idle,
135 .extra2 = &max_idle 117 .extra2 = &max_idle
136 }, 118 },
137 { 119 {
138 .ctl_name = NET_NETROM_ROUTING_CONTROL,
139 .procname = "routing_control", 120 .procname = "routing_control",
140 .data = &sysctl_netrom_routing_control, 121 .data = &sysctl_netrom_routing_control,
141 .maxlen = sizeof(int), 122 .maxlen = sizeof(int),
142 .mode = 0644, 123 .mode = 0644,
143 .proc_handler = proc_dointvec_minmax, 124 .proc_handler = proc_dointvec_minmax,
144 .strategy = sysctl_intvec,
145 .extra1 = &min_route, 125 .extra1 = &min_route,
146 .extra2 = &max_route 126 .extra2 = &max_route
147 }, 127 },
148 { 128 {
149 .ctl_name = NET_NETROM_LINK_FAILS_COUNT,
150 .procname = "link_fails_count", 129 .procname = "link_fails_count",
151 .data = &sysctl_netrom_link_fails_count, 130 .data = &sysctl_netrom_link_fails_count,
152 .maxlen = sizeof(int), 131 .maxlen = sizeof(int),
153 .mode = 0644, 132 .mode = 0644,
154 .proc_handler = proc_dointvec_minmax, 133 .proc_handler = proc_dointvec_minmax,
155 .strategy = sysctl_intvec,
156 .extra1 = &min_fails, 134 .extra1 = &min_fails,
157 .extra2 = &max_fails 135 .extra2 = &max_fails
158 }, 136 },
159 { 137 {
160 .ctl_name = NET_NETROM_RESET,
161 .procname = "reset", 138 .procname = "reset",
162 .data = &sysctl_netrom_reset_circuit, 139 .data = &sysctl_netrom_reset_circuit,
163 .maxlen = sizeof(int), 140 .maxlen = sizeof(int),
164 .mode = 0644, 141 .mode = 0644,
165 .proc_handler = proc_dointvec_minmax, 142 .proc_handler = proc_dointvec_minmax,
166 .strategy = sysctl_intvec,
167 .extra1 = &min_reset, 143 .extra1 = &min_reset,
168 .extra2 = &max_reset 144 .extra2 = &max_reset
169 }, 145 },
170 { .ctl_name = 0 } 146 { }
171}; 147};
172 148
173static struct ctl_path nr_path[] = { 149static struct ctl_path nr_path[] = {
174 { .procname = "net", .ctl_name = CTL_NET, }, 150 { .procname = "net", },
175 { .procname = "netrom", .ctl_name = NET_NETROM, }, 151 { .procname = "netrom", },
176 { } 152 { }
177}; 153};
178 154
diff --git a/net/phonet/sysctl.c b/net/phonet/sysctl.c
index 2220f3322326..cea1c7dbdae2 100644
--- a/net/phonet/sysctl.c
+++ b/net/phonet/sysctl.c
@@ -84,20 +84,18 @@ static int proc_local_port_range(ctl_table *table, int write,
84 84
85static struct ctl_table phonet_table[] = { 85static struct ctl_table phonet_table[] = {
86 { 86 {
87 .ctl_name = CTL_UNNUMBERED,
88 .procname = "local_port_range", 87 .procname = "local_port_range",
89 .data = &local_port_range, 88 .data = &local_port_range,
90 .maxlen = sizeof(local_port_range), 89 .maxlen = sizeof(local_port_range),
91 .mode = 0644, 90 .mode = 0644,
92 .proc_handler = proc_local_port_range, 91 .proc_handler = proc_local_port_range,
93 .strategy = NULL,
94 }, 92 },
95 { .ctl_name = 0 } 93 { }
96}; 94};
97 95
98static struct ctl_path phonet_ctl_path[] = { 96static struct ctl_path phonet_ctl_path[] = {
99 { .procname = "net", .ctl_name = CTL_NET, }, 97 { .procname = "net", },
100 { .procname = "phonet", .ctl_name = CTL_UNNUMBERED, }, 98 { .procname = "phonet", },
101 { }, 99 { },
102}; 100};
103 101
diff --git a/net/rds/ib_sysctl.c b/net/rds/ib_sysctl.c
index 84b5ffcb280f..517c6c9987ba 100644
--- a/net/rds/ib_sysctl.c
+++ b/net/rds/ib_sysctl.c
@@ -67,7 +67,6 @@ unsigned int rds_ib_sysctl_flow_control = 0;
67 67
68ctl_table rds_ib_sysctl_table[] = { 68ctl_table rds_ib_sysctl_table[] = {
69 { 69 {
70 .ctl_name = CTL_UNNUMBERED,
71 .procname = "max_send_wr", 70 .procname = "max_send_wr",
72 .data = &rds_ib_sysctl_max_send_wr, 71 .data = &rds_ib_sysctl_max_send_wr,
73 .maxlen = sizeof(unsigned long), 72 .maxlen = sizeof(unsigned long),
@@ -77,7 +76,6 @@ ctl_table rds_ib_sysctl_table[] = {
77 .extra2 = &rds_ib_sysctl_max_wr_max, 76 .extra2 = &rds_ib_sysctl_max_wr_max,
78 }, 77 },
79 { 78 {
80 .ctl_name = CTL_UNNUMBERED,
81 .procname = "max_recv_wr", 79 .procname = "max_recv_wr",
82 .data = &rds_ib_sysctl_max_recv_wr, 80 .data = &rds_ib_sysctl_max_recv_wr,
83 .maxlen = sizeof(unsigned long), 81 .maxlen = sizeof(unsigned long),
@@ -87,7 +85,6 @@ ctl_table rds_ib_sysctl_table[] = {
87 .extra2 = &rds_ib_sysctl_max_wr_max, 85 .extra2 = &rds_ib_sysctl_max_wr_max,
88 }, 86 },
89 { 87 {
90 .ctl_name = CTL_UNNUMBERED,
91 .procname = "max_unsignaled_wr", 88 .procname = "max_unsignaled_wr",
92 .data = &rds_ib_sysctl_max_unsig_wrs, 89 .data = &rds_ib_sysctl_max_unsig_wrs,
93 .maxlen = sizeof(unsigned long), 90 .maxlen = sizeof(unsigned long),
@@ -97,7 +94,6 @@ ctl_table rds_ib_sysctl_table[] = {
97 .extra2 = &rds_ib_sysctl_max_unsig_wr_max, 94 .extra2 = &rds_ib_sysctl_max_unsig_wr_max,
98 }, 95 },
99 { 96 {
100 .ctl_name = CTL_UNNUMBERED,
101 .procname = "max_unsignaled_bytes", 97 .procname = "max_unsignaled_bytes",
102 .data = &rds_ib_sysctl_max_unsig_bytes, 98 .data = &rds_ib_sysctl_max_unsig_bytes,
103 .maxlen = sizeof(unsigned long), 99 .maxlen = sizeof(unsigned long),
@@ -107,7 +103,6 @@ ctl_table rds_ib_sysctl_table[] = {
107 .extra2 = &rds_ib_sysctl_max_unsig_bytes_max, 103 .extra2 = &rds_ib_sysctl_max_unsig_bytes_max,
108 }, 104 },
109 { 105 {
110 .ctl_name = CTL_UNNUMBERED,
111 .procname = "max_recv_allocation", 106 .procname = "max_recv_allocation",
112 .data = &rds_ib_sysctl_max_recv_allocation, 107 .data = &rds_ib_sysctl_max_recv_allocation,
113 .maxlen = sizeof(unsigned long), 108 .maxlen = sizeof(unsigned long),
@@ -115,20 +110,19 @@ ctl_table rds_ib_sysctl_table[] = {
115 .proc_handler = &proc_doulongvec_minmax, 110 .proc_handler = &proc_doulongvec_minmax,
116 }, 111 },
117 { 112 {
118 .ctl_name = CTL_UNNUMBERED,
119 .procname = "flow_control", 113 .procname = "flow_control",
120 .data = &rds_ib_sysctl_flow_control, 114 .data = &rds_ib_sysctl_flow_control,
121 .maxlen = sizeof(rds_ib_sysctl_flow_control), 115 .maxlen = sizeof(rds_ib_sysctl_flow_control),
122 .mode = 0644, 116 .mode = 0644,
123 .proc_handler = &proc_dointvec, 117 .proc_handler = &proc_dointvec,
124 }, 118 },
125 { .ctl_name = 0} 119 { }
126}; 120};
127 121
128static struct ctl_path rds_ib_sysctl_path[] = { 122static struct ctl_path rds_ib_sysctl_path[] = {
129 { .procname = "net", .ctl_name = CTL_NET, }, 123 { .procname = "net", },
130 { .procname = "rds", .ctl_name = CTL_UNNUMBERED, }, 124 { .procname = "rds", },
131 { .procname = "ib", .ctl_name = CTL_UNNUMBERED, }, 125 { .procname = "ib", },
132 { } 126 { }
133}; 127};
134 128
diff --git a/net/rds/iw_sysctl.c b/net/rds/iw_sysctl.c
index 9590678cd616..3e00b01559f2 100644
--- a/net/rds/iw_sysctl.c
+++ b/net/rds/iw_sysctl.c
@@ -57,7 +57,6 @@ unsigned int rds_iw_sysctl_flow_control = 1;
57 57
58ctl_table rds_iw_sysctl_table[] = { 58ctl_table rds_iw_sysctl_table[] = {
59 { 59 {
60 .ctl_name = CTL_UNNUMBERED,
61 .procname = "max_send_wr", 60 .procname = "max_send_wr",
62 .data = &rds_iw_sysctl_max_send_wr, 61 .data = &rds_iw_sysctl_max_send_wr,
63 .maxlen = sizeof(unsigned long), 62 .maxlen = sizeof(unsigned long),
@@ -67,7 +66,6 @@ ctl_table rds_iw_sysctl_table[] = {
67 .extra2 = &rds_iw_sysctl_max_wr_max, 66 .extra2 = &rds_iw_sysctl_max_wr_max,
68 }, 67 },
69 { 68 {
70 .ctl_name = CTL_UNNUMBERED,
71 .procname = "max_recv_wr", 69 .procname = "max_recv_wr",
72 .data = &rds_iw_sysctl_max_recv_wr, 70 .data = &rds_iw_sysctl_max_recv_wr,
73 .maxlen = sizeof(unsigned long), 71 .maxlen = sizeof(unsigned long),
@@ -77,7 +75,6 @@ ctl_table rds_iw_sysctl_table[] = {
77 .extra2 = &rds_iw_sysctl_max_wr_max, 75 .extra2 = &rds_iw_sysctl_max_wr_max,
78 }, 76 },
79 { 77 {
80 .ctl_name = CTL_UNNUMBERED,
81 .procname = "max_unsignaled_wr", 78 .procname = "max_unsignaled_wr",
82 .data = &rds_iw_sysctl_max_unsig_wrs, 79 .data = &rds_iw_sysctl_max_unsig_wrs,
83 .maxlen = sizeof(unsigned long), 80 .maxlen = sizeof(unsigned long),
@@ -87,7 +84,6 @@ ctl_table rds_iw_sysctl_table[] = {
87 .extra2 = &rds_iw_sysctl_max_unsig_wr_max, 84 .extra2 = &rds_iw_sysctl_max_unsig_wr_max,
88 }, 85 },
89 { 86 {
90 .ctl_name = CTL_UNNUMBERED,
91 .procname = "max_unsignaled_bytes", 87 .procname = "max_unsignaled_bytes",
92 .data = &rds_iw_sysctl_max_unsig_bytes, 88 .data = &rds_iw_sysctl_max_unsig_bytes,
93 .maxlen = sizeof(unsigned long), 89 .maxlen = sizeof(unsigned long),
@@ -97,7 +93,6 @@ ctl_table rds_iw_sysctl_table[] = {
97 .extra2 = &rds_iw_sysctl_max_unsig_bytes_max, 93 .extra2 = &rds_iw_sysctl_max_unsig_bytes_max,
98 }, 94 },
99 { 95 {
100 .ctl_name = CTL_UNNUMBERED,
101 .procname = "max_recv_allocation", 96 .procname = "max_recv_allocation",
102 .data = &rds_iw_sysctl_max_recv_allocation, 97 .data = &rds_iw_sysctl_max_recv_allocation,
103 .maxlen = sizeof(unsigned long), 98 .maxlen = sizeof(unsigned long),
@@ -105,20 +100,19 @@ ctl_table rds_iw_sysctl_table[] = {
105 .proc_handler = &proc_doulongvec_minmax, 100 .proc_handler = &proc_doulongvec_minmax,
106 }, 101 },
107 { 102 {
108 .ctl_name = CTL_UNNUMBERED,
109 .procname = "flow_control", 103 .procname = "flow_control",
110 .data = &rds_iw_sysctl_flow_control, 104 .data = &rds_iw_sysctl_flow_control,
111 .maxlen = sizeof(rds_iw_sysctl_flow_control), 105 .maxlen = sizeof(rds_iw_sysctl_flow_control),
112 .mode = 0644, 106 .mode = 0644,
113 .proc_handler = &proc_dointvec, 107 .proc_handler = &proc_dointvec,
114 }, 108 },
115 { .ctl_name = 0} 109 { }
116}; 110};
117 111
118static struct ctl_path rds_iw_sysctl_path[] = { 112static struct ctl_path rds_iw_sysctl_path[] = {
119 { .procname = "net", .ctl_name = CTL_NET, }, 113 { .procname = "net", },
120 { .procname = "rds", .ctl_name = CTL_UNNUMBERED, }, 114 { .procname = "rds", },
121 { .procname = "iw", .ctl_name = CTL_UNNUMBERED, }, 115 { .procname = "iw", },
122 { } 116 { }
123}; 117};
124 118
diff --git a/net/rds/sysctl.c b/net/rds/sysctl.c
index 307dc5c1be15..8fb499ee3687 100644
--- a/net/rds/sysctl.c
+++ b/net/rds/sysctl.c
@@ -51,7 +51,6 @@ unsigned int rds_sysctl_ping_enable = 1;
51 51
52static ctl_table rds_sysctl_rds_table[] = { 52static ctl_table rds_sysctl_rds_table[] = {
53 { 53 {
54 .ctl_name = CTL_UNNUMBERED,
55 .procname = "reconnect_min_delay_ms", 54 .procname = "reconnect_min_delay_ms",
56 .data = &rds_sysctl_reconnect_min_jiffies, 55 .data = &rds_sysctl_reconnect_min_jiffies,
57 .maxlen = sizeof(unsigned long), 56 .maxlen = sizeof(unsigned long),
@@ -61,7 +60,6 @@ static ctl_table rds_sysctl_rds_table[] = {
61 .extra2 = &rds_sysctl_reconnect_max_jiffies, 60 .extra2 = &rds_sysctl_reconnect_max_jiffies,
62 }, 61 },
63 { 62 {
64 .ctl_name = CTL_UNNUMBERED,
65 .procname = "reconnect_max_delay_ms", 63 .procname = "reconnect_max_delay_ms",
66 .data = &rds_sysctl_reconnect_max_jiffies, 64 .data = &rds_sysctl_reconnect_max_jiffies,
67 .maxlen = sizeof(unsigned long), 65 .maxlen = sizeof(unsigned long),
@@ -71,7 +69,6 @@ static ctl_table rds_sysctl_rds_table[] = {
71 .extra2 = &rds_sysctl_reconnect_max, 69 .extra2 = &rds_sysctl_reconnect_max,
72 }, 70 },
73 { 71 {
74 .ctl_name = CTL_UNNUMBERED,
75 .procname = "max_unacked_packets", 72 .procname = "max_unacked_packets",
76 .data = &rds_sysctl_max_unacked_packets, 73 .data = &rds_sysctl_max_unacked_packets,
77 .maxlen = sizeof(unsigned long), 74 .maxlen = sizeof(unsigned long),
@@ -79,7 +76,6 @@ static ctl_table rds_sysctl_rds_table[] = {
79 .proc_handler = &proc_dointvec, 76 .proc_handler = &proc_dointvec,
80 }, 77 },
81 { 78 {
82 .ctl_name = CTL_UNNUMBERED,
83 .procname = "max_unacked_bytes", 79 .procname = "max_unacked_bytes",
84 .data = &rds_sysctl_max_unacked_bytes, 80 .data = &rds_sysctl_max_unacked_bytes,
85 .maxlen = sizeof(unsigned long), 81 .maxlen = sizeof(unsigned long),
@@ -87,19 +83,18 @@ static ctl_table rds_sysctl_rds_table[] = {
87 .proc_handler = &proc_dointvec, 83 .proc_handler = &proc_dointvec,
88 }, 84 },
89 { 85 {
90 .ctl_name = CTL_UNNUMBERED,
91 .procname = "ping_enable", 86 .procname = "ping_enable",
92 .data = &rds_sysctl_ping_enable, 87 .data = &rds_sysctl_ping_enable,
93 .maxlen = sizeof(int), 88 .maxlen = sizeof(int),
94 .mode = 0644, 89 .mode = 0644,
95 .proc_handler = &proc_dointvec, 90 .proc_handler = &proc_dointvec,
96 }, 91 },
97 { .ctl_name = 0} 92 { }
98}; 93};
99 94
100static struct ctl_path rds_sysctl_path[] = { 95static struct ctl_path rds_sysctl_path[] = {
101 { .procname = "net", .ctl_name = CTL_NET, }, 96 { .procname = "net", },
102 { .procname = "rds", .ctl_name = CTL_UNNUMBERED, }, 97 { .procname = "rds", },
103 { } 98 { }
104}; 99};
105 100
diff --git a/net/rose/sysctl_net_rose.c b/net/rose/sysctl_net_rose.c
index 3bfe504faf86..df6d9dac2186 100644
--- a/net/rose/sysctl_net_rose.c
+++ b/net/rose/sysctl_net_rose.c
@@ -26,121 +26,101 @@ static struct ctl_table_header *rose_table_header;
26 26
27static ctl_table rose_table[] = { 27static ctl_table rose_table[] = {
28 { 28 {
29 .ctl_name = NET_ROSE_RESTART_REQUEST_TIMEOUT,
30 .procname = "restart_request_timeout", 29 .procname = "restart_request_timeout",
31 .data = &sysctl_rose_restart_request_timeout, 30 .data = &sysctl_rose_restart_request_timeout,
32 .maxlen = sizeof(int), 31 .maxlen = sizeof(int),
33 .mode = 0644, 32 .mode = 0644,
34 .proc_handler = proc_dointvec_minmax, 33 .proc_handler = proc_dointvec_minmax,
35 .strategy = sysctl_intvec,
36 .extra1 = &min_timer, 34 .extra1 = &min_timer,
37 .extra2 = &max_timer 35 .extra2 = &max_timer
38 }, 36 },
39 { 37 {
40 .ctl_name = NET_ROSE_CALL_REQUEST_TIMEOUT,
41 .procname = "call_request_timeout", 38 .procname = "call_request_timeout",
42 .data = &sysctl_rose_call_request_timeout, 39 .data = &sysctl_rose_call_request_timeout,
43 .maxlen = sizeof(int), 40 .maxlen = sizeof(int),
44 .mode = 0644, 41 .mode = 0644,
45 .proc_handler = proc_dointvec_minmax, 42 .proc_handler = proc_dointvec_minmax,
46 .strategy = sysctl_intvec,
47 .extra1 = &min_timer, 43 .extra1 = &min_timer,
48 .extra2 = &max_timer 44 .extra2 = &max_timer
49 }, 45 },
50 { 46 {
51 .ctl_name = NET_ROSE_RESET_REQUEST_TIMEOUT,
52 .procname = "reset_request_timeout", 47 .procname = "reset_request_timeout",
53 .data = &sysctl_rose_reset_request_timeout, 48 .data = &sysctl_rose_reset_request_timeout,
54 .maxlen = sizeof(int), 49 .maxlen = sizeof(int),
55 .mode = 0644, 50 .mode = 0644,
56 .proc_handler = proc_dointvec_minmax, 51 .proc_handler = proc_dointvec_minmax,
57 .strategy = sysctl_intvec,
58 .extra1 = &min_timer, 52 .extra1 = &min_timer,
59 .extra2 = &max_timer 53 .extra2 = &max_timer
60 }, 54 },
61 { 55 {
62 .ctl_name = NET_ROSE_CLEAR_REQUEST_TIMEOUT,
63 .procname = "clear_request_timeout", 56 .procname = "clear_request_timeout",
64 .data = &sysctl_rose_clear_request_timeout, 57 .data = &sysctl_rose_clear_request_timeout,
65 .maxlen = sizeof(int), 58 .maxlen = sizeof(int),
66 .mode = 0644, 59 .mode = 0644,
67 .proc_handler = proc_dointvec_minmax, 60 .proc_handler = proc_dointvec_minmax,
68 .strategy = sysctl_intvec,
69 .extra1 = &min_timer, 61 .extra1 = &min_timer,
70 .extra2 = &max_timer 62 .extra2 = &max_timer
71 }, 63 },
72 { 64 {
73 .ctl_name = NET_ROSE_NO_ACTIVITY_TIMEOUT,
74 .procname = "no_activity_timeout", 65 .procname = "no_activity_timeout",
75 .data = &sysctl_rose_no_activity_timeout, 66 .data = &sysctl_rose_no_activity_timeout,
76 .maxlen = sizeof(int), 67 .maxlen = sizeof(int),
77 .mode = 0644, 68 .mode = 0644,
78 .proc_handler = proc_dointvec_minmax, 69 .proc_handler = proc_dointvec_minmax,
79 .strategy = sysctl_intvec,
80 .extra1 = &min_idle, 70 .extra1 = &min_idle,
81 .extra2 = &max_idle 71 .extra2 = &max_idle
82 }, 72 },
83 { 73 {
84 .ctl_name = NET_ROSE_ACK_HOLD_BACK_TIMEOUT,
85 .procname = "acknowledge_hold_back_timeout", 74 .procname = "acknowledge_hold_back_timeout",
86 .data = &sysctl_rose_ack_hold_back_timeout, 75 .data = &sysctl_rose_ack_hold_back_timeout,
87 .maxlen = sizeof(int), 76 .maxlen = sizeof(int),
88 .mode = 0644, 77 .mode = 0644,
89 .proc_handler = proc_dointvec_minmax, 78 .proc_handler = proc_dointvec_minmax,
90 .strategy = sysctl_intvec,
91 .extra1 = &min_timer, 79 .extra1 = &min_timer,
92 .extra2 = &max_timer 80 .extra2 = &max_timer
93 }, 81 },
94 { 82 {
95 .ctl_name = NET_ROSE_ROUTING_CONTROL,
96 .procname = "routing_control", 83 .procname = "routing_control",
97 .data = &sysctl_rose_routing_control, 84 .data = &sysctl_rose_routing_control,
98 .maxlen = sizeof(int), 85 .maxlen = sizeof(int),
99 .mode = 0644, 86 .mode = 0644,
100 .proc_handler = proc_dointvec_minmax, 87 .proc_handler = proc_dointvec_minmax,
101 .strategy = sysctl_intvec,
102 .extra1 = &min_route, 88 .extra1 = &min_route,
103 .extra2 = &max_route 89 .extra2 = &max_route
104 }, 90 },
105 { 91 {
106 .ctl_name = NET_ROSE_LINK_FAIL_TIMEOUT,
107 .procname = "link_fail_timeout", 92 .procname = "link_fail_timeout",
108 .data = &sysctl_rose_link_fail_timeout, 93 .data = &sysctl_rose_link_fail_timeout,
109 .maxlen = sizeof(int), 94 .maxlen = sizeof(int),
110 .mode = 0644, 95 .mode = 0644,
111 .proc_handler = proc_dointvec_minmax, 96 .proc_handler = proc_dointvec_minmax,
112 .strategy = sysctl_intvec,
113 .extra1 = &min_ftimer, 97 .extra1 = &min_ftimer,
114 .extra2 = &max_ftimer 98 .extra2 = &max_ftimer
115 }, 99 },
116 { 100 {
117 .ctl_name = NET_ROSE_MAX_VCS,
118 .procname = "maximum_virtual_circuits", 101 .procname = "maximum_virtual_circuits",
119 .data = &sysctl_rose_maximum_vcs, 102 .data = &sysctl_rose_maximum_vcs,
120 .maxlen = sizeof(int), 103 .maxlen = sizeof(int),
121 .mode = 0644, 104 .mode = 0644,
122 .proc_handler = proc_dointvec_minmax, 105 .proc_handler = proc_dointvec_minmax,
123 .strategy = sysctl_intvec,
124 .extra1 = &min_maxvcs, 106 .extra1 = &min_maxvcs,
125 .extra2 = &max_maxvcs 107 .extra2 = &max_maxvcs
126 }, 108 },
127 { 109 {
128 .ctl_name = NET_ROSE_WINDOW_SIZE,
129 .procname = "window_size", 110 .procname = "window_size",
130 .data = &sysctl_rose_window_size, 111 .data = &sysctl_rose_window_size,
131 .maxlen = sizeof(int), 112 .maxlen = sizeof(int),
132 .mode = 0644, 113 .mode = 0644,
133 .proc_handler = proc_dointvec_minmax, 114 .proc_handler = proc_dointvec_minmax,
134 .strategy = sysctl_intvec,
135 .extra1 = &min_window, 115 .extra1 = &min_window,
136 .extra2 = &max_window 116 .extra2 = &max_window
137 }, 117 },
138 { .ctl_name = 0 } 118 { }
139}; 119};
140 120
141static struct ctl_path rose_path[] = { 121static struct ctl_path rose_path[] = {
142 { .procname = "net", .ctl_name = CTL_NET, }, 122 { .procname = "net", },
143 { .procname = "rose", .ctl_name = NET_ROSE, }, 123 { .procname = "rose", },
144 { } 124 { }
145}; 125};
146 126
diff --git a/net/sctp/sysctl.c b/net/sctp/sysctl.c
index ab7151da120f..c4ece9829541 100644
--- a/net/sctp/sysctl.c
+++ b/net/sctp/sysctl.c
@@ -59,180 +59,145 @@ extern int sysctl_sctp_wmem[3];
59 59
60static ctl_table sctp_table[] = { 60static ctl_table sctp_table[] = {
61 { 61 {
62 .ctl_name = NET_SCTP_RTO_INITIAL,
63 .procname = "rto_initial", 62 .procname = "rto_initial",
64 .data = &sctp_rto_initial, 63 .data = &sctp_rto_initial,
65 .maxlen = sizeof(unsigned int), 64 .maxlen = sizeof(unsigned int),
66 .mode = 0644, 65 .mode = 0644,
67 .proc_handler = proc_dointvec_minmax, 66 .proc_handler = proc_dointvec_minmax,
68 .strategy = sysctl_intvec,
69 .extra1 = &one, 67 .extra1 = &one,
70 .extra2 = &timer_max 68 .extra2 = &timer_max
71 }, 69 },
72 { 70 {
73 .ctl_name = NET_SCTP_RTO_MIN,
74 .procname = "rto_min", 71 .procname = "rto_min",
75 .data = &sctp_rto_min, 72 .data = &sctp_rto_min,
76 .maxlen = sizeof(unsigned int), 73 .maxlen = sizeof(unsigned int),
77 .mode = 0644, 74 .mode = 0644,
78 .proc_handler = proc_dointvec_minmax, 75 .proc_handler = proc_dointvec_minmax,
79 .strategy = sysctl_intvec,
80 .extra1 = &one, 76 .extra1 = &one,
81 .extra2 = &timer_max 77 .extra2 = &timer_max
82 }, 78 },
83 { 79 {
84 .ctl_name = NET_SCTP_RTO_MAX,
85 .procname = "rto_max", 80 .procname = "rto_max",
86 .data = &sctp_rto_max, 81 .data = &sctp_rto_max,
87 .maxlen = sizeof(unsigned int), 82 .maxlen = sizeof(unsigned int),
88 .mode = 0644, 83 .mode = 0644,
89 .proc_handler = proc_dointvec_minmax, 84 .proc_handler = proc_dointvec_minmax,
90 .strategy = sysctl_intvec,
91 .extra1 = &one, 85 .extra1 = &one,
92 .extra2 = &timer_max 86 .extra2 = &timer_max
93 }, 87 },
94 { 88 {
95 .ctl_name = NET_SCTP_VALID_COOKIE_LIFE,
96 .procname = "valid_cookie_life", 89 .procname = "valid_cookie_life",
97 .data = &sctp_valid_cookie_life, 90 .data = &sctp_valid_cookie_life,
98 .maxlen = sizeof(unsigned int), 91 .maxlen = sizeof(unsigned int),
99 .mode = 0644, 92 .mode = 0644,
100 .proc_handler = proc_dointvec_minmax, 93 .proc_handler = proc_dointvec_minmax,
101 .strategy = sysctl_intvec,
102 .extra1 = &one, 94 .extra1 = &one,
103 .extra2 = &timer_max 95 .extra2 = &timer_max
104 }, 96 },
105 { 97 {
106 .ctl_name = NET_SCTP_MAX_BURST,
107 .procname = "max_burst", 98 .procname = "max_burst",
108 .data = &sctp_max_burst, 99 .data = &sctp_max_burst,
109 .maxlen = sizeof(int), 100 .maxlen = sizeof(int),
110 .mode = 0644, 101 .mode = 0644,
111 .proc_handler = proc_dointvec_minmax, 102 .proc_handler = proc_dointvec_minmax,
112 .strategy = sysctl_intvec,
113 .extra1 = &zero, 103 .extra1 = &zero,
114 .extra2 = &int_max 104 .extra2 = &int_max
115 }, 105 },
116 { 106 {
117 .ctl_name = NET_SCTP_ASSOCIATION_MAX_RETRANS,
118 .procname = "association_max_retrans", 107 .procname = "association_max_retrans",
119 .data = &sctp_max_retrans_association, 108 .data = &sctp_max_retrans_association,
120 .maxlen = sizeof(int), 109 .maxlen = sizeof(int),
121 .mode = 0644, 110 .mode = 0644,
122 .proc_handler = proc_dointvec_minmax, 111 .proc_handler = proc_dointvec_minmax,
123 .strategy = sysctl_intvec,
124 .extra1 = &one, 112 .extra1 = &one,
125 .extra2 = &int_max 113 .extra2 = &int_max
126 }, 114 },
127 { 115 {
128 .ctl_name = NET_SCTP_SNDBUF_POLICY,
129 .procname = "sndbuf_policy", 116 .procname = "sndbuf_policy",
130 .data = &sctp_sndbuf_policy, 117 .data = &sctp_sndbuf_policy,
131 .maxlen = sizeof(int), 118 .maxlen = sizeof(int),
132 .mode = 0644, 119 .mode = 0644,
133 .proc_handler = proc_dointvec, 120 .proc_handler = proc_dointvec,
134 .strategy = sysctl_intvec
135 }, 121 },
136 { 122 {
137 .ctl_name = NET_SCTP_RCVBUF_POLICY,
138 .procname = "rcvbuf_policy", 123 .procname = "rcvbuf_policy",
139 .data = &sctp_rcvbuf_policy, 124 .data = &sctp_rcvbuf_policy,
140 .maxlen = sizeof(int), 125 .maxlen = sizeof(int),
141 .mode = 0644, 126 .mode = 0644,
142 .proc_handler = proc_dointvec, 127 .proc_handler = proc_dointvec,
143 .strategy = sysctl_intvec
144 }, 128 },
145 { 129 {
146 .ctl_name = NET_SCTP_PATH_MAX_RETRANS,
147 .procname = "path_max_retrans", 130 .procname = "path_max_retrans",
148 .data = &sctp_max_retrans_path, 131 .data = &sctp_max_retrans_path,
149 .maxlen = sizeof(int), 132 .maxlen = sizeof(int),
150 .mode = 0644, 133 .mode = 0644,
151 .proc_handler = proc_dointvec_minmax, 134 .proc_handler = proc_dointvec_minmax,
152 .strategy = sysctl_intvec,
153 .extra1 = &one, 135 .extra1 = &one,
154 .extra2 = &int_max 136 .extra2 = &int_max
155 }, 137 },
156 { 138 {
157 .ctl_name = NET_SCTP_MAX_INIT_RETRANSMITS,
158 .procname = "max_init_retransmits", 139 .procname = "max_init_retransmits",
159 .data = &sctp_max_retrans_init, 140 .data = &sctp_max_retrans_init,
160 .maxlen = sizeof(int), 141 .maxlen = sizeof(int),
161 .mode = 0644, 142 .mode = 0644,
162 .proc_handler = proc_dointvec_minmax, 143 .proc_handler = proc_dointvec_minmax,
163 .strategy = sysctl_intvec,
164 .extra1 = &one, 144 .extra1 = &one,
165 .extra2 = &int_max 145 .extra2 = &int_max
166 }, 146 },
167 { 147 {
168 .ctl_name = NET_SCTP_HB_INTERVAL,
169 .procname = "hb_interval", 148 .procname = "hb_interval",
170 .data = &sctp_hb_interval, 149 .data = &sctp_hb_interval,
171 .maxlen = sizeof(unsigned int), 150 .maxlen = sizeof(unsigned int),
172 .mode = 0644, 151 .mode = 0644,
173 .proc_handler = proc_dointvec_minmax, 152 .proc_handler = proc_dointvec_minmax,
174 .strategy = sysctl_intvec,
175 .extra1 = &one, 153 .extra1 = &one,
176 .extra2 = &timer_max 154 .extra2 = &timer_max
177 }, 155 },
178 { 156 {
179 .ctl_name = NET_SCTP_PRESERVE_ENABLE,
180 .procname = "cookie_preserve_enable", 157 .procname = "cookie_preserve_enable",
181 .data = &sctp_cookie_preserve_enable, 158 .data = &sctp_cookie_preserve_enable,
182 .maxlen = sizeof(int), 159 .maxlen = sizeof(int),
183 .mode = 0644, 160 .mode = 0644,
184 .proc_handler = proc_dointvec, 161 .proc_handler = proc_dointvec,
185 .strategy = sysctl_intvec
186 }, 162 },
187 { 163 {
188 .ctl_name = NET_SCTP_RTO_ALPHA,
189 .procname = "rto_alpha_exp_divisor", 164 .procname = "rto_alpha_exp_divisor",
190 .data = &sctp_rto_alpha, 165 .data = &sctp_rto_alpha,
191 .maxlen = sizeof(int), 166 .maxlen = sizeof(int),
192 .mode = 0444, 167 .mode = 0444,
193 .proc_handler = proc_dointvec, 168 .proc_handler = proc_dointvec,
194 .strategy = sysctl_intvec
195 }, 169 },
196 { 170 {
197 .ctl_name = NET_SCTP_RTO_BETA,
198 .procname = "rto_beta_exp_divisor", 171 .procname = "rto_beta_exp_divisor",
199 .data = &sctp_rto_beta, 172 .data = &sctp_rto_beta,
200 .maxlen = sizeof(int), 173 .maxlen = sizeof(int),
201 .mode = 0444, 174 .mode = 0444,
202 .proc_handler = proc_dointvec, 175 .proc_handler = proc_dointvec,
203 .strategy = sysctl_intvec
204 }, 176 },
205 { 177 {
206 .ctl_name = NET_SCTP_ADDIP_ENABLE,
207 .procname = "addip_enable", 178 .procname = "addip_enable",
208 .data = &sctp_addip_enable, 179 .data = &sctp_addip_enable,
209 .maxlen = sizeof(int), 180 .maxlen = sizeof(int),
210 .mode = 0644, 181 .mode = 0644,
211 .proc_handler = proc_dointvec, 182 .proc_handler = proc_dointvec,
212 .strategy = sysctl_intvec
213 }, 183 },
214 { 184 {
215 .ctl_name = NET_SCTP_PRSCTP_ENABLE,
216 .procname = "prsctp_enable", 185 .procname = "prsctp_enable",
217 .data = &sctp_prsctp_enable, 186 .data = &sctp_prsctp_enable,
218 .maxlen = sizeof(int), 187 .maxlen = sizeof(int),
219 .mode = 0644, 188 .mode = 0644,
220 .proc_handler = proc_dointvec, 189 .proc_handler = proc_dointvec,
221 .strategy = sysctl_intvec
222 }, 190 },
223 { 191 {
224 .ctl_name = NET_SCTP_SACK_TIMEOUT,
225 .procname = "sack_timeout", 192 .procname = "sack_timeout",
226 .data = &sctp_sack_timeout, 193 .data = &sctp_sack_timeout,
227 .maxlen = sizeof(int), 194 .maxlen = sizeof(int),
228 .mode = 0644, 195 .mode = 0644,
229 .proc_handler = proc_dointvec_minmax, 196 .proc_handler = proc_dointvec_minmax,
230 .strategy = sysctl_intvec,
231 .extra1 = &sack_timer_min, 197 .extra1 = &sack_timer_min,
232 .extra2 = &sack_timer_max, 198 .extra2 = &sack_timer_max,
233 }, 199 },
234 { 200 {
235 .ctl_name = CTL_UNNUMBERED,
236 .procname = "sctp_mem", 201 .procname = "sctp_mem",
237 .data = &sysctl_sctp_mem, 202 .data = &sysctl_sctp_mem,
238 .maxlen = sizeof(sysctl_sctp_mem), 203 .maxlen = sizeof(sysctl_sctp_mem),
@@ -240,7 +205,6 @@ static ctl_table sctp_table[] = {
240 .proc_handler = proc_dointvec, 205 .proc_handler = proc_dointvec,
241 }, 206 },
242 { 207 {
243 .ctl_name = CTL_UNNUMBERED,
244 .procname = "sctp_rmem", 208 .procname = "sctp_rmem",
245 .data = &sysctl_sctp_rmem, 209 .data = &sysctl_sctp_rmem,
246 .maxlen = sizeof(sysctl_sctp_rmem), 210 .maxlen = sizeof(sysctl_sctp_rmem),
@@ -248,7 +212,6 @@ static ctl_table sctp_table[] = {
248 .proc_handler = proc_dointvec, 212 .proc_handler = proc_dointvec,
249 }, 213 },
250 { 214 {
251 .ctl_name = CTL_UNNUMBERED,
252 .procname = "sctp_wmem", 215 .procname = "sctp_wmem",
253 .data = &sysctl_sctp_wmem, 216 .data = &sysctl_sctp_wmem,
254 .maxlen = sizeof(sysctl_sctp_wmem), 217 .maxlen = sizeof(sysctl_sctp_wmem),
@@ -256,40 +219,34 @@ static ctl_table sctp_table[] = {
256 .proc_handler = proc_dointvec, 219 .proc_handler = proc_dointvec,
257 }, 220 },
258 { 221 {
259 .ctl_name = CTL_UNNUMBERED,
260 .procname = "auth_enable", 222 .procname = "auth_enable",
261 .data = &sctp_auth_enable, 223 .data = &sctp_auth_enable,
262 .maxlen = sizeof(int), 224 .maxlen = sizeof(int),
263 .mode = 0644, 225 .mode = 0644,
264 .proc_handler = proc_dointvec, 226 .proc_handler = proc_dointvec,
265 .strategy = sysctl_intvec
266 }, 227 },
267 { 228 {
268 .ctl_name = CTL_UNNUMBERED,
269 .procname = "addip_noauth_enable", 229 .procname = "addip_noauth_enable",
270 .data = &sctp_addip_noauth, 230 .data = &sctp_addip_noauth,
271 .maxlen = sizeof(int), 231 .maxlen = sizeof(int),
272 .mode = 0644, 232 .mode = 0644,
273 .proc_handler = proc_dointvec, 233 .proc_handler = proc_dointvec,
274 .strategy = sysctl_intvec
275 }, 234 },
276 { 235 {
277 .ctl_name = CTL_UNNUMBERED,
278 .procname = "addr_scope_policy", 236 .procname = "addr_scope_policy",
279 .data = &sctp_scope_policy, 237 .data = &sctp_scope_policy,
280 .maxlen = sizeof(int), 238 .maxlen = sizeof(int),
281 .mode = 0644, 239 .mode = 0644,
282 .proc_handler = &proc_dointvec_minmax, 240 .proc_handler = &proc_dointvec_minmax,
283 .strategy = &sysctl_intvec,
284 .extra1 = &zero, 241 .extra1 = &zero,
285 .extra2 = &addr_scope_max, 242 .extra2 = &addr_scope_max,
286 }, 243 },
287 { .ctl_name = 0 } 244 { }
288}; 245};
289 246
290static struct ctl_path sctp_path[] = { 247static struct ctl_path sctp_path[] = {
291 { .procname = "net", .ctl_name = CTL_NET, }, 248 { .procname = "net", },
292 { .procname = "sctp", .ctl_name = NET_SCTP, }, 249 { .procname = "sctp", },
293 { } 250 { }
294}; 251};
295 252
diff --git a/net/sunrpc/sysctl.c b/net/sunrpc/sysctl.c
index 42f9748ae093..f0ce326d0178 100644
--- a/net/sunrpc/sysctl.c
+++ b/net/sunrpc/sysctl.c
@@ -168,17 +168,16 @@ static ctl_table debug_table[] = {
168 .mode = 0444, 168 .mode = 0444,
169 .proc_handler = &proc_do_xprt, 169 .proc_handler = &proc_do_xprt,
170 }, 170 },
171 { .ctl_name = 0 } 171 { }
172}; 172};
173 173
174static ctl_table sunrpc_table[] = { 174static ctl_table sunrpc_table[] = {
175 { 175 {
176 .ctl_name = CTL_SUNRPC,
177 .procname = "sunrpc", 176 .procname = "sunrpc",
178 .mode = 0555, 177 .mode = 0555,
179 .child = debug_table 178 .child = debug_table
180 }, 179 },
181 { .ctl_name = 0 } 180 { }
182}; 181};
183 182
184#endif 183#endif
diff --git a/net/sunrpc/xprtrdma/svc_rdma.c b/net/sunrpc/xprtrdma/svc_rdma.c
index 35fb68b9c8ec..678cee22013f 100644
--- a/net/sunrpc/xprtrdma/svc_rdma.c
+++ b/net/sunrpc/xprtrdma/svc_rdma.c
@@ -121,7 +121,6 @@ static ctl_table svcrdma_parm_table[] = {
121 .maxlen = sizeof(unsigned int), 121 .maxlen = sizeof(unsigned int),
122 .mode = 0644, 122 .mode = 0644,
123 .proc_handler = &proc_dointvec_minmax, 123 .proc_handler = &proc_dointvec_minmax,
124 .strategy = &sysctl_intvec,
125 .extra1 = &min_max_requests, 124 .extra1 = &min_max_requests,
126 .extra2 = &max_max_requests 125 .extra2 = &max_max_requests
127 }, 126 },
@@ -131,7 +130,6 @@ static ctl_table svcrdma_parm_table[] = {
131 .maxlen = sizeof(unsigned int), 130 .maxlen = sizeof(unsigned int),
132 .mode = 0644, 131 .mode = 0644,
133 .proc_handler = &proc_dointvec_minmax, 132 .proc_handler = &proc_dointvec_minmax,
134 .strategy = &sysctl_intvec,
135 .extra1 = &min_max_inline, 133 .extra1 = &min_max_inline,
136 .extra2 = &max_max_inline 134 .extra2 = &max_max_inline
137 }, 135 },
@@ -141,7 +139,6 @@ static ctl_table svcrdma_parm_table[] = {
141 .maxlen = sizeof(unsigned int), 139 .maxlen = sizeof(unsigned int),
142 .mode = 0644, 140 .mode = 0644,
143 .proc_handler = &proc_dointvec_minmax, 141 .proc_handler = &proc_dointvec_minmax,
144 .strategy = &sysctl_intvec,
145 .extra1 = &min_ord, 142 .extra1 = &min_ord,
146 .extra2 = &max_ord, 143 .extra2 = &max_ord,
147 }, 144 },
@@ -209,9 +206,7 @@ static ctl_table svcrdma_parm_table[] = {
209 .mode = 0644, 206 .mode = 0644,
210 .proc_handler = &read_reset_stat, 207 .proc_handler = &read_reset_stat,
211 }, 208 },
212 { 209 { },
213 .ctl_name = 0,
214 },
215}; 210};
216 211
217static ctl_table svcrdma_table[] = { 212static ctl_table svcrdma_table[] = {
@@ -220,21 +215,16 @@ static ctl_table svcrdma_table[] = {
220 .mode = 0555, 215 .mode = 0555,
221 .child = svcrdma_parm_table 216 .child = svcrdma_parm_table
222 }, 217 },
223 { 218 { },
224 .ctl_name = 0,
225 },
226}; 219};
227 220
228static ctl_table svcrdma_root_table[] = { 221static ctl_table svcrdma_root_table[] = {
229 { 222 {
230 .ctl_name = CTL_SUNRPC,
231 .procname = "sunrpc", 223 .procname = "sunrpc",
232 .mode = 0555, 224 .mode = 0555,
233 .child = svcrdma_table 225 .child = svcrdma_table
234 }, 226 },
235 { 227 { },
236 .ctl_name = 0,
237 },
238}; 228};
239 229
240void svc_rdma_cleanup(void) 230void svc_rdma_cleanup(void)
diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
index 9a63f669ece4..476816062243 100644
--- a/net/sunrpc/xprtrdma/transport.c
+++ b/net/sunrpc/xprtrdma/transport.c
@@ -86,79 +86,63 @@ static struct ctl_table_header *sunrpc_table_header;
86 86
87static ctl_table xr_tunables_table[] = { 87static ctl_table xr_tunables_table[] = {
88 { 88 {
89 .ctl_name = CTL_UNNUMBERED,
90 .procname = "rdma_slot_table_entries", 89 .procname = "rdma_slot_table_entries",
91 .data = &xprt_rdma_slot_table_entries, 90 .data = &xprt_rdma_slot_table_entries,
92 .maxlen = sizeof(unsigned int), 91 .maxlen = sizeof(unsigned int),
93 .mode = 0644, 92 .mode = 0644,
94 .proc_handler = &proc_dointvec_minmax, 93 .proc_handler = &proc_dointvec_minmax,
95 .strategy = &sysctl_intvec,
96 .extra1 = &min_slot_table_size, 94 .extra1 = &min_slot_table_size,
97 .extra2 = &max_slot_table_size 95 .extra2 = &max_slot_table_size
98 }, 96 },
99 { 97 {
100 .ctl_name = CTL_UNNUMBERED,
101 .procname = "rdma_max_inline_read", 98 .procname = "rdma_max_inline_read",
102 .data = &xprt_rdma_max_inline_read, 99 .data = &xprt_rdma_max_inline_read,
103 .maxlen = sizeof(unsigned int), 100 .maxlen = sizeof(unsigned int),
104 .mode = 0644, 101 .mode = 0644,
105 .proc_handler = &proc_dointvec, 102 .proc_handler = &proc_dointvec,
106 .strategy = &sysctl_intvec,
107 }, 103 },
108 { 104 {
109 .ctl_name = CTL_UNNUMBERED,
110 .procname = "rdma_max_inline_write", 105 .procname = "rdma_max_inline_write",
111 .data = &xprt_rdma_max_inline_write, 106 .data = &xprt_rdma_max_inline_write,
112 .maxlen = sizeof(unsigned int), 107 .maxlen = sizeof(unsigned int),
113 .mode = 0644, 108 .mode = 0644,
114 .proc_handler = &proc_dointvec, 109 .proc_handler = &proc_dointvec,
115 .strategy = &sysctl_intvec,
116 }, 110 },
117 { 111 {
118 .ctl_name = CTL_UNNUMBERED,
119 .procname = "rdma_inline_write_padding", 112 .procname = "rdma_inline_write_padding",
120 .data = &xprt_rdma_inline_write_padding, 113 .data = &xprt_rdma_inline_write_padding,
121 .maxlen = sizeof(unsigned int), 114 .maxlen = sizeof(unsigned int),
122 .mode = 0644, 115 .mode = 0644,
123 .proc_handler = &proc_dointvec_minmax, 116 .proc_handler = &proc_dointvec_minmax,
124 .strategy = &sysctl_intvec,
125 .extra1 = &zero, 117 .extra1 = &zero,
126 .extra2 = &max_padding, 118 .extra2 = &max_padding,
127 }, 119 },
128 { 120 {
129 .ctl_name = CTL_UNNUMBERED,
130 .procname = "rdma_memreg_strategy", 121 .procname = "rdma_memreg_strategy",
131 .data = &xprt_rdma_memreg_strategy, 122 .data = &xprt_rdma_memreg_strategy,
132 .maxlen = sizeof(unsigned int), 123 .maxlen = sizeof(unsigned int),
133 .mode = 0644, 124 .mode = 0644,
134 .proc_handler = &proc_dointvec_minmax, 125 .proc_handler = &proc_dointvec_minmax,
135 .strategy = &sysctl_intvec,
136 .extra1 = &min_memreg, 126 .extra1 = &min_memreg,
137 .extra2 = &max_memreg, 127 .extra2 = &max_memreg,
138 }, 128 },
139 { 129 {
140 .ctl_name = CTL_UNNUMBERED,
141 .procname = "rdma_pad_optimize", 130 .procname = "rdma_pad_optimize",
142 .data = &xprt_rdma_pad_optimize, 131 .data = &xprt_rdma_pad_optimize,
143 .maxlen = sizeof(unsigned int), 132 .maxlen = sizeof(unsigned int),
144 .mode = 0644, 133 .mode = 0644,
145 .proc_handler = &proc_dointvec, 134 .proc_handler = &proc_dointvec,
146 }, 135 },
147 { 136 { },
148 .ctl_name = 0,
149 },
150}; 137};
151 138
152static ctl_table sunrpc_table[] = { 139static ctl_table sunrpc_table[] = {
153 { 140 {
154 .ctl_name = CTL_SUNRPC,
155 .procname = "sunrpc", 141 .procname = "sunrpc",
156 .mode = 0555, 142 .mode = 0555,
157 .child = xr_tunables_table 143 .child = xr_tunables_table
158 }, 144 },
159 { 145 { },
160 .ctl_name = 0,
161 },
162}; 146};
163 147
164#endif 148#endif
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 37c5475ba258..8b9a2079f2e3 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -81,46 +81,38 @@ static struct ctl_table_header *sunrpc_table_header;
81 */ 81 */
82static ctl_table xs_tunables_table[] = { 82static ctl_table xs_tunables_table[] = {
83 { 83 {
84 .ctl_name = CTL_SLOTTABLE_UDP,
85 .procname = "udp_slot_table_entries", 84 .procname = "udp_slot_table_entries",
86 .data = &xprt_udp_slot_table_entries, 85 .data = &xprt_udp_slot_table_entries,
87 .maxlen = sizeof(unsigned int), 86 .maxlen = sizeof(unsigned int),
88 .mode = 0644, 87 .mode = 0644,
89 .proc_handler = &proc_dointvec_minmax, 88 .proc_handler = &proc_dointvec_minmax,
90 .strategy = &sysctl_intvec,
91 .extra1 = &min_slot_table_size, 89 .extra1 = &min_slot_table_size,
92 .extra2 = &max_slot_table_size 90 .extra2 = &max_slot_table_size
93 }, 91 },
94 { 92 {
95 .ctl_name = CTL_SLOTTABLE_TCP,
96 .procname = "tcp_slot_table_entries", 93 .procname = "tcp_slot_table_entries",
97 .data = &xprt_tcp_slot_table_entries, 94 .data = &xprt_tcp_slot_table_entries,
98 .maxlen = sizeof(unsigned int), 95 .maxlen = sizeof(unsigned int),
99 .mode = 0644, 96 .mode = 0644,
100 .proc_handler = &proc_dointvec_minmax, 97 .proc_handler = &proc_dointvec_minmax,
101 .strategy = &sysctl_intvec,
102 .extra1 = &min_slot_table_size, 98 .extra1 = &min_slot_table_size,
103 .extra2 = &max_slot_table_size 99 .extra2 = &max_slot_table_size
104 }, 100 },
105 { 101 {
106 .ctl_name = CTL_MIN_RESVPORT,
107 .procname = "min_resvport", 102 .procname = "min_resvport",
108 .data = &xprt_min_resvport, 103 .data = &xprt_min_resvport,
109 .maxlen = sizeof(unsigned int), 104 .maxlen = sizeof(unsigned int),
110 .mode = 0644, 105 .mode = 0644,
111 .proc_handler = &proc_dointvec_minmax, 106 .proc_handler = &proc_dointvec_minmax,
112 .strategy = &sysctl_intvec,
113 .extra1 = &xprt_min_resvport_limit, 107 .extra1 = &xprt_min_resvport_limit,
114 .extra2 = &xprt_max_resvport_limit 108 .extra2 = &xprt_max_resvport_limit
115 }, 109 },
116 { 110 {
117 .ctl_name = CTL_MAX_RESVPORT,
118 .procname = "max_resvport", 111 .procname = "max_resvport",
119 .data = &xprt_max_resvport, 112 .data = &xprt_max_resvport,
120 .maxlen = sizeof(unsigned int), 113 .maxlen = sizeof(unsigned int),
121 .mode = 0644, 114 .mode = 0644,
122 .proc_handler = &proc_dointvec_minmax, 115 .proc_handler = &proc_dointvec_minmax,
123 .strategy = &sysctl_intvec,
124 .extra1 = &xprt_min_resvport_limit, 116 .extra1 = &xprt_min_resvport_limit,
125 .extra2 = &xprt_max_resvport_limit 117 .extra2 = &xprt_max_resvport_limit
126 }, 118 },
@@ -130,23 +122,17 @@ static ctl_table xs_tunables_table[] = {
130 .maxlen = sizeof(xs_tcp_fin_timeout), 122 .maxlen = sizeof(xs_tcp_fin_timeout),
131 .mode = 0644, 123 .mode = 0644,
132 .proc_handler = &proc_dointvec_jiffies, 124 .proc_handler = &proc_dointvec_jiffies,
133 .strategy = sysctl_jiffies
134 },
135 {
136 .ctl_name = 0,
137 }, 125 },
126 { },
138}; 127};
139 128
140static ctl_table sunrpc_table[] = { 129static ctl_table sunrpc_table[] = {
141 { 130 {
142 .ctl_name = CTL_SUNRPC,
143 .procname = "sunrpc", 131 .procname = "sunrpc",
144 .mode = 0555, 132 .mode = 0555,
145 .child = xs_tunables_table 133 .child = xs_tunables_table
146 }, 134 },
147 { 135 { },
148 .ctl_name = 0,
149 },
150}; 136};
151 137
152#endif 138#endif
diff --git a/net/unix/sysctl_net_unix.c b/net/unix/sysctl_net_unix.c
index 83c093077ebc..708f5df6b7f0 100644
--- a/net/unix/sysctl_net_unix.c
+++ b/net/unix/sysctl_net_unix.c
@@ -16,19 +16,18 @@
16 16
17static ctl_table unix_table[] = { 17static ctl_table unix_table[] = {
18 { 18 {
19 .ctl_name = NET_UNIX_MAX_DGRAM_QLEN,
20 .procname = "max_dgram_qlen", 19 .procname = "max_dgram_qlen",
21 .data = &init_net.unx.sysctl_max_dgram_qlen, 20 .data = &init_net.unx.sysctl_max_dgram_qlen,
22 .maxlen = sizeof(int), 21 .maxlen = sizeof(int),
23 .mode = 0644, 22 .mode = 0644,
24 .proc_handler = proc_dointvec 23 .proc_handler = proc_dointvec
25 }, 24 },
26 { .ctl_name = 0 } 25 { }
27}; 26};
28 27
29static struct ctl_path unix_path[] = { 28static struct ctl_path unix_path[] = {
30 { .procname = "net", .ctl_name = CTL_NET, }, 29 { .procname = "net", },
31 { .procname = "unix", .ctl_name = NET_UNIX, }, 30 { .procname = "unix", },
32 { }, 31 { },
33}; 32};
34 33
diff --git a/net/x25/sysctl_net_x25.c b/net/x25/sysctl_net_x25.c
index a5d3416522de..d2efd29f434e 100644
--- a/net/x25/sysctl_net_x25.c
+++ b/net/x25/sysctl_net_x25.c
@@ -19,62 +19,51 @@ static struct ctl_table_header *x25_table_header;
19 19
20static struct ctl_table x25_table[] = { 20static struct ctl_table x25_table[] = {
21 { 21 {
22 .ctl_name = NET_X25_RESTART_REQUEST_TIMEOUT,
23 .procname = "restart_request_timeout", 22 .procname = "restart_request_timeout",
24 .data = &sysctl_x25_restart_request_timeout, 23 .data = &sysctl_x25_restart_request_timeout,
25 .maxlen = sizeof(int), 24 .maxlen = sizeof(int),
26 .mode = 0644, 25 .mode = 0644,
27 .proc_handler = proc_dointvec_minmax, 26 .proc_handler = proc_dointvec_minmax,
28 .strategy = sysctl_intvec,
29 .extra1 = &min_timer, 27 .extra1 = &min_timer,
30 .extra2 = &max_timer, 28 .extra2 = &max_timer,
31 }, 29 },
32 { 30 {
33 .ctl_name = NET_X25_CALL_REQUEST_TIMEOUT,
34 .procname = "call_request_timeout", 31 .procname = "call_request_timeout",
35 .data = &sysctl_x25_call_request_timeout, 32 .data = &sysctl_x25_call_request_timeout,
36 .maxlen = sizeof(int), 33 .maxlen = sizeof(int),
37 .mode = 0644, 34 .mode = 0644,
38 .proc_handler = proc_dointvec_minmax, 35 .proc_handler = proc_dointvec_minmax,
39 .strategy = sysctl_intvec,
40 .extra1 = &min_timer, 36 .extra1 = &min_timer,
41 .extra2 = &max_timer, 37 .extra2 = &max_timer,
42 }, 38 },
43 { 39 {
44 .ctl_name = NET_X25_RESET_REQUEST_TIMEOUT,
45 .procname = "reset_request_timeout", 40 .procname = "reset_request_timeout",
46 .data = &sysctl_x25_reset_request_timeout, 41 .data = &sysctl_x25_reset_request_timeout,
47 .maxlen = sizeof(int), 42 .maxlen = sizeof(int),
48 .mode = 0644, 43 .mode = 0644,
49 .proc_handler = proc_dointvec_minmax, 44 .proc_handler = proc_dointvec_minmax,
50 .strategy = sysctl_intvec,
51 .extra1 = &min_timer, 45 .extra1 = &min_timer,
52 .extra2 = &max_timer, 46 .extra2 = &max_timer,
53 }, 47 },
54 { 48 {
55 .ctl_name = NET_X25_CLEAR_REQUEST_TIMEOUT,
56 .procname = "clear_request_timeout", 49 .procname = "clear_request_timeout",
57 .data = &sysctl_x25_clear_request_timeout, 50 .data = &sysctl_x25_clear_request_timeout,
58 .maxlen = sizeof(int), 51 .maxlen = sizeof(int),
59 .mode = 0644, 52 .mode = 0644,
60 .proc_handler = proc_dointvec_minmax, 53 .proc_handler = proc_dointvec_minmax,
61 .strategy = sysctl_intvec,
62 .extra1 = &min_timer, 54 .extra1 = &min_timer,
63 .extra2 = &max_timer, 55 .extra2 = &max_timer,
64 }, 56 },
65 { 57 {
66 .ctl_name = NET_X25_ACK_HOLD_BACK_TIMEOUT,
67 .procname = "acknowledgement_hold_back_timeout", 58 .procname = "acknowledgement_hold_back_timeout",
68 .data = &sysctl_x25_ack_holdback_timeout, 59 .data = &sysctl_x25_ack_holdback_timeout,
69 .maxlen = sizeof(int), 60 .maxlen = sizeof(int),
70 .mode = 0644, 61 .mode = 0644,
71 .proc_handler = proc_dointvec_minmax, 62 .proc_handler = proc_dointvec_minmax,
72 .strategy = sysctl_intvec,
73 .extra1 = &min_timer, 63 .extra1 = &min_timer,
74 .extra2 = &max_timer, 64 .extra2 = &max_timer,
75 }, 65 },
76 { 66 {
77 .ctl_name = NET_X25_FORWARD,
78 .procname = "x25_forward", 67 .procname = "x25_forward",
79 .data = &sysctl_x25_forward, 68 .data = &sysctl_x25_forward,
80 .maxlen = sizeof(int), 69 .maxlen = sizeof(int),
@@ -85,8 +74,8 @@ static struct ctl_table x25_table[] = {
85}; 74};
86 75
87static struct ctl_path x25_path[] = { 76static struct ctl_path x25_path[] = {
88 { .procname = "net", .ctl_name = CTL_NET, }, 77 { .procname = "net", },
89 { .procname = "x25", .ctl_name = NET_X25, }, 78 { .procname = "x25", },
90 { } 79 { }
91}; 80};
92 81
diff --git a/net/xfrm/xfrm_sysctl.c b/net/xfrm/xfrm_sysctl.c
index 2e6ffb66f06f..2e221f2cad7e 100644
--- a/net/xfrm/xfrm_sysctl.c
+++ b/net/xfrm/xfrm_sysctl.c
@@ -13,28 +13,24 @@ static void __xfrm_sysctl_init(struct net *net)
13#ifdef CONFIG_SYSCTL 13#ifdef CONFIG_SYSCTL
14static struct ctl_table xfrm_table[] = { 14static struct ctl_table xfrm_table[] = {
15 { 15 {
16 .ctl_name = NET_CORE_AEVENT_ETIME,
17 .procname = "xfrm_aevent_etime", 16 .procname = "xfrm_aevent_etime",
18 .maxlen = sizeof(u32), 17 .maxlen = sizeof(u32),
19 .mode = 0644, 18 .mode = 0644,
20 .proc_handler = proc_dointvec 19 .proc_handler = proc_dointvec
21 }, 20 },
22 { 21 {
23 .ctl_name = NET_CORE_AEVENT_RSEQTH,
24 .procname = "xfrm_aevent_rseqth", 22 .procname = "xfrm_aevent_rseqth",
25 .maxlen = sizeof(u32), 23 .maxlen = sizeof(u32),
26 .mode = 0644, 24 .mode = 0644,
27 .proc_handler = proc_dointvec 25 .proc_handler = proc_dointvec
28 }, 26 },
29 { 27 {
30 .ctl_name = CTL_UNNUMBERED,
31 .procname = "xfrm_larval_drop", 28 .procname = "xfrm_larval_drop",
32 .maxlen = sizeof(int), 29 .maxlen = sizeof(int),
33 .mode = 0644, 30 .mode = 0644,
34 .proc_handler = proc_dointvec 31 .proc_handler = proc_dointvec
35 }, 32 },
36 { 33 {
37 .ctl_name = CTL_UNNUMBERED,
38 .procname = "xfrm_acq_expires", 34 .procname = "xfrm_acq_expires",
39 .maxlen = sizeof(int), 35 .maxlen = sizeof(int),
40 .mode = 0644, 36 .mode = 0644,
diff --git a/security/keys/sysctl.c b/security/keys/sysctl.c
index 5e05dc09e2db..3565e2fc10c9 100644
--- a/security/keys/sysctl.c
+++ b/security/keys/sysctl.c
@@ -17,7 +17,6 @@ static const int zero, one = 1, max = INT_MAX;
17 17
18ctl_table key_sysctls[] = { 18ctl_table key_sysctls[] = {
19 { 19 {
20 .ctl_name = CTL_UNNUMBERED,
21 .procname = "maxkeys", 20 .procname = "maxkeys",
22 .data = &key_quota_maxkeys, 21 .data = &key_quota_maxkeys,
23 .maxlen = sizeof(unsigned), 22 .maxlen = sizeof(unsigned),
@@ -27,7 +26,6 @@ ctl_table key_sysctls[] = {
27 .extra2 = (void *) &max, 26 .extra2 = (void *) &max,
28 }, 27 },
29 { 28 {
30 .ctl_name = CTL_UNNUMBERED,
31 .procname = "maxbytes", 29 .procname = "maxbytes",
32 .data = &key_quota_maxbytes, 30 .data = &key_quota_maxbytes,
33 .maxlen = sizeof(unsigned), 31 .maxlen = sizeof(unsigned),
@@ -37,7 +35,6 @@ ctl_table key_sysctls[] = {
37 .extra2 = (void *) &max, 35 .extra2 = (void *) &max,
38 }, 36 },
39 { 37 {
40 .ctl_name = CTL_UNNUMBERED,
41 .procname = "root_maxkeys", 38 .procname = "root_maxkeys",
42 .data = &key_quota_root_maxkeys, 39 .data = &key_quota_root_maxkeys,
43 .maxlen = sizeof(unsigned), 40 .maxlen = sizeof(unsigned),
@@ -47,7 +44,6 @@ ctl_table key_sysctls[] = {
47 .extra2 = (void *) &max, 44 .extra2 = (void *) &max,
48 }, 45 },
49 { 46 {
50 .ctl_name = CTL_UNNUMBERED,
51 .procname = "root_maxbytes", 47 .procname = "root_maxbytes",
52 .data = &key_quota_root_maxbytes, 48 .data = &key_quota_root_maxbytes,
53 .maxlen = sizeof(unsigned), 49 .maxlen = sizeof(unsigned),
@@ -57,7 +53,6 @@ ctl_table key_sysctls[] = {
57 .extra2 = (void *) &max, 53 .extra2 = (void *) &max,
58 }, 54 },
59 { 55 {
60 .ctl_name = CTL_UNNUMBERED,
61 .procname = "gc_delay", 56 .procname = "gc_delay",
62 .data = &key_gc_delay, 57 .data = &key_gc_delay,
63 .maxlen = sizeof(unsigned), 58 .maxlen = sizeof(unsigned),
@@ -66,5 +61,5 @@ ctl_table key_sysctls[] = {
66 .extra1 = (void *) &zero, 61 .extra1 = (void *) &zero,
67 .extra2 = (void *) &max, 62 .extra2 = (void *) &max,
68 }, 63 },
69 { .ctl_name = 0 } 64 { }
70}; 65};
diff --git a/security/tomoyo/tomoyo.c b/security/tomoyo/tomoyo.c
index 9548a0984cc4..3f93bb91768b 100644
--- a/security/tomoyo/tomoyo.c
+++ b/security/tomoyo/tomoyo.c
@@ -122,15 +122,7 @@ static char *tomoyo_sysctl_path(struct ctl_table *table)
122 *--end = '\0'; 122 *--end = '\0';
123 buflen--; 123 buflen--;
124 while (table) { 124 while (table) {
125 char num[32]; 125 if (tomoyo_prepend(&end, &buflen, table->procname) ||
126 const char *sp = table->procname;
127
128 if (!sp) {
129 memset(num, 0, sizeof(num));
130 snprintf(num, sizeof(num) - 1, "=%d=", table->ctl_name);
131 sp = num;
132 }
133 if (tomoyo_prepend(&end, &buflen, sp) ||
134 tomoyo_prepend(&end, &buflen, "/")) 126 tomoyo_prepend(&end, &buflen, "/"))
135 goto out; 127 goto out;
136 table = table->parent; 128 table = table->parent;