提交 1557d330 编写于 作者: L Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/sysctl-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/sysctl-2.6: (43 commits)
  security/tomoyo: Remove now unnecessary handling of security_sysctl.
  security/tomoyo: Add a special case to handle accesses through the internal proc mount.
  sysctl: Drop & in front of every proc_handler.
  sysctl: Remove CTL_NONE and CTL_UNNUMBERED
  sysctl: kill dead ctl_handler definitions.
  sysctl: Remove the last of the generic binary sysctl support
  sysctl net: Remove unused binary sysctl code
  sysctl security/tomoyo: Don't look at ctl_name
  sysctl arm: Remove binary sysctl support
  sysctl x86: Remove dead binary sysctl support
  sysctl sh: Remove dead binary sysctl support
  sysctl powerpc: Remove dead binary sysctl support
  sysctl ia64: Remove dead binary sysctl support
  sysctl s390: Remove dead sysctl binary support
  sysctl frv: Remove dead binary sysctl support
  sysctl mips/lasat: Remove dead binary sysctl support
  sysctl drivers: Remove dead binary sysctl support
  sysctl crypto: Remove dead binary sysctl support
  sysctl security/keys: Remove dead binary sysctl support
  sysctl kernel: Remove binary sysctl logic
  ...
Except for a few extremely rare exceptions user space applications do not use
the binary sysctl interface. Instead everyone uses /proc/sys/... with
readable ascii names.
Recently the kernel has started supporting setting the binary sysctl value to
CTL_UNNUMBERED so we no longer need to assign a binary sysctl path to allow
sysctls to show up in /proc/sys.
Assigning binary sysctl numbers is an endless source of conflicts in sysctl.h,
breaking of the user space ABI (because of those conflicts), and maintenance
problems. A complete pass through all of the sysctl users revealed multiple
instances where the sysctl binary interface was broken and had gone undetected
for years.
So please do not add new binary sysctl numbers. They are unneeded and
problematic.
If you really need a new binary sysctl number please first merge your sysctl
into the kernel and then as a separate patch allocate a binary sysctl number.
(ebiederm@xmission.com, June 2007)
...@@ -22,47 +22,42 @@ static unsigned int isa_membase, isa_portbase, isa_portshift; ...@@ -22,47 +22,42 @@ static unsigned int isa_membase, isa_portbase, isa_portshift;
static ctl_table ctl_isa_vars[4] = { static ctl_table ctl_isa_vars[4] = {
{ {
.ctl_name = BUS_ISA_MEM_BASE,
.procname = "membase", .procname = "membase",
.data = &isa_membase, .data = &isa_membase,
.maxlen = sizeof(isa_membase), .maxlen = sizeof(isa_membase),
.mode = 0444, .mode = 0444,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
}, { }, {
.ctl_name = BUS_ISA_PORT_BASE,
.procname = "portbase", .procname = "portbase",
.data = &isa_portbase, .data = &isa_portbase,
.maxlen = sizeof(isa_portbase), .maxlen = sizeof(isa_portbase),
.mode = 0444, .mode = 0444,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
}, { }, {
.ctl_name = BUS_ISA_PORT_SHIFT,
.procname = "portshift", .procname = "portshift",
.data = &isa_portshift, .data = &isa_portshift,
.maxlen = sizeof(isa_portshift), .maxlen = sizeof(isa_portshift),
.mode = 0444, .mode = 0444,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
}, {0} }, {}
}; };
static struct ctl_table_header *isa_sysctl_header; static struct ctl_table_header *isa_sysctl_header;
static ctl_table ctl_isa[2] = { static ctl_table ctl_isa[2] = {
{ {
.ctl_name = CTL_BUS_ISA,
.procname = "isa", .procname = "isa",
.mode = 0555, .mode = 0555,
.child = ctl_isa_vars, .child = ctl_isa_vars,
}, {0} }, {}
}; };
static ctl_table ctl_bus[2] = { static ctl_table ctl_bus[2] = {
{ {
.ctl_name = CTL_BUS,
.procname = "bus", .procname = "bus",
.mode = 0555, .mode = 0555,
.child = ctl_isa, .child = ctl_isa,
}, {0} }, {}
}; };
void __init void __init
......
...@@ -47,10 +47,6 @@ HW_DECLARE_SPINLOCK(gpio) ...@@ -47,10 +47,6 @@ HW_DECLARE_SPINLOCK(gpio)
EXPORT_SYMBOL(bcmring_gpio_reg_lock); EXPORT_SYMBOL(bcmring_gpio_reg_lock);
#endif #endif
/* FIXME: temporary solution */
#define BCM_SYSCTL_REBOOT_WARM 1
#define CTL_BCM_REBOOT 112
/* sysctl */ /* sysctl */
int bcmring_arch_warm_reboot; /* do a warm reboot on hard reset */ int bcmring_arch_warm_reboot; /* do a warm reboot on hard reset */
...@@ -58,18 +54,16 @@ static struct ctl_table_header *bcmring_sysctl_header; ...@@ -58,18 +54,16 @@ static struct ctl_table_header *bcmring_sysctl_header;
static struct ctl_table bcmring_sysctl_warm_reboot[] = { static struct ctl_table bcmring_sysctl_warm_reboot[] = {
{ {
.ctl_name = BCM_SYSCTL_REBOOT_WARM,
.procname = "warm", .procname = "warm",
.data = &bcmring_arch_warm_reboot, .data = &bcmring_arch_warm_reboot,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec}, .proc_handler = proc_dointvec},
{} {}
}; };
static struct ctl_table bcmring_sysctl_reboot[] = { static struct ctl_table bcmring_sysctl_reboot[] = {
{ {
.ctl_name = CTL_BCM_REBOOT,
.procname = "reboot", .procname = "reboot",
.mode = 0555, .mode = 0555,
.child = bcmring_sysctl_warm_reboot}, .child = bcmring_sysctl_warm_reboot},
......
...@@ -211,37 +211,6 @@ static int cmode_procctl(ctl_table *ctl, int write, ...@@ -211,37 +211,6 @@ static int cmode_procctl(ctl_table *ctl, int write,
return try_set_cmode(new_cmode)?:*lenp; return try_set_cmode(new_cmode)?:*lenp;
} }
static int cmode_sysctl(ctl_table *table,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
if (oldval && oldlenp) {
size_t oldlen;
if (get_user(oldlen, oldlenp))
return -EFAULT;
if (oldlen != sizeof(int))
return -EINVAL;
if (put_user(clock_cmode_current, (unsigned __user *)oldval) ||
put_user(sizeof(int), oldlenp))
return -EFAULT;
}
if (newval && newlen) {
int new_cmode;
if (newlen != sizeof(int))
return -EINVAL;
if (get_user(new_cmode, (int __user *)newval))
return -EFAULT;
return try_set_cmode(new_cmode)?:1;
}
return 1;
}
static int try_set_p0(int new_p0) static int try_set_p0(int new_p0)
{ {
unsigned long flags, clkc; unsigned long flags, clkc;
...@@ -314,37 +283,6 @@ static int p0_procctl(ctl_table *ctl, int write, ...@@ -314,37 +283,6 @@ static int p0_procctl(ctl_table *ctl, int write,
return try_set_p0(new_p0)?:*lenp; return try_set_p0(new_p0)?:*lenp;
} }
static int p0_sysctl(ctl_table *table,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
if (oldval && oldlenp) {
size_t oldlen;
if (get_user(oldlen, oldlenp))
return -EFAULT;
if (oldlen != sizeof(int))
return -EINVAL;
if (put_user(clock_p0_current, (unsigned __user *)oldval) ||
put_user(sizeof(int), oldlenp))
return -EFAULT;
}
if (newval && newlen) {
int new_p0;
if (newlen != sizeof(int))
return -EINVAL;
if (get_user(new_p0, (int __user *)newval))
return -EFAULT;
return try_set_p0(new_p0)?:1;
}
return 1;
}
static int cm_procctl(ctl_table *ctl, int write, static int cm_procctl(ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *fpos) void __user *buffer, size_t *lenp, loff_t *fpos)
{ {
...@@ -358,87 +296,47 @@ static int cm_procctl(ctl_table *ctl, int write, ...@@ -358,87 +296,47 @@ static int cm_procctl(ctl_table *ctl, int write,
return try_set_cm(new_cm)?:*lenp; return try_set_cm(new_cm)?:*lenp;
} }
static int cm_sysctl(ctl_table *table,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
if (oldval && oldlenp) {
size_t oldlen;
if (get_user(oldlen, oldlenp))
return -EFAULT;
if (oldlen != sizeof(int))
return -EINVAL;
if (put_user(clock_cm_current, (unsigned __user *)oldval) ||
put_user(sizeof(int), oldlenp))
return -EFAULT;
}
if (newval && newlen) {
int new_cm;
if (newlen != sizeof(int))
return -EINVAL;
if (get_user(new_cm, (int __user *)newval))
return -EFAULT;
return try_set_cm(new_cm)?:1;
}
return 1;
}
static struct ctl_table pm_table[] = static struct ctl_table pm_table[] =
{ {
{ {
.ctl_name = CTL_PM_SUSPEND,
.procname = "suspend", .procname = "suspend",
.data = NULL, .data = NULL,
.maxlen = 0, .maxlen = 0,
.mode = 0200, .mode = 0200,
.proc_handler = &sysctl_pm_do_suspend, .proc_handler = sysctl_pm_do_suspend,
}, },
{ {
.ctl_name = CTL_PM_CMODE,
.procname = "cmode", .procname = "cmode",
.data = &clock_cmode_current, .data = &clock_cmode_current,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &cmode_procctl, .proc_handler = cmode_procctl,
.strategy = &cmode_sysctl,
}, },
{ {
.ctl_name = CTL_PM_P0,
.procname = "p0", .procname = "p0",
.data = &clock_p0_current, .data = &clock_p0_current,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &p0_procctl, .proc_handler = p0_procctl,
.strategy = &p0_sysctl,
}, },
{ {
.ctl_name = CTL_PM_CM,
.procname = "cm", .procname = "cm",
.data = &clock_cm_current, .data = &clock_cm_current,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &cm_procctl, .proc_handler = cm_procctl,
.strategy = &cm_sysctl,
}, },
{ .ctl_name = 0} { }
}; };
static struct ctl_table pm_dir_table[] = static struct ctl_table pm_dir_table[] =
{ {
{ {
.ctl_name = CTL_PM,
.procname = "pm", .procname = "pm",
.mode = 0555, .mode = 0555,
.child = pm_table, .child = pm_table,
}, },
{ .ctl_name = 0} { }
}; };
/* /*
......
...@@ -176,21 +176,19 @@ static int procctl_frv_pin_cxnr(ctl_table *table, int write, struct file *filp, ...@@ -176,21 +176,19 @@ static int procctl_frv_pin_cxnr(ctl_table *table, int write, struct file *filp,
static struct ctl_table frv_table[] = static struct ctl_table frv_table[] =
{ {
{ {
.ctl_name = 1,
.procname = "cache-mode", .procname = "cache-mode",
.data = NULL, .data = NULL,
.maxlen = 0, .maxlen = 0,
.mode = 0644, .mode = 0644,
.proc_handler = &procctl_frv_cachemode, .proc_handler = procctl_frv_cachemode,
}, },
#ifdef CONFIG_MMU #ifdef CONFIG_MMU
{ {
.ctl_name = 2,
.procname = "pin-cxnr", .procname = "pin-cxnr",
.data = NULL, .data = NULL,
.maxlen = 0, .maxlen = 0,
.mode = 0644, .mode = 0644,
.proc_handler = &procctl_frv_pin_cxnr .proc_handler = procctl_frv_pin_cxnr
}, },
#endif #endif
{} {}
...@@ -203,7 +201,6 @@ static struct ctl_table frv_table[] = ...@@ -203,7 +201,6 @@ static struct ctl_table frv_table[] =
static struct ctl_table frv_dir_table[] = static struct ctl_table frv_dir_table[] =
{ {
{ {
.ctl_name = CTL_FRV,
.procname = "frv", .procname = "frv",
.mode = 0555, .mode = 0555,
.child = frv_table .child = frv_table
......
...@@ -327,7 +327,7 @@ ia32_syscall_table: ...@@ -327,7 +327,7 @@ ia32_syscall_table:
data8 compat_sys_writev data8 compat_sys_writev
data8 sys_getsid data8 sys_getsid
data8 sys_fdatasync data8 sys_fdatasync
data8 sys32_sysctl data8 compat_sys_sysctl
data8 sys_mlock /* 150 */ data8 sys_mlock /* 150 */
data8 sys_munlock data8 sys_munlock
data8 sys_mlockall data8 sys_mlockall
......
...@@ -1628,61 +1628,6 @@ sys32_msync (unsigned int start, unsigned int len, int flags) ...@@ -1628,61 +1628,6 @@ sys32_msync (unsigned int start, unsigned int len, int flags)
return sys_msync(addr, len + (start - addr), flags); return sys_msync(addr, len + (start - addr), flags);
} }
struct sysctl32 {
unsigned int name;
int nlen;
unsigned int oldval;
unsigned int oldlenp;
unsigned int newval;
unsigned int newlen;
unsigned int __unused[4];
};
#ifdef CONFIG_SYSCTL_SYSCALL
asmlinkage long
sys32_sysctl (struct sysctl32 __user *args)
{
struct sysctl32 a32;
mm_segment_t old_fs = get_fs ();
void __user *oldvalp, *newvalp;
size_t oldlen;
int __user *namep;
long ret;
if (copy_from_user(&a32, args, sizeof(a32)))
return -EFAULT;
/*
* We need to pre-validate these because we have to disable address checking
* before calling do_sysctl() because of OLDLEN but we can't run the risk of the
* user specifying bad addresses here. Well, since we're dealing with 32 bit
* addresses, we KNOW that access_ok() will always succeed, so this is an
* expensive NOP, but so what...
*/
namep = (int __user *) compat_ptr(a32.name);
oldvalp = compat_ptr(a32.oldval);
newvalp = compat_ptr(a32.newval);
if ((oldvalp && get_user(oldlen, (int __user *) compat_ptr(a32.oldlenp)))
|| !access_ok(VERIFY_WRITE, namep, 0)
|| !access_ok(VERIFY_WRITE, oldvalp, 0)
|| !access_ok(VERIFY_WRITE, newvalp, 0))
return -EFAULT;
set_fs(KERNEL_DS);
lock_kernel();
ret = do_sysctl(namep, a32.nlen, oldvalp, (size_t __user *) &oldlen,
newvalp, (size_t) a32.newlen);
unlock_kernel();
set_fs(old_fs);
if (oldvalp && put_user (oldlen, (int __user *) compat_ptr(a32.oldlenp)))
return -EFAULT;
return ret;
}
#endif
asmlinkage long asmlinkage long
sys32_newuname (struct new_utsname __user *name) sys32_newuname (struct new_utsname __user *name)
{ {
......
...@@ -239,32 +239,29 @@ kdump_init_notifier(struct notifier_block *self, unsigned long val, void *data) ...@@ -239,32 +239,29 @@ kdump_init_notifier(struct notifier_block *self, unsigned long val, void *data)
#ifdef CONFIG_SYSCTL #ifdef CONFIG_SYSCTL
static ctl_table kdump_ctl_table[] = { static ctl_table kdump_ctl_table[] = {
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "kdump_on_init", .procname = "kdump_on_init",
.data = &kdump_on_init, .data = &kdump_on_init,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "kdump_on_fatal_mca", .procname = "kdump_on_fatal_mca",
.data = &kdump_on_fatal_mca, .data = &kdump_on_fatal_mca,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ .ctl_name = 0 } { }
}; };
static ctl_table sys_table[] = { static ctl_table sys_table[] = {
{ {
.ctl_name = CTL_KERN,
.procname = "kernel", .procname = "kernel",
.mode = 0555, .mode = 0555,
.child = kdump_ctl_table, .child = kdump_ctl_table,
}, },
{ .ctl_name = 0 } { }
}; };
#endif #endif
......
...@@ -522,42 +522,37 @@ EXPORT_SYMBOL(pfm_sysctl); ...@@ -522,42 +522,37 @@ EXPORT_SYMBOL(pfm_sysctl);
static ctl_table pfm_ctl_table[]={ static ctl_table pfm_ctl_table[]={
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "debug", .procname = "debug",
.data = &pfm_sysctl.debug, .data = &pfm_sysctl.debug,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0666, .mode = 0666,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "debug_ovfl", .procname = "debug_ovfl",
.data = &pfm_sysctl.debug_ovfl, .data = &pfm_sysctl.debug_ovfl,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0666, .mode = 0666,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "fastctxsw", .procname = "fastctxsw",
.data = &pfm_sysctl.fastctxsw, .data = &pfm_sysctl.fastctxsw,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0600, .mode = 0600,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "expert_mode", .procname = "expert_mode",
.data = &pfm_sysctl.expert_mode, .data = &pfm_sysctl.expert_mode,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0600, .mode = 0600,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
}, },
{} {}
}; };
static ctl_table pfm_sysctl_dir[] = { static ctl_table pfm_sysctl_dir[] = {
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "perfmon", .procname = "perfmon",
.mode = 0555, .mode = 0555,
.child = pfm_ctl_table, .child = pfm_ctl_table,
...@@ -566,7 +561,6 @@ static ctl_table pfm_sysctl_dir[] = { ...@@ -566,7 +561,6 @@ static ctl_table pfm_sysctl_dir[] = {
}; };
static ctl_table pfm_sysctl_root[] = { static ctl_table pfm_sysctl_root[] = {
{ {
.ctl_name = CTL_KERN,
.procname = "kernel", .procname = "kernel",
.mode = 0555, .mode = 0555,
.child = pfm_sysctl_dir, .child = pfm_sysctl_dir,
......
...@@ -265,67 +265,6 @@ SYSCALL_DEFINE5(n32_msgrcv, int, msqid, u32, msgp, size_t, msgsz, ...@@ -265,67 +265,6 @@ SYSCALL_DEFINE5(n32_msgrcv, int, msqid, u32, msgp, size_t, msgsz,
} }
#endif #endif
struct sysctl_args32
{
compat_caddr_t name;
int nlen;
compat_caddr_t oldval;
compat_caddr_t oldlenp;
compat_caddr_t newval;
compat_size_t newlen;
unsigned int __unused[4];
};
#ifdef CONFIG_SYSCTL_SYSCALL
SYSCALL_DEFINE1(32_sysctl, struct sysctl_args32 __user *, args)
{
struct sysctl_args32 tmp;
int error;
size_t oldlen;
size_t __user *oldlenp = NULL;
unsigned long addr = (((unsigned long)&args->__unused[0]) + 7) & ~7;
if (copy_from_user(&tmp, args, sizeof(tmp)))
return -EFAULT;
if (tmp.oldval && tmp.oldlenp) {
/* Duh, this is ugly and might not work if sysctl_args
is in read-only memory, but do_sysctl does indirectly
a lot of uaccess in both directions and we'd have to
basically copy the whole sysctl.c here, and
glibc's __sysctl uses rw memory for the structure
anyway. */
if (get_user(oldlen, (u32 __user *)A(tmp.oldlenp)) ||
put_user(oldlen, (size_t __user *)addr))
return -EFAULT;
oldlenp = (size_t __user *)addr;
}
lock_kernel();
error = do_sysctl((int __user *)A(tmp.name), tmp.nlen, (void __user *)A(tmp.oldval),
oldlenp, (void __user *)A(tmp.newval), tmp.newlen);
unlock_kernel();
if (oldlenp) {
if (!error) {
if (get_user(oldlen, (size_t __user *)addr) ||
put_user(oldlen, (u32 __user *)A(tmp.oldlenp)))
error = -EFAULT;
}
copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused));
}
return error;
}
#else
SYSCALL_DEFINE1(32_sysctl, struct sysctl_args32 __user *, args)
{
return -ENOSYS;
}
#endif /* CONFIG_SYSCTL_SYSCALL */
SYSCALL_DEFINE1(32_newuname, struct new_utsname __user *, name) SYSCALL_DEFINE1(32_newuname, struct new_utsname __user *, name)
{ {
int ret = 0; int ret = 0;
......
...@@ -272,7 +272,7 @@ EXPORT(sysn32_call_table) ...@@ -272,7 +272,7 @@ EXPORT(sysn32_call_table)
PTR sys_munlockall PTR sys_munlockall
PTR sys_vhangup /* 6150 */ PTR sys_vhangup /* 6150 */
PTR sys_pivot_root PTR sys_pivot_root
PTR sys_32_sysctl PTR compat_sys_sysctl
PTR sys_prctl PTR sys_prctl
PTR compat_sys_adjtimex PTR compat_sys_adjtimex
PTR compat_sys_setrlimit /* 6155 */ PTR compat_sys_setrlimit /* 6155 */
......
...@@ -356,7 +356,7 @@ sys_call_table: ...@@ -356,7 +356,7 @@ sys_call_table:
PTR sys_ni_syscall /* 4150 */ PTR sys_ni_syscall /* 4150 */
PTR sys_getsid PTR sys_getsid
PTR sys_fdatasync PTR sys_fdatasync
PTR sys_32_sysctl PTR compat_sys_sysctl
PTR sys_mlock PTR sys_mlock
PTR sys_munlock /* 4155 */ PTR sys_munlock /* 4155 */
PTR sys_mlockall PTR sys_mlockall
......
...@@ -37,23 +37,6 @@ ...@@ -37,23 +37,6 @@
#include "ds1603.h" #include "ds1603.h"
#endif #endif
/* Strategy function to write EEPROM after changing string entry */
int sysctl_lasatstring(ctl_table *table,
void *oldval, size_t *oldlenp,
void *newval, size_t newlen)
{
int r;
r = sysctl_string(table, oldval, oldlenp, newval, newlen);
if (r < 0)
return r;
if (newval && newlen)
lasat_write_eeprom_info();
return 0;
}
/* And the same for proc */ /* And the same for proc */
int proc_dolasatstring(ctl_table *table, int write, int proc_dolasatstring(ctl_table *table, int write,
...@@ -113,46 +96,6 @@ int proc_dolasatrtc(ctl_table *table, int write, ...@@ -113,46 +96,6 @@ int proc_dolasatrtc(ctl_table *table, int write,
} }
#endif #endif
/* Sysctl for setting the IP addresses */
int sysctl_lasat_intvec(ctl_table *table,
void *oldval, size_t *oldlenp,
void *newval, size_t newlen)
{
int r;
r = sysctl_intvec(table, oldval, oldlenp, newval, newlen);
if (r < 0)
return r;
if (newval && newlen)
lasat_write_eeprom_info();
return 0;
}
#ifdef CONFIG_DS1603
/* Same for RTC */
int sysctl_lasat_rtc(ctl_table *table,
void *oldval, size_t *oldlenp,
void *newval, size_t newlen)
{
struct timespec ts;
int r;
read_persistent_clock(&ts);
rtctmp = ts.tv_sec;
if (rtctmp < 0)
rtctmp = 0;
r = sysctl_intvec(table, oldval, oldlenp, newval, newlen);
if (r < 0)
return r;
if (newval && newlen)
rtc_mips_set_mmss(rtctmp);
return r;
}
#endif
#ifdef CONFIG_INET #ifdef CONFIG_INET
int proc_lasat_ip(ctl_table *table, int write, int proc_lasat_ip(ctl_table *table, int write,
void *buffer, size_t *lenp, loff_t *ppos) void *buffer, size_t *lenp, loff_t *ppos)
...@@ -214,23 +157,6 @@ int proc_lasat_ip(ctl_table *table, int write, ...@@ -214,23 +157,6 @@ int proc_lasat_ip(ctl_table *table, int write,
} }
#endif #endif
static int sysctl_lasat_prid(ctl_table *table,
void *oldval, size_t *oldlenp,
void *newval, size_t newlen)
{
int r;
r = sysctl_intvec(table, oldval, oldlenp, newval, newlen);
if (r < 0)
return r;
if (newval && newlen) {
lasat_board_info.li_eeprom_info.prid = *(int *)newval;
lasat_write_eeprom_info();
lasat_init_board_info();
}
return 0;
}
int proc_lasat_prid(ctl_table *table, int write, int proc_lasat_prid(ctl_table *table, int write,
void *buffer, size_t *lenp, loff_t *ppos) void *buffer, size_t *lenp, loff_t *ppos)
{ {
...@@ -252,115 +178,92 @@ extern int lasat_boot_to_service; ...@@ -252,115 +178,92 @@ extern int lasat_boot_to_service;
static ctl_table lasat_table[] = { static ctl_table lasat_table[] = {
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "cpu-hz", .procname = "cpu-hz",
.data = &lasat_board_info.li_cpu_hz, .data = &lasat_board_info.li_cpu_hz,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0444, .mode = 0444,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
.strategy = &sysctl_intvec
}, },
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "bus-hz", .procname = "bus-hz",
.data = &lasat_board_info.li_bus_hz, .data = &lasat_board_info.li_bus_hz,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0444, .mode = 0444,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
.strategy = &sysctl_intvec
}, },
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "bmid", .procname = "bmid",
.data = &lasat_board_info.li_bmid, .data = &lasat_board_info.li_bmid,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0444, .mode = 0444,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
.strategy = &sysctl_intvec
}, },
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "prid", .procname = "prid",
.data = &lasat_board_info.li_prid, .data = &lasat_board_info.li_prid,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_lasat_prid, .proc_handler = proc_lasat_prid,
.strategy = &sysctl_lasat_prid . },
},
#ifdef CONFIG_INET #ifdef CONFIG_INET
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "ipaddr", .procname = "ipaddr",
.data = &lasat_board_info.li_eeprom_info.ipaddr, .data = &lasat_board_info.li_eeprom_info.ipaddr,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_lasat_ip, .proc_handler = proc_lasat_ip,
.strategy = &sysctl_lasat_intvec
}, },
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "netmask", .procname = "netmask",
.data = &lasat_board_info.li_eeprom_info.netmask, .data = &lasat_board_info.li_eeprom_info.netmask,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_lasat_ip, .proc_handler = proc_lasat_ip,
.strategy = &sysctl_lasat_intvec
}, },
#endif #endif
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "passwd_hash", .procname = "passwd_hash",
.data = &lasat_board_info.li_eeprom_info.passwd_hash, .data = &lasat_board_info.li_eeprom_info.passwd_hash,
.maxlen = .maxlen =
sizeof(lasat_board_info.li_eeprom_info.passwd_hash), sizeof(lasat_board_info.li_eeprom_info.passwd_hash),
.mode = 0600, .mode = 0600,
.proc_handler = &proc_dolasatstring, .proc_handler = proc_dolasatstring,
.strategy = &sysctl_lasatstring
}, },
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "boot-service", .procname = "boot-service",
.data = &lasat_boot_to_service, .data = &lasat_boot_to_service,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
.strategy = &sysctl_intvec
}, },
#ifdef CONFIG_DS1603 #ifdef CONFIG_DS1603
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "rtc", .procname = "rtc",
.data = &rtctmp, .data = &rtctmp,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dolasatrtc, .proc_handler = proc_dolasatrtc,
.strategy = &sysctl_lasat_rtc
}, },
#endif #endif
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "namestr", .procname = "namestr",
.data = &lasat_board_info.li_namestr, .data = &lasat_board_info.li_namestr,
.maxlen = sizeof(lasat_board_info.li_namestr), .maxlen = sizeof(lasat_board_info.li_namestr),
.mode = 0444, .mode = 0444,
.proc_handler = &proc_dostring, .proc_handler = proc_dostring,
.strategy = &sysctl_string
}, },
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "typestr", .procname = "typestr",
.data = &lasat_board_info.li_typestr, .data = &lasat_board_info.li_typestr,
.maxlen = sizeof(lasat_board_info.li_typestr), .maxlen = sizeof(lasat_board_info.li_typestr),
.mode = 0444, .mode = 0444,
.proc_handler = &proc_dostring, .proc_handler = proc_dostring,
.strategy = &sysctl_string
}, },
{} {}
}; };
static ctl_table lasat_root_table[] = { static ctl_table lasat_root_table[] = {
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "lasat", .procname = "lasat",
.mode = 0555, .mode = 0555,
.child = lasat_table .child = lasat_table
......
...@@ -90,77 +90,6 @@ asmlinkage long sys32_unimplemented(int r26, int r25, int r24, int r23, ...@@ -90,77 +90,6 @@ asmlinkage long sys32_unimplemented(int r26, int r25, int r24, int r23,
return -ENOSYS; return -ENOSYS;
} }
#ifdef CONFIG_SYSCTL
struct __sysctl_args32 {
u32 name;
int nlen;
u32 oldval;
u32 oldlenp;
u32 newval;
u32 newlen;
u32 __unused[4];
};
asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
{
#ifndef CONFIG_SYSCTL_SYSCALL
return -ENOSYS;
#else
struct __sysctl_args32 tmp;
int error;
unsigned int oldlen32;
size_t oldlen, __user *oldlenp = NULL;
unsigned long addr = (((long __force)&args->__unused[0]) + 7) & ~7;
DBG(("sysctl32(%p)\n", args));
if (copy_from_user(&tmp, args, sizeof(tmp)))
return -EFAULT;
if (tmp.oldval && tmp.oldlenp) {
/* Duh, this is ugly and might not work if sysctl_args
is in read-only memory, but do_sysctl does indirectly
a lot of uaccess in both directions and we'd have to
basically copy the whole sysctl.c here, and
glibc's __sysctl uses rw memory for the structure
anyway. */
/* a possibly better hack than this, which will avoid the
* problem if the struct is read only, is to push the
* 'oldlen' value out to the user's stack instead. -PB
*/
if (get_user(oldlen32, (u32 *)(u64)tmp.oldlenp))
return -EFAULT;
oldlen = oldlen32;
if (put_user(oldlen, (size_t *)addr))
return -EFAULT;
oldlenp = (size_t *)addr;
}
lock_kernel();
error = do_sysctl((int __user *)(u64)tmp.name, tmp.nlen,
(void __user *)(u64)tmp.oldval, oldlenp,
(void __user *)(u64)tmp.newval, tmp.newlen);
unlock_kernel();
if (oldlenp) {
if (!error) {
if (get_user(oldlen, (size_t *)addr)) {
error = -EFAULT;
} else {
oldlen32 = oldlen;
if (put_user(oldlen32, (u32 *)(u64)tmp.oldlenp))
error = -EFAULT;
}
}
if (copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused)))
error = -EFAULT;
}
return error;
#endif
}
#endif /* CONFIG_SYSCTL */
asmlinkage long sys32_sched_rr_get_interval(pid_t pid, asmlinkage long sys32_sched_rr_get_interval(pid_t pid,
struct compat_timespec __user *interval) struct compat_timespec __user *interval)
{ {
......
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
ENTRY_SAME(getsid) ENTRY_SAME(getsid)
ENTRY_SAME(fdatasync) ENTRY_SAME(fdatasync)
/* struct __sysctl_args is a mess */ /* struct __sysctl_args is a mess */
ENTRY_DIFF(sysctl) ENTRY_COMP(sysctl)
ENTRY_SAME(mlock) /* 150 */ ENTRY_SAME(mlock) /* 150 */
ENTRY_SAME(munlock) ENTRY_SAME(munlock)
ENTRY_SAME(mlockall) ENTRY_SAME(mlockall)
......
...@@ -110,18 +110,16 @@ int powersave_nap; ...@@ -110,18 +110,16 @@ int powersave_nap;
*/ */
static ctl_table powersave_nap_ctl_table[]={ static ctl_table powersave_nap_ctl_table[]={
{ {
.ctl_name = KERN_PPC_POWERSAVE_NAP,
.procname = "powersave-nap", .procname = "powersave-nap",
.data = &powersave_nap, .data = &powersave_nap,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
}, },
{} {}
}; };
static ctl_table powersave_nap_sysctl_root[] = { static ctl_table powersave_nap_sysctl_root[] = {
{ {
.ctl_name = CTL_KERN,
.procname = "kernel", .procname = "kernel",
.mode = 0555, .mode = 0555,
.child = powersave_nap_ctl_table, .child = powersave_nap_ctl_table,
......
...@@ -520,58 +520,6 @@ asmlinkage long compat_sys_umask(u32 mask) ...@@ -520,58 +520,6 @@ asmlinkage long compat_sys_umask(u32 mask)
return sys_umask((int)mask); return sys_umask((int)mask);
} }
#ifdef CONFIG_SYSCTL_SYSCALL
struct __sysctl_args32 {
u32 name;
int nlen;
u32 oldval;
u32 oldlenp;
u32 newval;
u32 newlen;
u32 __unused[4];
};
asmlinkage long compat_sys_sysctl(struct __sysctl_args32 __user *args)
{
struct __sysctl_args32 tmp;
int error;
size_t oldlen;
size_t __user *oldlenp = NULL;
unsigned long addr = (((unsigned long)&args->__unused[0]) + 7) & ~7;
if (copy_from_user(&tmp, args, sizeof(tmp)))
return -EFAULT;
if (tmp.oldval && tmp.oldlenp) {
/* Duh, this is ugly and might not work if sysctl_args
is in read-only memory, but do_sysctl does indirectly
a lot of uaccess in both directions and we'd have to
basically copy the whole sysctl.c here, and
glibc's __sysctl uses rw memory for the structure
anyway. */
oldlenp = (size_t __user *)addr;
if (get_user(oldlen, (compat_size_t __user *)compat_ptr(tmp.oldlenp)) ||
put_user(oldlen, oldlenp))
return -EFAULT;
}
lock_kernel();
error = do_sysctl(compat_ptr(tmp.name), tmp.nlen,
compat_ptr(tmp.oldval), oldlenp,
compat_ptr(tmp.newval), tmp.newlen);
unlock_kernel();
if (oldlenp) {
if (!error) {
if (get_user(oldlen, oldlenp) ||
put_user(oldlen, (compat_size_t __user *)compat_ptr(tmp.oldlenp)))
error = -EFAULT;
}
copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused));
}
return error;
}
#endif
unsigned long compat_sys_mmap2(unsigned long addr, size_t len, unsigned long compat_sys_mmap2(unsigned long addr, size_t len,
unsigned long prot, unsigned long flags, unsigned long prot, unsigned long flags,
unsigned long fd, unsigned long pgoff) unsigned long fd, unsigned long pgoff)
......
...@@ -61,12 +61,12 @@ static struct ctl_table appldata_table[] = { ...@@ -61,12 +61,12 @@ static struct ctl_table appldata_table[] = {
{ {
.procname = "timer", .procname = "timer",
.mode = S_IRUGO | S_IWUSR, .mode = S_IRUGO | S_IWUSR,
.proc_handler = &appldata_timer_handler, .proc_handler = appldata_timer_handler,
}, },
{ {
.procname = "interval", .procname = "interval",
.mode = S_IRUGO | S_IWUSR, .mode = S_IRUGO | S_IWUSR,
.proc_handler = &appldata_interval_handler, .proc_handler = appldata_interval_handler,
}, },
{ }, { },
}; };
......
...@@ -527,59 +527,6 @@ asmlinkage long sys32_sendfile64(int out_fd, int in_fd, ...@@ -527,59 +527,6 @@ asmlinkage long sys32_sendfile64(int out_fd, int in_fd,
return ret; return ret;
} }
#ifdef CONFIG_SYSCTL_SYSCALL
struct __sysctl_args32 {
u32 name;
int nlen;
u32 oldval;
u32 oldlenp;
u32 newval;
u32 newlen;
u32 __unused[4];
};
asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
{
struct __sysctl_args32 tmp;
int error;
size_t oldlen;
size_t __user *oldlenp = NULL;
unsigned long addr = (((unsigned long)&args->__unused[0]) + 7) & ~7;
if (copy_from_user(&tmp, args, sizeof(tmp)))
return -EFAULT;
if (tmp.oldval && tmp.oldlenp) {
/* Duh, this is ugly and might not work if sysctl_args
is in read-only memory, but do_sysctl does indirectly
a lot of uaccess in both directions and we'd have to
basically copy the whole sysctl.c here, and
glibc's __sysctl uses rw memory for the structure
anyway. */
if (get_user(oldlen, (u32 __user *)compat_ptr(tmp.oldlenp)) ||
put_user(oldlen, (size_t __user *)addr))
return -EFAULT;
oldlenp = (size_t __user *)addr;
}
lock_kernel();
error = do_sysctl(compat_ptr(tmp.name), tmp.nlen, compat_ptr(tmp.oldval),
oldlenp, compat_ptr(tmp.newval), tmp.newlen);
unlock_kernel();
if (oldlenp) {
if (!error) {
if (get_user(oldlen, (size_t __user *)addr) ||
put_user(oldlen, (u32 __user *)compat_ptr(tmp.oldlenp)))
error = -EFAULT;
}
if (copy_to_user(args->__unused, tmp.__unused,
sizeof(tmp.__unused)))
error = -EFAULT;
}
return error;
}
#endif
struct stat64_emu31 { struct stat64_emu31 {
unsigned long long st_dev; unsigned long long st_dev;
unsigned int __pad1; unsigned int __pad1;
......
...@@ -162,7 +162,6 @@ struct ucontext32 { ...@@ -162,7 +162,6 @@ struct ucontext32 {
compat_sigset_t uc_sigmask; /* mask last for extensibility */ compat_sigset_t uc_sigmask; /* mask last for extensibility */
}; };
struct __sysctl_args32;
struct stat64_emu31; struct stat64_emu31;
struct mmap_arg_struct_emu31; struct mmap_arg_struct_emu31;
struct fadvise64_64_args; struct fadvise64_64_args;
...@@ -212,7 +211,6 @@ long sys32_sendfile(int out_fd, int in_fd, compat_off_t __user *offset, ...@@ -212,7 +211,6 @@ long sys32_sendfile(int out_fd, int in_fd, compat_off_t __user *offset,
size_t count); size_t count);
long sys32_sendfile64(int out_fd, int in_fd, compat_loff_t __user *offset, long sys32_sendfile64(int out_fd, int in_fd, compat_loff_t __user *offset,
s32 count); s32 count);
long sys32_sysctl(struct __sysctl_args32 __user *args);
long sys32_stat64(char __user * filename, struct stat64_emu31 __user * statbuf); long sys32_stat64(char __user * filename, struct stat64_emu31 __user * statbuf);
long sys32_lstat64(char __user * filename, long sys32_lstat64(char __user * filename,
struct stat64_emu31 __user * statbuf); struct stat64_emu31 __user * statbuf);
......
...@@ -689,8 +689,6 @@ sys32_fdatasync_wrapper: ...@@ -689,8 +689,6 @@ sys32_fdatasync_wrapper:
llgfr %r2,%r2 # unsigned int llgfr %r2,%r2 # unsigned int
jg sys_fdatasync # branch to system call jg sys_fdatasync # branch to system call
#sys32_sysctl_wrapper # tbd
.globl sys32_mlock_wrapper .globl sys32_mlock_wrapper
sys32_mlock_wrapper: sys32_mlock_wrapper:
llgfr %r2,%r2 # unsigned long llgfr %r2,%r2 # unsigned long
...@@ -1087,8 +1085,8 @@ sys32_stime_wrapper: ...@@ -1087,8 +1085,8 @@ sys32_stime_wrapper:
.globl sys32_sysctl_wrapper .globl sys32_sysctl_wrapper
sys32_sysctl_wrapper: sys32_sysctl_wrapper:
llgtr %r2,%r2 # struct __sysctl_args32 * llgtr %r2,%r2 # struct compat_sysctl_args *
jg sys32_sysctl jg compat_sys_sysctl
.globl sys32_fstat64_wrapper .globl sys32_fstat64_wrapper
sys32_fstat64_wrapper: sys32_fstat64_wrapper:
......
...@@ -893,35 +893,30 @@ s390dbf_procactive(ctl_table *table, int write, ...@@ -893,35 +893,30 @@ s390dbf_procactive(ctl_table *table, int write,
static struct ctl_table s390dbf_table[] = { static struct ctl_table s390dbf_table[] = {
{ {
.ctl_name = CTL_S390DBF_STOPPABLE,
.procname = "debug_stoppable", .procname = "debug_stoppable",
.data = &debug_stoppable, .data = &debug_stoppable,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = S_IRUGO | S_IWUSR, .mode = S_IRUGO | S_IWUSR,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
.strategy = &sysctl_intvec,
}, },
{ {
.ctl_name = CTL_S390DBF_ACTIVE,
.procname = "debug_active", .procname = "debug_active",
.data = &debug_active, .data = &debug_active,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = S_IRUGO | S_IWUSR, .mode = S_IRUGO | S_IWUSR,
.proc_handler = &s390dbf_procactive, .proc_handler = s390dbf_procactive,
.strategy = &sysctl_intvec,
}, },
{ .ctl_name = 0 } { }
}; };
static struct ctl_table s390dbf_dir_table[] = { static struct ctl_table s390dbf_dir_table[] = {
{ {
.ctl_name = CTL_S390DBF,
.procname = "s390dbf", .procname = "s390dbf",
.maxlen = 0, .maxlen = 0,
.mode = S_IRUGO | S_IXUGO, .mode = S_IRUGO | S_IXUGO,
.child = s390dbf_table, .child = s390dbf_table,
}, },
{ .ctl_name = 0 } { }
}; };
static struct ctl_table_header *s390dbf_sysctl_header; static struct ctl_table_header *s390dbf_sysctl_header;
......
...@@ -343,30 +343,29 @@ static struct ctl_table cmm_table[] = { ...@@ -343,30 +343,29 @@ static struct ctl_table cmm_table[] = {
{ {
.procname = "cmm_pages", .procname = "cmm_pages",
.mode = 0644, .mode = 0644,
.proc_handler = &cmm_pages_handler, .proc_handler = cmm_pages_handler,
}, },
{ {
.procname = "cmm_timed_pages", .procname = "cmm_timed_pages",
.mode = 0644, .mode = 0644,
.proc_handler = &cmm_pages_handler, .proc_handler = cmm_pages_handler,
}, },
{ {
.procname = "cmm_timeout", .procname = "cmm_timeout",
.mode = 0644, .mode = 0644,
.proc_handler = &cmm_timeout_handler, .proc_handler = cmm_timeout_handler,
}, },
{ .ctl_name = 0 } { }
}; };
static struct ctl_table cmm_dir_table[] = { static struct ctl_table cmm_dir_table[] = {
{ {
.ctl_name = CTL_VM,
.procname = "vm", .procname = "vm",
.maxlen = 0, .maxlen = 0,
.mode = 0555, .mode = 0555,
.child = cmm_table, .child = cmm_table,
}, },
{ .ctl_name = 0 } { }
}; };
#endif #endif
......
...@@ -877,44 +877,39 @@ static int misaligned_fixup(struct pt_regs *regs) ...@@ -877,44 +877,39 @@ static int misaligned_fixup(struct pt_regs *regs)
static ctl_table unaligned_table[] = { static ctl_table unaligned_table[] = {
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "kernel_reports", .procname = "kernel_reports",
.data = &kernel_mode_unaligned_fixup_count, .data = &kernel_mode_unaligned_fixup_count,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec .proc_handler = proc_dointvec
}, },
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "user_reports", .procname = "user_reports",
.data = &user_mode_unaligned_fixup_count, .data = &user_mode_unaligned_fixup_count,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec .proc_handler = proc_dointvec
}, },
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "user_enable", .procname = "user_enable",
.data = &user_mode_unaligned_fixup_enable, .data = &user_mode_unaligned_fixup_enable,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec}, .proc_handler = proc_dointvec},
{} {}
}; };
static ctl_table unaligned_root[] = { static ctl_table unaligned_root[] = {
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "unaligned_fixup", .procname = "unaligned_fixup",
.mode = 0555, .mode = 0555,
unaligned_table .child = unaligned_table
}, },
{} {}
}; };
static ctl_table sh64_root[] = { static ctl_table sh64_root[] = {
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "sh64", .procname = "sh64",
.mode = 0555, .mode = 0555,
.child = unaligned_root .child = unaligned_root
......
...@@ -591,63 +591,6 @@ asmlinkage unsigned long sys32_mremap(unsigned long addr, ...@@ -591,63 +591,6 @@ asmlinkage unsigned long sys32_mremap(unsigned long addr,
return ret; return ret;
} }
struct __sysctl_args32 {
u32 name;
int nlen;
u32 oldval;
u32 oldlenp;
u32 newval;
u32 newlen;
u32 __unused[4];
};
asmlinkage long sys32_sysctl(struct __sysctl_args32 __user *args)
{
#ifndef CONFIG_SYSCTL_SYSCALL
return -ENOSYS;
#else
struct __sysctl_args32 tmp;
int error;
size_t oldlen, __user *oldlenp = NULL;
unsigned long addr = (((unsigned long)&args->__unused[0]) + 7UL) & ~7UL;
if (copy_from_user(&tmp, args, sizeof(tmp)))
return -EFAULT;
if (tmp.oldval && tmp.oldlenp) {
/* Duh, this is ugly and might not work if sysctl_args
is in read-only memory, but do_sysctl does indirectly
a lot of uaccess in both directions and we'd have to
basically copy the whole sysctl.c here, and
glibc's __sysctl uses rw memory for the structure
anyway. */
if (get_user(oldlen, (u32 __user *)(unsigned long)tmp.oldlenp) ||
put_user(oldlen, (size_t __user *)addr))
return -EFAULT;
oldlenp = (size_t __user *)addr;
}
lock_kernel();
error = do_sysctl((int __user *)(unsigned long) tmp.name,
tmp.nlen,
(void __user *)(unsigned long) tmp.oldval,
oldlenp,
(void __user *)(unsigned long) tmp.newval,
tmp.newlen);
unlock_kernel();
if (oldlenp) {
if (!error) {
if (get_user(oldlen, (size_t __user *)addr) ||
put_user(oldlen, (u32 __user *)(unsigned long) tmp.oldlenp))
error = -EFAULT;
}
if (copy_to_user(args->__unused, tmp.__unused, sizeof(tmp.__unused)))
error = -EFAULT;
}
return error;
#endif
}
long sys32_lookup_dcookie(unsigned long cookie_high, long sys32_lookup_dcookie(unsigned long cookie_high,
unsigned long cookie_low, unsigned long cookie_low,
char __user *buf, size_t len) char __user *buf, size_t len)
......
...@@ -68,7 +68,7 @@ sys_call_table32: ...@@ -68,7 +68,7 @@ sys_call_table32:
.word compat_sys_fstatfs64, sys_llseek, sys_mlock, sys_munlock, sys32_mlockall .word compat_sys_fstatfs64, sys_llseek, sys_mlock, sys_munlock, sys32_mlockall
/*240*/ .word sys_munlockall, sys32_sched_setparam, sys32_sched_getparam, sys32_sched_setscheduler, sys32_sched_getscheduler /*240*/ .word sys_munlockall, sys32_sched_setparam, sys32_sched_getparam, sys32_sched_setscheduler, sys32_sched_getscheduler
.word sys_sched_yield, sys32_sched_get_priority_max, sys32_sched_get_priority_min, sys32_sched_rr_get_interval, compat_sys_nanosleep .word sys_sched_yield, sys32_sched_get_priority_max, sys32_sched_get_priority_min, sys32_sched_rr_get_interval, compat_sys_nanosleep
/*250*/ .word sys32_mremap, sys32_sysctl, sys32_getsid, sys_fdatasync, sys32_nfsservctl /*250*/ .word sys32_mremap, compat_sys_sysctl, sys32_getsid, sys_fdatasync, sys32_nfsservctl
.word sys32_sync_file_range, compat_sys_clock_settime, compat_sys_clock_gettime, compat_sys_clock_getres, sys32_clock_nanosleep .word sys32_sync_file_range, compat_sys_clock_settime, compat_sys_clock_gettime, compat_sys_clock_getres, sys32_clock_nanosleep
/*260*/ .word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, sys32_timer_settime, compat_sys_timer_gettime, sys_timer_getoverrun /*260*/ .word compat_sys_sched_getaffinity, compat_sys_sched_setaffinity, sys32_timer_settime, compat_sys_timer_gettime, sys_timer_getoverrun
.word sys_timer_delete, compat_sys_timer_create, sys_ni_syscall, compat_sys_io_setup, sys_io_destroy .word sys_timer_delete, compat_sys_timer_create, sys_ni_syscall, compat_sys_io_setup, sys_io_destroy
......
...@@ -653,7 +653,7 @@ ia32_sys_call_table: ...@@ -653,7 +653,7 @@ ia32_sys_call_table:
.quad compat_sys_writev .quad compat_sys_writev
.quad sys_getsid .quad sys_getsid
.quad sys_fdatasync .quad sys_fdatasync
.quad sys32_sysctl /* sysctl */ .quad compat_sys_sysctl /* sysctl */
.quad sys_mlock /* 150 */ .quad sys_mlock /* 150 */
.quad sys_munlock .quad sys_munlock
.quad sys_mlockall .quad sys_mlockall
......
...@@ -434,62 +434,6 @@ asmlinkage long sys32_rt_sigqueueinfo(int pid, int sig, ...@@ -434,62 +434,6 @@ asmlinkage long sys32_rt_sigqueueinfo(int pid, int sig,
return ret; return ret;
} }
#ifdef CONFIG_SYSCTL_SYSCALL
struct sysctl_ia32 {
unsigned int name;
int nlen;
unsigned int oldval;
unsigned int oldlenp;
unsigned int newval;
unsigned int newlen;
unsigned int __unused[4];
};
asmlinkage long sys32_sysctl(struct sysctl_ia32 __user *args32)
{
struct sysctl_ia32 a32;
mm_segment_t old_fs = get_fs();
void __user *oldvalp, *newvalp;
size_t oldlen;
int __user *namep;
long ret;
if (copy_from_user(&a32, args32, sizeof(a32)))
return -EFAULT;
/*
* We need to pre-validate these because we have to disable
* address checking before calling do_sysctl() because of
* OLDLEN but we can't run the risk of the user specifying bad
* addresses here. Well, since we're dealing with 32 bit
* addresses, we KNOW that access_ok() will always succeed, so
* this is an expensive NOP, but so what...
*/
namep = compat_ptr(a32.name);
oldvalp = compat_ptr(a32.oldval);
newvalp = compat_ptr(a32.newval);
if ((oldvalp && get_user(oldlen, (int __user *)compat_ptr(a32.oldlenp)))
|| !access_ok(VERIFY_WRITE, namep, 0)
|| !access_ok(VERIFY_WRITE, oldvalp, 0)
|| !access_ok(VERIFY_WRITE, newvalp, 0))
return -EFAULT;
set_fs(KERNEL_DS);
lock_kernel();
ret = do_sysctl(namep, a32.nlen, oldvalp, (size_t __user *)&oldlen,
newvalp, (size_t) a32.newlen);
unlock_kernel();
set_fs(old_fs);
if (oldvalp && put_user(oldlen, (int __user *)compat_ptr(a32.oldlenp)))
return -EFAULT;
return ret;
}
#endif
/* warning: next two assume little endian */ /* warning: next two assume little endian */
asmlinkage long sys32_pread(unsigned int fd, char __user *ubuf, u32 count, asmlinkage long sys32_pread(unsigned int fd, char __user *ubuf, u32 count,
u32 poslo, u32 poshi) u32 poslo, u32 poshi)
......
...@@ -51,11 +51,6 @@ asmlinkage long sys32_sched_rr_get_interval(compat_pid_t, ...@@ -51,11 +51,6 @@ asmlinkage long sys32_sched_rr_get_interval(compat_pid_t,
asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *, compat_size_t); asmlinkage long sys32_rt_sigpending(compat_sigset_t __user *, compat_size_t);
asmlinkage long sys32_rt_sigqueueinfo(int, int, compat_siginfo_t __user *); asmlinkage long sys32_rt_sigqueueinfo(int, int, compat_siginfo_t __user *);
#ifdef CONFIG_SYSCTL_SYSCALL
struct sysctl_ia32;
asmlinkage long sys32_sysctl(struct sysctl_ia32 __user *);
#endif
asmlinkage long sys32_pread(unsigned int, char __user *, u32, u32, u32); asmlinkage long sys32_pread(unsigned int, char __user *, u32, u32, u32);
asmlinkage long sys32_pwrite(unsigned int, char __user *, u32, u32, u32); asmlinkage long sys32_pwrite(unsigned int, char __user *, u32, u32, u32);
......
...@@ -237,7 +237,7 @@ static ctl_table kernel_table2[] = { ...@@ -237,7 +237,7 @@ static ctl_table kernel_table2[] = {
}; };
static ctl_table kernel_root_table2[] = { static ctl_table kernel_root_table2[] = {
{ .ctl_name = CTL_KERN, .procname = "kernel", .mode = 0555, { .procname = "kernel", .mode = 0555,
.child = kernel_table2 }, .child = kernel_table2 },
{} {}
}; };
......
...@@ -393,7 +393,6 @@ static ctl_table abi_table2[] = { ...@@ -393,7 +393,6 @@ static ctl_table abi_table2[] = {
static ctl_table abi_root_table2[] = { static ctl_table abi_root_table2[] = {
{ {
.ctl_name = CTL_ABI,
.procname = "abi", .procname = "abi",
.mode = 0555, .mode = 0555,
.child = abi_table2 .child = abi_table2
......
...@@ -25,28 +25,22 @@ ...@@ -25,28 +25,22 @@
#ifdef CONFIG_CRYPTO_FIPS #ifdef CONFIG_CRYPTO_FIPS
static struct ctl_table crypto_sysctl_table[] = { static struct ctl_table crypto_sysctl_table[] = {
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "fips_enabled", .procname = "fips_enabled",
.data = &fips_enabled, .data = &fips_enabled,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0444, .mode = 0444,
.proc_handler = &proc_dointvec .proc_handler = proc_dointvec
},
{
.ctl_name = 0,
}, },
{}
}; };
static struct ctl_table crypto_dir_table[] = { static struct ctl_table crypto_dir_table[] = {
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "crypto", .procname = "crypto",
.mode = 0555, .mode = 0555,
.child = crypto_sysctl_table .child = crypto_sysctl_table
}, },
{ {}
.ctl_name = 0,
},
}; };
static struct ctl_table_header *crypto_sysctls; static struct ctl_table_header *crypto_sysctls;
......
...@@ -3557,67 +3557,65 @@ static ctl_table cdrom_table[] = { ...@@ -3557,67 +3557,65 @@ static ctl_table cdrom_table[] = {
.data = &cdrom_sysctl_settings.info, .data = &cdrom_sysctl_settings.info,
.maxlen = CDROM_STR_SIZE, .maxlen = CDROM_STR_SIZE,
.mode = 0444, .mode = 0444,
.proc_handler = &cdrom_sysctl_info, .proc_handler = cdrom_sysctl_info,
}, },
{ {
.procname = "autoclose", .procname = "autoclose",
.data = &cdrom_sysctl_settings.autoclose, .data = &cdrom_sysctl_settings.autoclose,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &cdrom_sysctl_handler, .proc_handler = cdrom_sysctl_handler,
}, },
{ {
.procname = "autoeject", .procname = "autoeject",
.data = &cdrom_sysctl_settings.autoeject, .data = &cdrom_sysctl_settings.autoeject,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &cdrom_sysctl_handler, .proc_handler = cdrom_sysctl_handler,
}, },
{ {
.procname = "debug", .procname = "debug",
.data = &cdrom_sysctl_settings.debug, .data = &cdrom_sysctl_settings.debug,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &cdrom_sysctl_handler, .proc_handler = cdrom_sysctl_handler,
}, },
{ {
.procname = "lock", .procname = "lock",
.data = &cdrom_sysctl_settings.lock, .data = &cdrom_sysctl_settings.lock,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &cdrom_sysctl_handler, .proc_handler = cdrom_sysctl_handler,
}, },
{ {
.procname = "check_media", .procname = "check_media",
.data = &cdrom_sysctl_settings.check, .data = &cdrom_sysctl_settings.check,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &cdrom_sysctl_handler .proc_handler = cdrom_sysctl_handler
}, },
{ .ctl_name = 0 } { }
}; };
static ctl_table cdrom_cdrom_table[] = { static ctl_table cdrom_cdrom_table[] = {
{ {
.ctl_name = DEV_CDROM,
.procname = "cdrom", .procname = "cdrom",
.maxlen = 0, .maxlen = 0,
.mode = 0555, .mode = 0555,
.child = cdrom_table, .child = cdrom_table,
}, },
{ .ctl_name = 0 } { }
}; };
/* Make sure that /proc/sys/dev is there */ /* Make sure that /proc/sys/dev is there */
static ctl_table cdrom_root_table[] = { static ctl_table cdrom_root_table[] = {
{ {
.ctl_name = CTL_DEV,
.procname = "dev", .procname = "dev",
.maxlen = 0, .maxlen = 0,
.mode = 0555, .mode = 0555,
.child = cdrom_cdrom_table, .child = cdrom_cdrom_table,
}, },
{ .ctl_name = 0 } { }
}; };
static struct ctl_table_header *cdrom_sysctl_header; static struct ctl_table_header *cdrom_sysctl_header;
......
...@@ -675,36 +675,33 @@ static int hpet_is_known(struct hpet_data *hdp) ...@@ -675,36 +675,33 @@ static int hpet_is_known(struct hpet_data *hdp)
static ctl_table hpet_table[] = { static ctl_table hpet_table[] = {
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "max-user-freq", .procname = "max-user-freq",
.data = &hpet_max_freq, .data = &hpet_max_freq,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
}, },
{.ctl_name = 0} {}
}; };
static ctl_table hpet_root[] = { static ctl_table hpet_root[] = {
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "hpet", .procname = "hpet",
.maxlen = 0, .maxlen = 0,
.mode = 0555, .mode = 0555,
.child = hpet_table, .child = hpet_table,
}, },
{.ctl_name = 0} {}
}; };
static ctl_table dev_root[] = { static ctl_table dev_root[] = {
{ {
.ctl_name = CTL_DEV,
.procname = "dev", .procname = "dev",
.maxlen = 0, .maxlen = 0,
.mode = 0555, .mode = 0555,
.child = hpet_root, .child = hpet_root,
}, },
{.ctl_name = 0} {}
}; };
static struct ctl_table_header *sysctl_header; static struct ctl_table_header *sysctl_header;
......
...@@ -660,26 +660,23 @@ static struct ipmi_smi_watcher smi_watcher = { ...@@ -660,26 +660,23 @@ static struct ipmi_smi_watcher smi_watcher = {
#include <linux/sysctl.h> #include <linux/sysctl.h>
static ctl_table ipmi_table[] = { static ctl_table ipmi_table[] = {
{ .ctl_name = DEV_IPMI_POWEROFF_POWERCYCLE, { .procname = "poweroff_powercycle",
.procname = "poweroff_powercycle",
.data = &poweroff_powercycle, .data = &poweroff_powercycle,
.maxlen = sizeof(poweroff_powercycle), .maxlen = sizeof(poweroff_powercycle),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec }, .proc_handler = proc_dointvec },
{ } { }
}; };
static ctl_table ipmi_dir_table[] = { static ctl_table ipmi_dir_table[] = {
{ .ctl_name = DEV_IPMI, { .procname = "ipmi",
.procname = "ipmi",
.mode = 0555, .mode = 0555,
.child = ipmi_table }, .child = ipmi_table },
{ } { }
}; };
static ctl_table ipmi_root_table[] = { static ctl_table ipmi_root_table[] = {
{ .ctl_name = CTL_DEV, { .procname = "dev",
.procname = "dev",
.mode = 0555, .mode = 0555,
.child = ipmi_dir_table }, .child = ipmi_dir_table },
{ } { }
......
...@@ -431,30 +431,25 @@ static struct cdev ptmx_cdev; ...@@ -431,30 +431,25 @@ static struct cdev ptmx_cdev;
static struct ctl_table pty_table[] = { static struct ctl_table pty_table[] = {
{ {
.ctl_name = PTY_MAX,
.procname = "max", .procname = "max",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.data = &pty_limit, .data = &pty_limit,
.proc_handler = &proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &pty_limit_min, .extra1 = &pty_limit_min,
.extra2 = &pty_limit_max, .extra2 = &pty_limit_max,
}, { }, {
.ctl_name = PTY_NR,
.procname = "nr", .procname = "nr",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0444, .mode = 0444,
.data = &pty_count, .data = &pty_count,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
}, { },
.ctl_name = 0 {}
}
}; };
static struct ctl_table pty_kern_table[] = { static struct ctl_table pty_kern_table[] = {
{ {
.ctl_name = KERN_PTY,
.procname = "pty", .procname = "pty",
.mode = 0555, .mode = 0555,
.child = pty_table, .child = pty_table,
...@@ -464,7 +459,6 @@ static struct ctl_table pty_kern_table[] = { ...@@ -464,7 +459,6 @@ static struct ctl_table pty_kern_table[] = {
static struct ctl_table pty_root_table[] = { static struct ctl_table pty_root_table[] = {
{ {
.ctl_name = CTL_KERN,
.procname = "kernel", .procname = "kernel",
.mode = 0555, .mode = 0555,
.child = pty_kern_table, .child = pty_kern_table,
......
...@@ -1257,94 +1257,54 @@ static int proc_do_uuid(ctl_table *table, int write, ...@@ -1257,94 +1257,54 @@ static int proc_do_uuid(ctl_table *table, int write,
return proc_dostring(&fake_table, write, buffer, lenp, ppos); return proc_dostring(&fake_table, write, buffer, lenp, ppos);
} }
static int uuid_strategy(ctl_table *table,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
unsigned char tmp_uuid[16], *uuid;
unsigned int len;
if (!oldval || !oldlenp)
return 1;
uuid = table->data;
if (!uuid) {
uuid = tmp_uuid;
uuid[8] = 0;
}
if (uuid[8] == 0)
generate_random_uuid(uuid);
if (get_user(len, oldlenp))
return -EFAULT;
if (len) {
if (len > 16)
len = 16;
if (copy_to_user(oldval, uuid, len) ||
put_user(len, oldlenp))
return -EFAULT;
}
return 1;
}
static int sysctl_poolsize = INPUT_POOL_WORDS * 32; static int sysctl_poolsize = INPUT_POOL_WORDS * 32;
ctl_table random_table[] = { ctl_table random_table[] = {
{ {
.ctl_name = RANDOM_POOLSIZE,
.procname = "poolsize", .procname = "poolsize",
.data = &sysctl_poolsize, .data = &sysctl_poolsize,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0444, .mode = 0444,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ {
.ctl_name = RANDOM_ENTROPY_COUNT,
.procname = "entropy_avail", .procname = "entropy_avail",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0444, .mode = 0444,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
.data = &input_pool.entropy_count, .data = &input_pool.entropy_count,
}, },
{ {
.ctl_name = RANDOM_READ_THRESH,
.procname = "read_wakeup_threshold", .procname = "read_wakeup_threshold",
.data = &random_read_wakeup_thresh, .data = &random_read_wakeup_thresh,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &min_read_thresh, .extra1 = &min_read_thresh,
.extra2 = &max_read_thresh, .extra2 = &max_read_thresh,
}, },
{ {
.ctl_name = RANDOM_WRITE_THRESH,
.procname = "write_wakeup_threshold", .procname = "write_wakeup_threshold",
.data = &random_write_wakeup_thresh, .data = &random_write_wakeup_thresh,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &min_write_thresh, .extra1 = &min_write_thresh,
.extra2 = &max_write_thresh, .extra2 = &max_write_thresh,
}, },
{ {
.ctl_name = RANDOM_BOOT_ID,
.procname = "boot_id", .procname = "boot_id",
.data = &sysctl_bootid, .data = &sysctl_bootid,
.maxlen = 16, .maxlen = 16,
.mode = 0444, .mode = 0444,
.proc_handler = &proc_do_uuid, .proc_handler = proc_do_uuid,
.strategy = &uuid_strategy,
}, },
{ {
.ctl_name = RANDOM_UUID,
.procname = "uuid", .procname = "uuid",
.maxlen = 16, .maxlen = 16,
.mode = 0444, .mode = 0444,
.proc_handler = &proc_do_uuid, .proc_handler = proc_do_uuid,
.strategy = &uuid_strategy,
}, },
{ .ctl_name = 0 } { }
}; };
#endif /* CONFIG_SYSCTL */ #endif /* CONFIG_SYSCTL */
......
...@@ -282,34 +282,31 @@ static irqreturn_t rtc_interrupt(int irq, void *dev_id) ...@@ -282,34 +282,31 @@ static irqreturn_t rtc_interrupt(int irq, void *dev_id)
*/ */
static ctl_table rtc_table[] = { static ctl_table rtc_table[] = {
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "max-user-freq", .procname = "max-user-freq",
.data = &rtc_max_user_freq, .data = &rtc_max_user_freq,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ .ctl_name = 0 } { }
}; };
static ctl_table rtc_root[] = { static ctl_table rtc_root[] = {
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "rtc", .procname = "rtc",
.mode = 0555, .mode = 0555,
.child = rtc_table, .child = rtc_table,
}, },
{ .ctl_name = 0 } { }
}; };
static ctl_table dev_root[] = { static ctl_table dev_root[] = {
{ {
.ctl_name = CTL_DEV,
.procname = "dev", .procname = "dev",
.mode = 0555, .mode = 0555,
.child = rtc_root, .child = rtc_root,
}, },
{ .ctl_name = 0 } { }
}; };
static struct ctl_table_header *sysctl_header; static struct ctl_table_header *sysctl_header;
......
...@@ -27,54 +27,49 @@ static int mouse_last_keycode; ...@@ -27,54 +27,49 @@ static int mouse_last_keycode;
/* file(s) in /proc/sys/dev/mac_hid */ /* file(s) in /proc/sys/dev/mac_hid */
static ctl_table mac_hid_files[] = { static ctl_table mac_hid_files[] = {
{ {
.ctl_name = DEV_MAC_HID_MOUSE_BUTTON_EMULATION,
.procname = "mouse_button_emulation", .procname = "mouse_button_emulation",
.data = &mouse_emulate_buttons, .data = &mouse_emulate_buttons,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ {
.ctl_name = DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE,
.procname = "mouse_button2_keycode", .procname = "mouse_button2_keycode",
.data = &mouse_button2_keycode, .data = &mouse_button2_keycode,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ {
.ctl_name = DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE,
.procname = "mouse_button3_keycode", .procname = "mouse_button3_keycode",
.data = &mouse_button3_keycode, .data = &mouse_button3_keycode,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ .ctl_name = 0 } { }
}; };
/* dir in /proc/sys/dev */ /* dir in /proc/sys/dev */
static ctl_table mac_hid_dir[] = { static ctl_table mac_hid_dir[] = {
{ {
.ctl_name = DEV_MAC_HID,
.procname = "mac_hid", .procname = "mac_hid",
.maxlen = 0, .maxlen = 0,
.mode = 0555, .mode = 0555,
.child = mac_hid_files, .child = mac_hid_files,
}, },
{ .ctl_name = 0 } { }
}; };
/* /proc/sys/dev itself, in case that is not there yet */ /* /proc/sys/dev itself, in case that is not there yet */
static ctl_table mac_hid_root_dir[] = { static ctl_table mac_hid_root_dir[] = {
{ {
.ctl_name = CTL_DEV,
.procname = "dev", .procname = "dev",
.maxlen = 0, .maxlen = 0,
.mode = 0555, .mode = 0555,
.child = mac_hid_dir, .child = mac_hid_dir,
}, },
{ .ctl_name = 0 } { }
}; };
static struct ctl_table_header *mac_hid_sysctl_header; static struct ctl_table_header *mac_hid_sysctl_header;
......
...@@ -98,44 +98,40 @@ static struct ctl_table_header *raid_table_header; ...@@ -98,44 +98,40 @@ static struct ctl_table_header *raid_table_header;
static ctl_table raid_table[] = { static ctl_table raid_table[] = {
{ {
.ctl_name = DEV_RAID_SPEED_LIMIT_MIN,
.procname = "speed_limit_min", .procname = "speed_limit_min",
.data = &sysctl_speed_limit_min, .data = &sysctl_speed_limit_min,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = S_IRUGO|S_IWUSR, .mode = S_IRUGO|S_IWUSR,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ {
.ctl_name = DEV_RAID_SPEED_LIMIT_MAX,
.procname = "speed_limit_max", .procname = "speed_limit_max",
.data = &sysctl_speed_limit_max, .data = &sysctl_speed_limit_max,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = S_IRUGO|S_IWUSR, .mode = S_IRUGO|S_IWUSR,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ .ctl_name = 0 } { }
}; };
static ctl_table raid_dir_table[] = { static ctl_table raid_dir_table[] = {
{ {
.ctl_name = DEV_RAID,
.procname = "raid", .procname = "raid",
.maxlen = 0, .maxlen = 0,
.mode = S_IRUGO|S_IXUGO, .mode = S_IRUGO|S_IXUGO,
.child = raid_table, .child = raid_table,
}, },
{ .ctl_name = 0 } { }
}; };
static ctl_table raid_root_table[] = { static ctl_table raid_root_table[] = {
{ {
.ctl_name = CTL_DEV,
.procname = "dev", .procname = "dev",
.maxlen = 0, .maxlen = 0,
.mode = 0555, .mode = 0555,
.child = raid_dir_table, .child = raid_dir_table,
}, },
{ .ctl_name = 0 } { }
}; };
static const struct block_device_operations md_fops; static const struct block_device_operations md_fops;
......
...@@ -89,48 +89,40 @@ static int xpc_disengage_max_timelimit = 120; ...@@ -89,48 +89,40 @@ static int xpc_disengage_max_timelimit = 120;
static ctl_table xpc_sys_xpc_hb_dir[] = { static ctl_table xpc_sys_xpc_hb_dir[] = {
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "hb_interval", .procname = "hb_interval",
.data = &xpc_hb_interval, .data = &xpc_hb_interval,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &xpc_hb_min_interval, .extra1 = &xpc_hb_min_interval,
.extra2 = &xpc_hb_max_interval}, .extra2 = &xpc_hb_max_interval},
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "hb_check_interval", .procname = "hb_check_interval",
.data = &xpc_hb_check_interval, .data = &xpc_hb_check_interval,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &xpc_hb_check_min_interval, .extra1 = &xpc_hb_check_min_interval,
.extra2 = &xpc_hb_check_max_interval}, .extra2 = &xpc_hb_check_max_interval},
{} {}
}; };
static ctl_table xpc_sys_xpc_dir[] = { static ctl_table xpc_sys_xpc_dir[] = {
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "hb", .procname = "hb",
.mode = 0555, .mode = 0555,
.child = xpc_sys_xpc_hb_dir}, .child = xpc_sys_xpc_hb_dir},
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "disengage_timelimit", .procname = "disengage_timelimit",
.data = &xpc_disengage_timelimit, .data = &xpc_disengage_timelimit,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &xpc_disengage_min_timelimit, .extra1 = &xpc_disengage_min_timelimit,
.extra2 = &xpc_disengage_max_timelimit}, .extra2 = &xpc_disengage_max_timelimit},
{} {}
}; };
static ctl_table xpc_sys_dir[] = { static ctl_table xpc_sys_dir[] = {
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "xpc", .procname = "xpc",
.mode = 0555, .mode = 0555,
.child = xpc_sys_xpc_dir}, .child = xpc_sys_xpc_dir},
......
...@@ -816,84 +816,83 @@ static int arlan_sysctl_reset(ctl_table * ctl, int write, ...@@ -816,84 +816,83 @@ static int arlan_sysctl_reset(ctl_table * ctl, int write,
/* Place files in /proc/sys/dev/arlan */ /* Place files in /proc/sys/dev/arlan */
#define CTBLN(num,card,nam) \ #define CTBLN(card,nam) \
{ .ctl_name = num,\ { .procname = #nam,\
.procname = #nam,\
.data = &(arlan_conf[card].nam),\ .data = &(arlan_conf[card].nam),\
.maxlen = sizeof(int), .mode = 0600, .proc_handler = &proc_dointvec} .maxlen = sizeof(int), .mode = 0600, .proc_handler = proc_dointvec}
#ifdef ARLAN_DEBUGGING #ifdef ARLAN_DEBUGGING
#define ARLAN_PROC_DEBUG_ENTRIES \ #define ARLAN_PROC_DEBUG_ENTRIES \
{ .ctl_name = 48, .procname = "entry_exit_debug",\ { .procname = "entry_exit_debug",\
.data = &arlan_entry_and_exit_debug,\ .data = &arlan_entry_and_exit_debug,\
.maxlen = sizeof(int), .mode = 0600, .proc_handler = &proc_dointvec},\ .maxlen = sizeof(int), .mode = 0600, .proc_handler = proc_dointvec},\
{ .ctl_name = 49, .procname = "debug", .data = &arlan_debug,\ { .procname = "debug", .data = &arlan_debug,\
.maxlen = sizeof(int), .mode = 0600, .proc_handler = &proc_dointvec}, .maxlen = sizeof(int), .mode = 0600, .proc_handler = proc_dointvec},
#else #else
#define ARLAN_PROC_DEBUG_ENTRIES #define ARLAN_PROC_DEBUG_ENTRIES
#endif #endif
#define ARLAN_SYSCTL_TABLE_TOTAL(cardNo)\ #define ARLAN_SYSCTL_TABLE_TOTAL(cardNo)\
CTBLN(1,cardNo,spreadingCode),\ CTBLN(cardNo,spreadingCode),\
CTBLN(2,cardNo, channelNumber),\ CTBLN(cardNo, channelNumber),\
CTBLN(3,cardNo, scramblingDisable),\ CTBLN(cardNo, scramblingDisable),\
CTBLN(4,cardNo, txAttenuation),\ CTBLN(cardNo, txAttenuation),\
CTBLN(5,cardNo, systemId), \ CTBLN(cardNo, systemId), \
CTBLN(6,cardNo, maxDatagramSize),\ CTBLN(cardNo, maxDatagramSize),\
CTBLN(7,cardNo, maxFrameSize),\ CTBLN(cardNo, maxFrameSize),\
CTBLN(8,cardNo, maxRetries),\ CTBLN(cardNo, maxRetries),\
CTBLN(9,cardNo, receiveMode),\ CTBLN(cardNo, receiveMode),\
CTBLN(10,cardNo, priority),\ CTBLN(cardNo, priority),\
CTBLN(11,cardNo, rootOrRepeater),\ CTBLN(cardNo, rootOrRepeater),\
CTBLN(12,cardNo, SID),\ CTBLN(cardNo, SID),\
CTBLN(13,cardNo, registrationMode),\ CTBLN(cardNo, registrationMode),\
CTBLN(14,cardNo, registrationFill),\ CTBLN(cardNo, registrationFill),\
CTBLN(15,cardNo, localTalkAddress),\ CTBLN(cardNo, localTalkAddress),\
CTBLN(16,cardNo, codeFormat),\ CTBLN(cardNo, codeFormat),\
CTBLN(17,cardNo, numChannels),\ CTBLN(cardNo, numChannels),\
CTBLN(18,cardNo, channel1),\ CTBLN(cardNo, channel1),\
CTBLN(19,cardNo, channel2),\ CTBLN(cardNo, channel2),\
CTBLN(20,cardNo, channel3),\ CTBLN(cardNo, channel3),\
CTBLN(21,cardNo, channel4),\ CTBLN(cardNo, channel4),\
CTBLN(22,cardNo, txClear),\ CTBLN(cardNo, txClear),\
CTBLN(23,cardNo, txRetries),\ CTBLN(cardNo, txRetries),\
CTBLN(24,cardNo, txRouting),\ CTBLN(cardNo, txRouting),\
CTBLN(25,cardNo, txScrambled),\ CTBLN(cardNo, txScrambled),\
CTBLN(26,cardNo, rxParameter),\ CTBLN(cardNo, rxParameter),\
CTBLN(27,cardNo, txTimeoutMs),\ CTBLN(cardNo, txTimeoutMs),\
CTBLN(28,cardNo, waitCardTimeout),\ CTBLN(cardNo, waitCardTimeout),\
CTBLN(29,cardNo, channelSet), \ CTBLN(cardNo, channelSet), \
{.ctl_name = 30, .procname = "name",\ { .procname = "name",\
.data = arlan_conf[cardNo].siteName,\ .data = arlan_conf[cardNo].siteName,\
.maxlen = 16, .mode = 0600, .proc_handler = &proc_dostring},\ .maxlen = 16, .mode = 0600, .proc_handler = proc_dostring},\
CTBLN(31,cardNo,waitTime),\ CTBLN(cardNo,waitTime),\
CTBLN(32,cardNo,lParameter),\ CTBLN(cardNo,lParameter),\
CTBLN(33,cardNo,_15),\ CTBLN(cardNo,_15),\
CTBLN(34,cardNo,headerSize),\ CTBLN(cardNo,headerSize),\
CTBLN(36,cardNo,tx_delay_ms),\ CTBLN(cardNo,tx_delay_ms),\
CTBLN(37,cardNo,retries),\ CTBLN(cardNo,retries),\
CTBLN(38,cardNo,ReTransmitPacketMaxSize),\ CTBLN(cardNo,ReTransmitPacketMaxSize),\
CTBLN(39,cardNo,waitReTransmitPacketMaxSize),\ CTBLN(cardNo,waitReTransmitPacketMaxSize),\
CTBLN(40,cardNo,fastReTransCount),\ CTBLN(cardNo,fastReTransCount),\
CTBLN(41,cardNo,driverRetransmissions),\ CTBLN(cardNo,driverRetransmissions),\
CTBLN(42,cardNo,txAckTimeoutMs),\ CTBLN(cardNo,txAckTimeoutMs),\
CTBLN(43,cardNo,registrationInterrupts),\ CTBLN(cardNo,registrationInterrupts),\
CTBLN(44,cardNo,hardwareType),\ CTBLN(cardNo,hardwareType),\
CTBLN(45,cardNo,radioType),\ CTBLN(cardNo,radioType),\
CTBLN(46,cardNo,writeEEPROM),\ CTBLN(cardNo,writeEEPROM),\
CTBLN(47,cardNo,writeRadioType),\ CTBLN(cardNo,writeRadioType),\
ARLAN_PROC_DEBUG_ENTRIES\ ARLAN_PROC_DEBUG_ENTRIES\
CTBLN(50,cardNo,in_speed),\ CTBLN(cardNo,in_speed),\
CTBLN(51,cardNo,out_speed),\ CTBLN(cardNo,out_speed),\
CTBLN(52,cardNo,in_speed10),\ CTBLN(cardNo,in_speed10),\
CTBLN(53,cardNo,out_speed10),\ CTBLN(cardNo,out_speed10),\
CTBLN(54,cardNo,in_speed_max),\ CTBLN(cardNo,in_speed_max),\
CTBLN(55,cardNo,out_speed_max),\ CTBLN(cardNo,out_speed_max),\
CTBLN(56,cardNo,measure_rate),\ CTBLN(cardNo,measure_rate),\
CTBLN(57,cardNo,pre_Command_Wait),\ CTBLN(cardNo,pre_Command_Wait),\
CTBLN(58,cardNo,rx_tweak1),\ CTBLN(cardNo,rx_tweak1),\
CTBLN(59,cardNo,rx_tweak2),\ CTBLN(cardNo,rx_tweak2),\
CTBLN(60,cardNo,tx_queue_len),\ CTBLN(cardNo,tx_queue_len),\
...@@ -903,63 +902,56 @@ static ctl_table arlan_conf_table0[] = ...@@ -903,63 +902,56 @@ static ctl_table arlan_conf_table0[] =
#ifdef ARLAN_PROC_SHM_DUMP #ifdef ARLAN_PROC_SHM_DUMP
{ {
.ctl_name = 150,
.procname = "arlan0-txRing", .procname = "arlan0-txRing",
.data = &arlan_drive_info, .data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE, .maxlen = ARLAN_STR_SIZE,
.mode = 0400, .mode = 0400,
.proc_handler = &arlan_sysctl_infotxRing, .proc_handler = arlan_sysctl_infotxRing,
}, },
{ {
.ctl_name = 151,
.procname = "arlan0-rxRing", .procname = "arlan0-rxRing",
.data = &arlan_drive_info, .data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE, .maxlen = ARLAN_STR_SIZE,
.mode = 0400, .mode = 0400,
.proc_handler = &arlan_sysctl_inforxRing, .proc_handler = arlan_sysctl_inforxRing,
}, },
{ {
.ctl_name = 152,
.procname = "arlan0-18", .procname = "arlan0-18",
.data = &arlan_drive_info, .data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE, .maxlen = ARLAN_STR_SIZE,
.mode = 0400, .mode = 0400,
.proc_handler = &arlan_sysctl_info18, .proc_handler = arlan_sysctl_info18,
}, },
{ {
.ctl_name = 153,
.procname = "arlan0-ring", .procname = "arlan0-ring",
.data = &arlan_drive_info, .data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE, .maxlen = ARLAN_STR_SIZE,
.mode = 0400, .mode = 0400,
.proc_handler = &arlan_sysctl_info161719, .proc_handler = arlan_sysctl_info161719,
}, },
{ {
.ctl_name = 154,
.procname = "arlan0-shm-cpy", .procname = "arlan0-shm-cpy",
.data = &arlan_drive_info, .data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE, .maxlen = ARLAN_STR_SIZE,
.mode = 0400, .mode = 0400,
.proc_handler = &arlan_sysctl_info, .proc_handler = arlan_sysctl_info,
}, },
#endif #endif
{ {
.ctl_name = 155,
.procname = "config0", .procname = "config0",
.data = &conf_reset_result, .data = &conf_reset_result,
.maxlen = 100, .maxlen = 100,
.mode = 0400, .mode = 0400,
.proc_handler = &arlan_configure .proc_handler = arlan_configure
}, },
{ {
.ctl_name = 156,
.procname = "reset0", .procname = "reset0",
.data = &conf_reset_result, .data = &conf_reset_result,
.maxlen = 100, .maxlen = 100,
.mode = 0400, .mode = 0400,
.proc_handler = &arlan_sysctl_reset, .proc_handler = arlan_sysctl_reset,
}, },
{ .ctl_name = 0 } { }
}; };
static ctl_table arlan_conf_table1[] = static ctl_table arlan_conf_table1[] =
...@@ -969,63 +961,56 @@ static ctl_table arlan_conf_table1[] = ...@@ -969,63 +961,56 @@ static ctl_table arlan_conf_table1[] =
#ifdef ARLAN_PROC_SHM_DUMP #ifdef ARLAN_PROC_SHM_DUMP
{ {
.ctl_name = 150,
.procname = "arlan1-txRing", .procname = "arlan1-txRing",
.data = &arlan_drive_info, .data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE, .maxlen = ARLAN_STR_SIZE,
.mode = 0400, .mode = 0400,
.proc_handler = &arlan_sysctl_infotxRing, .proc_handler = arlan_sysctl_infotxRing,
}, },
{ {
.ctl_name = 151,
.procname = "arlan1-rxRing", .procname = "arlan1-rxRing",
.data = &arlan_drive_info, .data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE, .maxlen = ARLAN_STR_SIZE,
.mode = 0400, .mode = 0400,
.proc_handler = &arlan_sysctl_inforxRing, .proc_handler = arlan_sysctl_inforxRing,
}, },
{ {
.ctl_name = 152,
.procname = "arlan1-18", .procname = "arlan1-18",
.data = &arlan_drive_info, .data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE, .maxlen = ARLAN_STR_SIZE,
.mode = 0400, .mode = 0400,
.proc_handler = &arlan_sysctl_info18, .proc_handler = arlan_sysctl_info18,
}, },
{ {
.ctl_name = 153,
.procname = "arlan1-ring", .procname = "arlan1-ring",
.data = &arlan_drive_info, .data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE, .maxlen = ARLAN_STR_SIZE,
.mode = 0400, .mode = 0400,
.proc_handler = &arlan_sysctl_info161719, .proc_handler = arlan_sysctl_info161719,
}, },
{ {
.ctl_name = 154,
.procname = "arlan1-shm-cpy", .procname = "arlan1-shm-cpy",
.data = &arlan_drive_info, .data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE, .maxlen = ARLAN_STR_SIZE,
.mode = 0400, .mode = 0400,
.proc_handler = &arlan_sysctl_info, .proc_handler = arlan_sysctl_info,
}, },
#endif #endif
{ {
.ctl_name = 155,
.procname = "config1", .procname = "config1",
.data = &conf_reset_result, .data = &conf_reset_result,
.maxlen = 100, .maxlen = 100,
.mode = 0400, .mode = 0400,
.proc_handler = &arlan_configure, .proc_handler = arlan_configure,
}, },
{ {
.ctl_name = 156,
.procname = "reset1", .procname = "reset1",
.data = &conf_reset_result, .data = &conf_reset_result,
.maxlen = 100, .maxlen = 100,
.mode = 0400, .mode = 0400,
.proc_handler = &arlan_sysctl_reset, .proc_handler = arlan_sysctl_reset,
}, },
{ .ctl_name = 0 } { }
}; };
static ctl_table arlan_conf_table2[] = static ctl_table arlan_conf_table2[] =
...@@ -1035,63 +1020,56 @@ static ctl_table arlan_conf_table2[] = ...@@ -1035,63 +1020,56 @@ static ctl_table arlan_conf_table2[] =
#ifdef ARLAN_PROC_SHM_DUMP #ifdef ARLAN_PROC_SHM_DUMP
{ {
.ctl_name = 150,
.procname = "arlan2-txRing", .procname = "arlan2-txRing",
.data = &arlan_drive_info, .data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE, .maxlen = ARLAN_STR_SIZE,
.mode = 0400, .mode = 0400,
.proc_handler = &arlan_sysctl_infotxRing, .proc_handler = arlan_sysctl_infotxRing,
}, },
{ {
.ctl_name = 151,
.procname = "arlan2-rxRing", .procname = "arlan2-rxRing",
.data = &arlan_drive_info, .data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE, .maxlen = ARLAN_STR_SIZE,
.mode = 0400, .mode = 0400,
.proc_handler = &arlan_sysctl_inforxRing, .proc_handler = arlan_sysctl_inforxRing,
}, },
{ {
.ctl_name = 152,
.procname = "arlan2-18", .procname = "arlan2-18",
.data = &arlan_drive_info, .data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE, .maxlen = ARLAN_STR_SIZE,
.mode = 0400, .mode = 0400,
.proc_handler = &arlan_sysctl_info18, .proc_handler = arlan_sysctl_info18,
}, },
{ {
.ctl_name = 153,
.procname = "arlan2-ring", .procname = "arlan2-ring",
.data = &arlan_drive_info, .data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE, .maxlen = ARLAN_STR_SIZE,
.mode = 0400, .mode = 0400,
.proc_handler = &arlan_sysctl_info161719, .proc_handler = arlan_sysctl_info161719,
}, },
{ {
.ctl_name = 154,
.procname = "arlan2-shm-cpy", .procname = "arlan2-shm-cpy",
.data = &arlan_drive_info, .data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE, .maxlen = ARLAN_STR_SIZE,
.mode = 0400, .mode = 0400,
.proc_handler = &arlan_sysctl_info, .proc_handler = arlan_sysctl_info,
}, },
#endif #endif
{ {
.ctl_name = 155,
.procname = "config2", .procname = "config2",
.data = &conf_reset_result, .data = &conf_reset_result,
.maxlen = 100, .maxlen = 100,
.mode = 0400, .mode = 0400,
.proc_handler = &arlan_configure, .proc_handler = arlan_configure,
}, },
{ {
.ctl_name = 156,
.procname = "reset2", .procname = "reset2",
.data = &conf_reset_result, .data = &conf_reset_result,
.maxlen = 100, .maxlen = 100,
.mode = 0400, .mode = 0400,
.proc_handler = &arlan_sysctl_reset, .proc_handler = arlan_sysctl_reset,
}, },
{ .ctl_name = 0 } { }
}; };
static ctl_table arlan_conf_table3[] = static ctl_table arlan_conf_table3[] =
...@@ -1101,63 +1079,56 @@ static ctl_table arlan_conf_table3[] = ...@@ -1101,63 +1079,56 @@ static ctl_table arlan_conf_table3[] =
#ifdef ARLAN_PROC_SHM_DUMP #ifdef ARLAN_PROC_SHM_DUMP
{ {
.ctl_name = 150,
.procname = "arlan3-txRing", .procname = "arlan3-txRing",
.data = &arlan_drive_info, .data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE, .maxlen = ARLAN_STR_SIZE,
.mode = 0400, .mode = 0400,
.proc_handler = &arlan_sysctl_infotxRing, .proc_handler = arlan_sysctl_infotxRing,
}, },
{ {
.ctl_name = 151,
.procname = "arlan3-rxRing", .procname = "arlan3-rxRing",
.data = &arlan_drive_info, .data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE, .maxlen = ARLAN_STR_SIZE,
.mode = 0400, .mode = 0400,
.proc_handler = &arlan_sysctl_inforxRing, .proc_handler = arlan_sysctl_inforxRing,
}, },
{ {
.ctl_name = 152,
.procname = "arlan3-18", .procname = "arlan3-18",
.data = &arlan_drive_info, .data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE, .maxlen = ARLAN_STR_SIZE,
.mode = 0400, .mode = 0400,
.proc_handler = &arlan_sysctl_info18, .proc_handler = arlan_sysctl_info18,
}, },
{ {
.ctl_name = 153,
.procname = "arlan3-ring", .procname = "arlan3-ring",
.data = &arlan_drive_info, .data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE, .maxlen = ARLAN_STR_SIZE,
.mode = 0400, .mode = 0400,
.proc_handler = &arlan_sysctl_info161719, .proc_handler = arlan_sysctl_info161719,
}, },
{ {
.ctl_name = 154,
.procname = "arlan3-shm-cpy", .procname = "arlan3-shm-cpy",
.data = &arlan_drive_info, .data = &arlan_drive_info,
.maxlen = ARLAN_STR_SIZE, .maxlen = ARLAN_STR_SIZE,
.mode = 0400, .mode = 0400,
.proc_handler = &arlan_sysctl_info, .proc_handler = arlan_sysctl_info,
}, },
#endif #endif
{ {
.ctl_name = 155,
.procname = "config3", .procname = "config3",
.data = &conf_reset_result, .data = &conf_reset_result,
.maxlen = 100, .maxlen = 100,
.mode = 0400, .mode = 0400,
.proc_handler = &arlan_configure, .proc_handler = arlan_configure,
}, },
{ {
.ctl_name = 156,
.procname = "reset3", .procname = "reset3",
.data = &conf_reset_result, .data = &conf_reset_result,
.maxlen = 100, .maxlen = 100,
.mode = 0400, .mode = 0400,
.proc_handler = &arlan_sysctl_reset, .proc_handler = arlan_sysctl_reset,
}, },
{ .ctl_name = 0 } { }
}; };
...@@ -1165,41 +1136,37 @@ static ctl_table arlan_conf_table3[] = ...@@ -1165,41 +1136,37 @@ static ctl_table arlan_conf_table3[] =
static ctl_table arlan_table[] = static ctl_table arlan_table[] =
{ {
{ {
.ctl_name = 0,
.procname = "arlan0", .procname = "arlan0",
.maxlen = 0, .maxlen = 0,
.mode = 0600, .mode = 0600,
.child = arlan_conf_table0, .child = arlan_conf_table0,
}, },
{ {
.ctl_name = 0,
.procname = "arlan1", .procname = "arlan1",
.maxlen = 0, .maxlen = 0,
.mode = 0600, .mode = 0600,
.child = arlan_conf_table1, .child = arlan_conf_table1,
}, },
{ {
.ctl_name = 0,
.procname = "arlan2", .procname = "arlan2",
.maxlen = 0, .maxlen = 0,
.mode = 0600, .mode = 0600,
.child = arlan_conf_table2, .child = arlan_conf_table2,
}, },
{ {
.ctl_name = 0,
.procname = "arlan3", .procname = "arlan3",
.maxlen = 0, .maxlen = 0,
.mode = 0600, .mode = 0600,
.child = arlan_conf_table3, .child = arlan_conf_table3,
}, },
{ .ctl_name = 0 } { }
}; };
#else #else
static ctl_table arlan_table[MAX_ARLANS + 1] = static ctl_table arlan_table[] =
{ {
{ .ctl_name = 0 } { }
}; };
#endif #endif
...@@ -1209,22 +1176,14 @@ static ctl_table arlan_table[MAX_ARLANS + 1] = ...@@ -1209,22 +1176,14 @@ static ctl_table arlan_table[MAX_ARLANS + 1] =
static ctl_table arlan_root_table[] = static ctl_table arlan_root_table[] =
{ {
{ {
.ctl_name = CTL_ARLAN,
.procname = "arlan", .procname = "arlan",
.maxlen = 0, .maxlen = 0,
.mode = 0555, .mode = 0555,
.child = arlan_table, .child = arlan_table,
}, },
{ .ctl_name = 0 } { }
}; };
/* Make sure that /proc/sys/dev is there */
//static ctl_table arlan_device_root_table[] =
//{
// {CTL_DEV, "dev", NULL, 0, 0555, arlan_root_table},
// {0}
//};
static struct ctl_table_header *arlan_device_sysctl_header; static struct ctl_table_header *arlan_device_sysctl_header;
...@@ -1234,8 +1193,6 @@ int __init init_arlan_proc(void) ...@@ -1234,8 +1193,6 @@ int __init init_arlan_proc(void)
int i = 0; int i = 0;
if (arlan_device_sysctl_header) if (arlan_device_sysctl_header)
return 0; return 0;
for (i = 0; i < MAX_ARLANS && arlan_device[i]; i++)
arlan_table[i].ctl_name = i + 1;
arlan_device_sysctl_header = register_sysctl_table(arlan_root_table); arlan_device_sysctl_header = register_sysctl_table(arlan_root_table);
if (!arlan_device_sysctl_header) if (!arlan_device_sysctl_header)
return -1; return -1;
......
...@@ -233,10 +233,10 @@ static int do_hardware_modes (ctl_table *table, int write, ...@@ -233,10 +233,10 @@ static int do_hardware_modes (ctl_table *table, int write,
return copy_to_user(result, buffer, len) ? -EFAULT : 0; return copy_to_user(result, buffer, len) ? -EFAULT : 0;
} }
#define PARPORT_PORT_DIR(CHILD) { .ctl_name = 0, .procname = NULL, .mode = 0555, .child = CHILD } #define PARPORT_PORT_DIR(CHILD) { .procname = NULL, .mode = 0555, .child = CHILD }
#define PARPORT_PARPORT_DIR(CHILD) { .ctl_name = DEV_PARPORT, .procname = "parport", \ #define PARPORT_PARPORT_DIR(CHILD) { .procname = "parport", \
.mode = 0555, .child = CHILD } .mode = 0555, .child = CHILD }
#define PARPORT_DEV_DIR(CHILD) { .ctl_name = CTL_DEV, .procname = "dev", .mode = 0555, .child = CHILD } #define PARPORT_DEV_DIR(CHILD) { .procname = "dev", .mode = 0555, .child = CHILD }
#define PARPORT_DEVICES_ROOT_DIR { .procname = "devices", \ #define PARPORT_DEVICES_ROOT_DIR { .procname = "devices", \
.mode = 0555, .child = NULL } .mode = 0555, .child = NULL }
...@@ -270,7 +270,7 @@ static const struct parport_sysctl_table parport_sysctl_template = { ...@@ -270,7 +270,7 @@ static const struct parport_sysctl_table parport_sysctl_template = {
.data = NULL, .data = NULL,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.extra1 = (void*) &parport_min_spintime_value, .extra1 = (void*) &parport_min_spintime_value,
.extra2 = (void*) &parport_max_spintime_value .extra2 = (void*) &parport_max_spintime_value
}, },
...@@ -279,28 +279,28 @@ static const struct parport_sysctl_table parport_sysctl_template = { ...@@ -279,28 +279,28 @@ static const struct parport_sysctl_table parport_sysctl_template = {
.data = NULL, .data = NULL,
.maxlen = 0, .maxlen = 0,
.mode = 0444, .mode = 0444,
.proc_handler = &do_hardware_base_addr .proc_handler = do_hardware_base_addr
}, },
{ {
.procname = "irq", .procname = "irq",
.data = NULL, .data = NULL,
.maxlen = 0, .maxlen = 0,
.mode = 0444, .mode = 0444,
.proc_handler = &do_hardware_irq .proc_handler = do_hardware_irq
}, },
{ {
.procname = "dma", .procname = "dma",
.data = NULL, .data = NULL,
.maxlen = 0, .maxlen = 0,
.mode = 0444, .mode = 0444,
.proc_handler = &do_hardware_dma .proc_handler = do_hardware_dma
}, },
{ {
.procname = "modes", .procname = "modes",
.data = NULL, .data = NULL,
.maxlen = 0, .maxlen = 0,
.mode = 0444, .mode = 0444,
.proc_handler = &do_hardware_modes .proc_handler = do_hardware_modes
}, },
PARPORT_DEVICES_ROOT_DIR, PARPORT_DEVICES_ROOT_DIR,
#ifdef CONFIG_PARPORT_1284 #ifdef CONFIG_PARPORT_1284
...@@ -309,35 +309,35 @@ static const struct parport_sysctl_table parport_sysctl_template = { ...@@ -309,35 +309,35 @@ static const struct parport_sysctl_table parport_sysctl_template = {
.data = NULL, .data = NULL,
.maxlen = 0, .maxlen = 0,
.mode = 0444, .mode = 0444,
.proc_handler = &do_autoprobe .proc_handler = do_autoprobe
}, },
{ {
.procname = "autoprobe0", .procname = "autoprobe0",
.data = NULL, .data = NULL,
.maxlen = 0, .maxlen = 0,
.mode = 0444, .mode = 0444,
.proc_handler = &do_autoprobe .proc_handler = do_autoprobe
}, },
{ {
.procname = "autoprobe1", .procname = "autoprobe1",
.data = NULL, .data = NULL,
.maxlen = 0, .maxlen = 0,
.mode = 0444, .mode = 0444,
.proc_handler = &do_autoprobe .proc_handler = do_autoprobe
}, },
{ {
.procname = "autoprobe2", .procname = "autoprobe2",
.data = NULL, .data = NULL,
.maxlen = 0, .maxlen = 0,
.mode = 0444, .mode = 0444,
.proc_handler = &do_autoprobe .proc_handler = do_autoprobe
}, },
{ {
.procname = "autoprobe3", .procname = "autoprobe3",
.data = NULL, .data = NULL,
.maxlen = 0, .maxlen = 0,
.mode = 0444, .mode = 0444,
.proc_handler = &do_autoprobe .proc_handler = do_autoprobe
}, },
#endif /* IEEE 1284 support */ #endif /* IEEE 1284 support */
{} {}
...@@ -348,7 +348,7 @@ static const struct parport_sysctl_table parport_sysctl_template = { ...@@ -348,7 +348,7 @@ static const struct parport_sysctl_table parport_sysctl_template = {
.data = NULL, .data = NULL,
.maxlen = 0, .maxlen = 0,
.mode = 0444, .mode = 0444,
.proc_handler = &do_active_device .proc_handler = do_active_device
}, },
{} {}
}, },
...@@ -386,14 +386,13 @@ parport_device_sysctl_template = { ...@@ -386,14 +386,13 @@ parport_device_sysctl_template = {
.data = NULL, .data = NULL,
.maxlen = sizeof(unsigned long), .maxlen = sizeof(unsigned long),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_doulongvec_ms_jiffies_minmax, .proc_handler = proc_doulongvec_ms_jiffies_minmax,
.extra1 = (void*) &parport_min_timeslice_value, .extra1 = (void*) &parport_min_timeslice_value,
.extra2 = (void*) &parport_max_timeslice_value .extra2 = (void*) &parport_max_timeslice_value
}, },
}, },
{ {
{ {
.ctl_name = 0,
.procname = NULL, .procname = NULL,
.data = NULL, .data = NULL,
.maxlen = 0, .maxlen = 0,
...@@ -438,7 +437,7 @@ parport_default_sysctl_table = { ...@@ -438,7 +437,7 @@ parport_default_sysctl_table = {
.data = &parport_default_timeslice, .data = &parport_default_timeslice,
.maxlen = sizeof(parport_default_timeslice), .maxlen = sizeof(parport_default_timeslice),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_doulongvec_ms_jiffies_minmax, .proc_handler = proc_doulongvec_ms_jiffies_minmax,
.extra1 = (void*) &parport_min_timeslice_value, .extra1 = (void*) &parport_min_timeslice_value,
.extra2 = (void*) &parport_max_timeslice_value .extra2 = (void*) &parport_max_timeslice_value
}, },
...@@ -447,7 +446,7 @@ parport_default_sysctl_table = { ...@@ -447,7 +446,7 @@ parport_default_sysctl_table = {
.data = &parport_default_spintime, .data = &parport_default_spintime,
.maxlen = sizeof(parport_default_spintime), .maxlen = sizeof(parport_default_spintime),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.extra1 = (void*) &parport_min_spintime_value, .extra1 = (void*) &parport_min_spintime_value,
.extra2 = (void*) &parport_max_spintime_value .extra2 = (void*) &parport_max_spintime_value
}, },
...@@ -455,7 +454,6 @@ parport_default_sysctl_table = { ...@@ -455,7 +454,6 @@ parport_default_sysctl_table = {
}, },
{ {
{ {
.ctl_name = DEV_PARPORT_DEFAULT,
.procname = "default", .procname = "default",
.mode = 0555, .mode = 0555,
.child = parport_default_sysctl_table.vars .child = parport_default_sysctl_table.vars
...@@ -495,7 +493,6 @@ int parport_proc_register(struct parport *port) ...@@ -495,7 +493,6 @@ int parport_proc_register(struct parport *port)
t->vars[6 + i].extra2 = &port->probe_info[i]; t->vars[6 + i].extra2 = &port->probe_info[i];
t->port_dir[0].procname = port->name; t->port_dir[0].procname = port->name;
t->port_dir[0].ctl_name = 0;
t->port_dir[0].child = t->vars; t->port_dir[0].child = t->vars;
t->parport_dir[0].child = t->port_dir; t->parport_dir[0].child = t->port_dir;
...@@ -534,11 +531,9 @@ int parport_device_proc_register(struct pardevice *device) ...@@ -534,11 +531,9 @@ int parport_device_proc_register(struct pardevice *device)
t->dev_dir[0].child = t->parport_dir; t->dev_dir[0].child = t->parport_dir;
t->parport_dir[0].child = t->port_dir; t->parport_dir[0].child = t->port_dir;
t->port_dir[0].procname = port->name; t->port_dir[0].procname = port->name;
t->port_dir[0].ctl_name = 0;
t->port_dir[0].child = t->devices_root_dir; t->port_dir[0].child = t->devices_root_dir;
t->devices_root_dir[0].child = t->device_dir; t->devices_root_dir[0].child = t->device_dir;
t->device_dir[0].ctl_name = 0;
t->device_dir[0].procname = device->name; t->device_dir[0].procname = device->name;
t->device_dir[0].child = t->vars; t->device_dir[0].child = t->vars;
t->vars[0].data = &device->timeslice; t->vars[0].data = &device->timeslice;
......
...@@ -101,18 +101,17 @@ static struct ctl_table callhome_table[] = { ...@@ -101,18 +101,17 @@ static struct ctl_table callhome_table[] = {
.mode = 0644, .mode = 0644,
.proc_handler = proc_handler_callhome, .proc_handler = proc_handler_callhome,
}, },
{ .ctl_name = 0 } {}
}; };
static struct ctl_table kern_dir_table[] = { static struct ctl_table kern_dir_table[] = {
{ {
.ctl_name = CTL_KERN,
.procname = "kernel", .procname = "kernel",
.maxlen = 0, .maxlen = 0,
.mode = 0555, .mode = 0555,
.child = callhome_table, .child = callhome_table,
}, },
{ .ctl_name = 0 } {}
}; };
/* /*
......
...@@ -13,26 +13,23 @@ ...@@ -13,26 +13,23 @@
static ctl_table scsi_table[] = { static ctl_table scsi_table[] = {
{ .ctl_name = DEV_SCSI_LOGGING_LEVEL, { .procname = "logging_level",
.procname = "logging_level",
.data = &scsi_logging_level, .data = &scsi_logging_level,
.maxlen = sizeof(scsi_logging_level), .maxlen = sizeof(scsi_logging_level),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec }, .proc_handler = proc_dointvec },
{ } { }
}; };
static ctl_table scsi_dir_table[] = { static ctl_table scsi_dir_table[] = {
{ .ctl_name = DEV_SCSI, { .procname = "scsi",
.procname = "scsi",
.mode = 0555, .mode = 0555,
.child = scsi_table }, .child = scsi_table },
{ } { }
}; };
static ctl_table scsi_root_table[] = { static ctl_table scsi_root_table[] = {
{ .ctl_name = CTL_DEV, { .procname = "dev",
.procname = "dev",
.mode = 0555, .mode = 0555,
.child = scsi_dir_table }, .child = scsi_dir_table },
{ } { }
......
...@@ -17,28 +17,25 @@ static struct ctl_table_header *fs_table_header; ...@@ -17,28 +17,25 @@ static struct ctl_table_header *fs_table_header;
static ctl_table coda_table[] = { static ctl_table coda_table[] = {
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "timeout", .procname = "timeout",
.data = &coda_timeout, .data = &coda_timeout,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec .proc_handler = proc_dointvec
}, },
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "hard", .procname = "hard",
.data = &coda_hard, .data = &coda_hard,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec .proc_handler = proc_dointvec
}, },
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "fake_statfs", .procname = "fake_statfs",
.data = &coda_fake_statfs, .data = &coda_fake_statfs,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0600, .mode = 0600,
.proc_handler = &proc_dointvec .proc_handler = proc_dointvec
}, },
{} {}
}; };
...@@ -46,7 +43,6 @@ static ctl_table coda_table[] = { ...@@ -46,7 +43,6 @@ static ctl_table coda_table[] = {
#ifdef CONFIG_SYSCTL #ifdef CONFIG_SYSCTL
static ctl_table fs_table[] = { static ctl_table fs_table[] = {
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "coda", .procname = "coda",
.mode = 0555, .mode = 0555,
.child = coda_table .child = coda_table
......
...@@ -251,10 +251,10 @@ ctl_table epoll_table[] = { ...@@ -251,10 +251,10 @@ ctl_table epoll_table[] = {
.data = &max_user_watches, .data = &max_user_watches,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.extra1 = &zero, .extra1 = &zero,
}, },
{ .ctl_name = 0 } { }
}; };
#endif /* CONFIG_SYSCTL */ #endif /* CONFIG_SYSCTL */
......
...@@ -371,82 +371,74 @@ EXPORT_SYMBOL_GPL(lockd_down); ...@@ -371,82 +371,74 @@ EXPORT_SYMBOL_GPL(lockd_down);
static ctl_table nlm_sysctls[] = { static ctl_table nlm_sysctls[] = {
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "nlm_grace_period", .procname = "nlm_grace_period",
.data = &nlm_grace_period, .data = &nlm_grace_period,
.maxlen = sizeof(unsigned long), .maxlen = sizeof(unsigned long),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_doulongvec_minmax, .proc_handler = proc_doulongvec_minmax,
.extra1 = (unsigned long *) &nlm_grace_period_min, .extra1 = (unsigned long *) &nlm_grace_period_min,
.extra2 = (unsigned long *) &nlm_grace_period_max, .extra2 = (unsigned long *) &nlm_grace_period_max,
}, },
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "nlm_timeout", .procname = "nlm_timeout",
.data = &nlm_timeout, .data = &nlm_timeout,
.maxlen = sizeof(unsigned long), .maxlen = sizeof(unsigned long),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_doulongvec_minmax, .proc_handler = proc_doulongvec_minmax,
.extra1 = (unsigned long *) &nlm_timeout_min, .extra1 = (unsigned long *) &nlm_timeout_min,
.extra2 = (unsigned long *) &nlm_timeout_max, .extra2 = (unsigned long *) &nlm_timeout_max,
}, },
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "nlm_udpport", .procname = "nlm_udpport",
.data = &nlm_udpport, .data = &nlm_udpport,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.extra1 = (int *) &nlm_port_min, .extra1 = (int *) &nlm_port_min,
.extra2 = (int *) &nlm_port_max, .extra2 = (int *) &nlm_port_max,
}, },
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "nlm_tcpport", .procname = "nlm_tcpport",
.data = &nlm_tcpport, .data = &nlm_tcpport,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.extra1 = (int *) &nlm_port_min, .extra1 = (int *) &nlm_port_min,
.extra2 = (int *) &nlm_port_max, .extra2 = (int *) &nlm_port_max,
}, },
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "nsm_use_hostnames", .procname = "nsm_use_hostnames",
.data = &nsm_use_hostnames, .data = &nsm_use_hostnames,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "nsm_local_state", .procname = "nsm_local_state",
.data = &nsm_local_state, .data = &nsm_local_state,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ .ctl_name = 0 } { }
}; };
static ctl_table nlm_sysctl_dir[] = { static ctl_table nlm_sysctl_dir[] = {
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "nfs", .procname = "nfs",
.mode = 0555, .mode = 0555,
.child = nlm_sysctls, .child = nlm_sysctls,
}, },
{ .ctl_name = 0 } { }
}; };
static ctl_table nlm_sysctl_root[] = { static ctl_table nlm_sysctl_root[] = {
{ {
.ctl_name = CTL_FS,
.procname = "fs", .procname = "fs",
.mode = 0555, .mode = 0555,
.child = nlm_sysctl_dir, .child = nlm_sysctl_dir,
}, },
{ .ctl_name = 0 } { }
}; };
#endif /* CONFIG_SYSCTL */ #endif /* CONFIG_SYSCTL */
......
...@@ -22,63 +22,55 @@ static struct ctl_table_header *nfs_callback_sysctl_table; ...@@ -22,63 +22,55 @@ static struct ctl_table_header *nfs_callback_sysctl_table;
static ctl_table nfs_cb_sysctls[] = { static ctl_table nfs_cb_sysctls[] = {
#ifdef CONFIG_NFS_V4 #ifdef CONFIG_NFS_V4
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "nfs_callback_tcpport", .procname = "nfs_callback_tcpport",
.data = &nfs_callback_set_tcpport, .data = &nfs_callback_set_tcpport,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.extra1 = (int *)&nfs_set_port_min, .extra1 = (int *)&nfs_set_port_min,
.extra2 = (int *)&nfs_set_port_max, .extra2 = (int *)&nfs_set_port_max,
}, },
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "idmap_cache_timeout", .procname = "idmap_cache_timeout",
.data = &nfs_idmap_cache_timeout, .data = &nfs_idmap_cache_timeout,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_jiffies, .proc_handler = proc_dointvec_jiffies,
.strategy = &sysctl_jiffies,
}, },
#endif #endif
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "nfs_mountpoint_timeout", .procname = "nfs_mountpoint_timeout",
.data = &nfs_mountpoint_expiry_timeout, .data = &nfs_mountpoint_expiry_timeout,
.maxlen = sizeof(nfs_mountpoint_expiry_timeout), .maxlen = sizeof(nfs_mountpoint_expiry_timeout),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_jiffies, .proc_handler = proc_dointvec_jiffies,
.strategy = &sysctl_jiffies,
}, },
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "nfs_congestion_kb", .procname = "nfs_congestion_kb",
.data = &nfs_congestion_kb, .data = &nfs_congestion_kb,
.maxlen = sizeof(nfs_congestion_kb), .maxlen = sizeof(nfs_congestion_kb),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ .ctl_name = 0 } { }
}; };
static ctl_table nfs_cb_sysctl_dir[] = { static ctl_table nfs_cb_sysctl_dir[] = {
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "nfs", .procname = "nfs",
.mode = 0555, .mode = 0555,
.child = nfs_cb_sysctls, .child = nfs_cb_sysctls,
}, },
{ .ctl_name = 0 } { }
}; };
static ctl_table nfs_cb_sysctl_root[] = { static ctl_table nfs_cb_sysctl_root[] = {
{ {
.ctl_name = CTL_FS,
.procname = "fs", .procname = "fs",
.mode = 0555, .mode = 0555,
.child = nfs_cb_sysctl_dir, .child = nfs_cb_sysctl_dir,
}, },
{ .ctl_name = 0 } { }
}; };
int nfs_register_sysctl(void) int nfs_register_sysctl(void)
......
...@@ -69,36 +69,30 @@ static int zero; ...@@ -69,36 +69,30 @@ static int zero;
ctl_table inotify_table[] = { ctl_table inotify_table[] = {
{ {
.ctl_name = INOTIFY_MAX_USER_INSTANCES,
.procname = "max_user_instances", .procname = "max_user_instances",
.data = &inotify_max_user_instances, .data = &inotify_max_user_instances,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &zero, .extra1 = &zero,
}, },
{ {
.ctl_name = INOTIFY_MAX_USER_WATCHES,
.procname = "max_user_watches", .procname = "max_user_watches",
.data = &inotify_max_user_watches, .data = &inotify_max_user_watches,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &zero, .extra1 = &zero,
}, },
{ {
.ctl_name = INOTIFY_MAX_QUEUED_EVENTS,
.procname = "max_queued_events", .procname = "max_queued_events",
.data = &inotify_max_queued_events, .data = &inotify_max_queued_events,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &zero .extra1 = &zero
}, },
{ .ctl_name = 0 } { }
}; };
#endif /* CONFIG_SYSCTL */ #endif /* CONFIG_SYSCTL */
......
...@@ -36,12 +36,11 @@ ...@@ -36,12 +36,11 @@
/* Definition of the ntfs sysctl. */ /* Definition of the ntfs sysctl. */
static ctl_table ntfs_sysctls[] = { static ctl_table ntfs_sysctls[] = {
{ {
.ctl_name = CTL_UNNUMBERED, /* Binary and text IDs. */
.procname = "ntfs-debug", .procname = "ntfs-debug",
.data = &debug_msgs, /* Data pointer and size. */ .data = &debug_msgs, /* Data pointer and size. */
.maxlen = sizeof(debug_msgs), .maxlen = sizeof(debug_msgs),
.mode = 0644, /* Mode, proc handler. */ .mode = 0644, /* Mode, proc handler. */
.proc_handler = &proc_dointvec .proc_handler = proc_dointvec
}, },
{} {}
}; };
...@@ -49,7 +48,6 @@ static ctl_table ntfs_sysctls[] = { ...@@ -49,7 +48,6 @@ static ctl_table ntfs_sysctls[] = {
/* Define the parent directory /proc/sys/fs. */ /* Define the parent directory /proc/sys/fs. */
static ctl_table sysctls_root[] = { static ctl_table sysctls_root[] = {
{ {
.ctl_name = CTL_FS,
.procname = "fs", .procname = "fs",
.mode = 0555, .mode = 0555,
.child = ntfs_sysctls .child = ntfs_sysctls
......
...@@ -620,51 +620,46 @@ static int ocfs2_sysfs_init(void) ...@@ -620,51 +620,46 @@ static int ocfs2_sysfs_init(void)
static ctl_table ocfs2_nm_table[] = { static ctl_table ocfs2_nm_table[] = {
{ {
.ctl_name = 1,
.procname = "hb_ctl_path", .procname = "hb_ctl_path",
.data = ocfs2_hb_ctl_path, .data = ocfs2_hb_ctl_path,
.maxlen = OCFS2_MAX_HB_CTL_PATH, .maxlen = OCFS2_MAX_HB_CTL_PATH,
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dostring, .proc_handler = proc_dostring,
.strategy = &sysctl_string,
}, },
{ .ctl_name = 0 } { }
}; };
static ctl_table ocfs2_mod_table[] = { static ctl_table ocfs2_mod_table[] = {
{ {
.ctl_name = FS_OCFS2_NM,
.procname = "nm", .procname = "nm",
.data = NULL, .data = NULL,
.maxlen = 0, .maxlen = 0,
.mode = 0555, .mode = 0555,
.child = ocfs2_nm_table .child = ocfs2_nm_table
}, },
{ .ctl_name = 0} { }
}; };
static ctl_table ocfs2_kern_table[] = { static ctl_table ocfs2_kern_table[] = {
{ {
.ctl_name = FS_OCFS2,
.procname = "ocfs2", .procname = "ocfs2",
.data = NULL, .data = NULL,
.maxlen = 0, .maxlen = 0,
.mode = 0555, .mode = 0555,
.child = ocfs2_mod_table .child = ocfs2_mod_table
}, },
{ .ctl_name = 0} { }
}; };
static ctl_table ocfs2_root_table[] = { static ctl_table ocfs2_root_table[] = {
{ {
.ctl_name = CTL_FS,
.procname = "fs", .procname = "fs",
.data = NULL, .data = NULL,
.maxlen = 0, .maxlen = 0,
.mode = 0555, .mode = 0555,
.child = ocfs2_kern_table .child = ocfs2_kern_table
}, },
{ .ctl_name = 0 } { }
}; };
static struct ctl_table_header *ocfs2_table_header = NULL; static struct ctl_table_header *ocfs2_table_header = NULL;
......
...@@ -48,7 +48,7 @@ static struct inode *proc_sys_make_inode(struct super_block *sb, ...@@ -48,7 +48,7 @@ static struct inode *proc_sys_make_inode(struct super_block *sb,
static struct ctl_table *find_in_table(struct ctl_table *p, struct qstr *name) static struct ctl_table *find_in_table(struct ctl_table *p, struct qstr *name)
{ {
int len; int len;
for ( ; p->ctl_name || p->procname; p++) { for ( ; p->procname; p++) {
if (!p->procname) if (!p->procname)
continue; continue;
...@@ -218,7 +218,7 @@ static int scan(struct ctl_table_header *head, ctl_table *table, ...@@ -218,7 +218,7 @@ static int scan(struct ctl_table_header *head, ctl_table *table,
void *dirent, filldir_t filldir) void *dirent, filldir_t filldir)
{ {
for (; table->ctl_name || table->procname; table++, (*pos)++) { for (; table->procname; table++, (*pos)++) {
int res; int res;
/* Can't do anything without a proc name */ /* Can't do anything without a proc name */
......
...@@ -2404,100 +2404,89 @@ const struct quotactl_ops vfs_quotactl_ops = { ...@@ -2404,100 +2404,89 @@ const struct quotactl_ops vfs_quotactl_ops = {
static ctl_table fs_dqstats_table[] = { static ctl_table fs_dqstats_table[] = {
{ {
.ctl_name = FS_DQ_LOOKUPS,
.procname = "lookups", .procname = "lookups",
.data = &dqstats.lookups, .data = &dqstats.lookups,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0444, .mode = 0444,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ {
.ctl_name = FS_DQ_DROPS,
.procname = "drops", .procname = "drops",
.data = &dqstats.drops, .data = &dqstats.drops,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0444, .mode = 0444,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ {
.ctl_name = FS_DQ_READS,
.procname = "reads", .procname = "reads",
.data = &dqstats.reads, .data = &dqstats.reads,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0444, .mode = 0444,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ {
.ctl_name = FS_DQ_WRITES,
.procname = "writes", .procname = "writes",
.data = &dqstats.writes, .data = &dqstats.writes,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0444, .mode = 0444,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ {
.ctl_name = FS_DQ_CACHE_HITS,
.procname = "cache_hits", .procname = "cache_hits",
.data = &dqstats.cache_hits, .data = &dqstats.cache_hits,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0444, .mode = 0444,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ {
.ctl_name = FS_DQ_ALLOCATED,
.procname = "allocated_dquots", .procname = "allocated_dquots",
.data = &dqstats.allocated_dquots, .data = &dqstats.allocated_dquots,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0444, .mode = 0444,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ {
.ctl_name = FS_DQ_FREE,
.procname = "free_dquots", .procname = "free_dquots",
.data = &dqstats.free_dquots, .data = &dqstats.free_dquots,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0444, .mode = 0444,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ {
.ctl_name = FS_DQ_SYNCS,
.procname = "syncs", .procname = "syncs",
.data = &dqstats.syncs, .data = &dqstats.syncs,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0444, .mode = 0444,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
}, },
#ifdef CONFIG_PRINT_QUOTA_WARNING #ifdef CONFIG_PRINT_QUOTA_WARNING
{ {
.ctl_name = FS_DQ_WARNINGS,
.procname = "warnings", .procname = "warnings",
.data = &flag_print_warnings, .data = &flag_print_warnings,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec, .proc_handler = proc_dointvec,
}, },
#endif #endif
{ .ctl_name = 0 }, { },
}; };
static ctl_table fs_table[] = { static ctl_table fs_table[] = {
{ {
.ctl_name = FS_DQSTATS,
.procname = "quota", .procname = "quota",
.mode = 0555, .mode = 0555,
.child = fs_dqstats_table, .child = fs_dqstats_table,
}, },
{ .ctl_name = 0 }, { },
}; };
static ctl_table sys_table[] = { static ctl_table sys_table[] = {
{ {
.ctl_name = CTL_FS,
.procname = "fs", .procname = "fs",
.mode = 0555, .mode = 0555,
.child = fs_table, .child = fs_table,
}, },
{ .ctl_name = 0 }, { },
}; };
static int __init dquot_init(void) static int __init dquot_init(void)
......
...@@ -55,170 +55,140 @@ xfs_stats_clear_proc_handler( ...@@ -55,170 +55,140 @@ xfs_stats_clear_proc_handler(
static ctl_table xfs_table[] = { static ctl_table xfs_table[] = {
{ {
.ctl_name = XFS_SGID_INHERIT,
.procname = "irix_sgid_inherit", .procname = "irix_sgid_inherit",
.data = &xfs_params.sgid_inherit.val, .data = &xfs_params.sgid_inherit.val,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &xfs_params.sgid_inherit.min, .extra1 = &xfs_params.sgid_inherit.min,
.extra2 = &xfs_params.sgid_inherit.max .extra2 = &xfs_params.sgid_inherit.max
}, },
{ {
.ctl_name = XFS_SYMLINK_MODE,
.procname = "irix_symlink_mode", .procname = "irix_symlink_mode",
.data = &xfs_params.symlink_mode.val, .data = &xfs_params.symlink_mode.val,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &xfs_params.symlink_mode.min, .extra1 = &xfs_params.symlink_mode.min,
.extra2 = &xfs_params.symlink_mode.max .extra2 = &xfs_params.symlink_mode.max
}, },
{ {
.ctl_name = XFS_PANIC_MASK,
.procname = "panic_mask", .procname = "panic_mask",
.data = &xfs_params.panic_mask.val, .data = &xfs_params.panic_mask.val,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &xfs_params.panic_mask.min, .extra1 = &xfs_params.panic_mask.min,
.extra2 = &xfs_params.panic_mask.max .extra2 = &xfs_params.panic_mask.max
}, },
{ {
.ctl_name = XFS_ERRLEVEL,
.procname = "error_level", .procname = "error_level",
.data = &xfs_params.error_level.val, .data = &xfs_params.error_level.val,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &xfs_params.error_level.min, .extra1 = &xfs_params.error_level.min,
.extra2 = &xfs_params.error_level.max .extra2 = &xfs_params.error_level.max
}, },
{ {
.ctl_name = XFS_SYNCD_TIMER,
.procname = "xfssyncd_centisecs", .procname = "xfssyncd_centisecs",
.data = &xfs_params.syncd_timer.val, .data = &xfs_params.syncd_timer.val,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &xfs_params.syncd_timer.min, .extra1 = &xfs_params.syncd_timer.min,
.extra2 = &xfs_params.syncd_timer.max .extra2 = &xfs_params.syncd_timer.max
}, },
{ {
.ctl_name = XFS_INHERIT_SYNC,
.procname = "inherit_sync", .procname = "inherit_sync",
.data = &xfs_params.inherit_sync.val, .data = &xfs_params.inherit_sync.val,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &xfs_params.inherit_sync.min, .extra1 = &xfs_params.inherit_sync.min,
.extra2 = &xfs_params.inherit_sync.max .extra2 = &xfs_params.inherit_sync.max
}, },
{ {
.ctl_name = XFS_INHERIT_NODUMP,
.procname = "inherit_nodump", .procname = "inherit_nodump",
.data = &xfs_params.inherit_nodump.val, .data = &xfs_params.inherit_nodump.val,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &xfs_params.inherit_nodump.min, .extra1 = &xfs_params.inherit_nodump.min,
.extra2 = &xfs_params.inherit_nodump.max .extra2 = &xfs_params.inherit_nodump.max
}, },
{ {
.ctl_name = XFS_INHERIT_NOATIME,
.procname = "inherit_noatime", .procname = "inherit_noatime",
.data = &xfs_params.inherit_noatim.val, .data = &xfs_params.inherit_noatim.val,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &xfs_params.inherit_noatim.min, .extra1 = &xfs_params.inherit_noatim.min,
.extra2 = &xfs_params.inherit_noatim.max .extra2 = &xfs_params.inherit_noatim.max
}, },
{ {
.ctl_name = XFS_BUF_TIMER,
.procname = "xfsbufd_centisecs", .procname = "xfsbufd_centisecs",
.data = &xfs_params.xfs_buf_timer.val, .data = &xfs_params.xfs_buf_timer.val,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &xfs_params.xfs_buf_timer.min, .extra1 = &xfs_params.xfs_buf_timer.min,
.extra2 = &xfs_params.xfs_buf_timer.max .extra2 = &xfs_params.xfs_buf_timer.max
}, },
{ {
.ctl_name = XFS_BUF_AGE,
.procname = "age_buffer_centisecs", .procname = "age_buffer_centisecs",
.data = &xfs_params.xfs_buf_age.val, .data = &xfs_params.xfs_buf_age.val,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &xfs_params.xfs_buf_age.min, .extra1 = &xfs_params.xfs_buf_age.min,
.extra2 = &xfs_params.xfs_buf_age.max .extra2 = &xfs_params.xfs_buf_age.max
}, },
{ {
.ctl_name = XFS_INHERIT_NOSYM,
.procname = "inherit_nosymlinks", .procname = "inherit_nosymlinks",
.data = &xfs_params.inherit_nosym.val, .data = &xfs_params.inherit_nosym.val,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &xfs_params.inherit_nosym.min, .extra1 = &xfs_params.inherit_nosym.min,
.extra2 = &xfs_params.inherit_nosym.max .extra2 = &xfs_params.inherit_nosym.max
}, },
{ {
.ctl_name = XFS_ROTORSTEP,
.procname = "rotorstep", .procname = "rotorstep",
.data = &xfs_params.rotorstep.val, .data = &xfs_params.rotorstep.val,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &xfs_params.rotorstep.min, .extra1 = &xfs_params.rotorstep.min,
.extra2 = &xfs_params.rotorstep.max .extra2 = &xfs_params.rotorstep.max
}, },
{ {
.ctl_name = XFS_INHERIT_NODFRG,
.procname = "inherit_nodefrag", .procname = "inherit_nodefrag",
.data = &xfs_params.inherit_nodfrg.val, .data = &xfs_params.inherit_nodfrg.val,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &xfs_params.inherit_nodfrg.min, .extra1 = &xfs_params.inherit_nodfrg.min,
.extra2 = &xfs_params.inherit_nodfrg.max .extra2 = &xfs_params.inherit_nodfrg.max
}, },
{ {
.ctl_name = XFS_FILESTREAM_TIMER,
.procname = "filestream_centisecs", .procname = "filestream_centisecs",
.data = &xfs_params.fstrm_timer.val, .data = &xfs_params.fstrm_timer.val,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = &sysctl_intvec,
.extra1 = &xfs_params.fstrm_timer.min, .extra1 = &xfs_params.fstrm_timer.min,
.extra2 = &xfs_params.fstrm_timer.max, .extra2 = &xfs_params.fstrm_timer.max,
}, },
/* please keep this the last entry */ /* please keep this the last entry */
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
{ {
.ctl_name = XFS_STATS_CLEAR,
.procname = "stats_clear", .procname = "stats_clear",
.data = &xfs_params.stats_clear.val, .data = &xfs_params.stats_clear.val,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = &xfs_stats_clear_proc_handler, .proc_handler = xfs_stats_clear_proc_handler,
.strategy = &sysctl_intvec,
.extra1 = &xfs_params.stats_clear.min, .extra1 = &xfs_params.stats_clear.min,
.extra2 = &xfs_params.stats_clear.max .extra2 = &xfs_params.stats_clear.max
}, },
...@@ -229,7 +199,6 @@ static ctl_table xfs_table[] = { ...@@ -229,7 +199,6 @@ static ctl_table xfs_table[] = {
static ctl_table xfs_dir_table[] = { static ctl_table xfs_dir_table[] = {
{ {
.ctl_name = FS_XFS,
.procname = "xfs", .procname = "xfs",
.mode = 0555, .mode = 0555,
.child = xfs_table .child = xfs_table
...@@ -239,7 +208,6 @@ static ctl_table xfs_dir_table[] = { ...@@ -239,7 +208,6 @@ static ctl_table xfs_dir_table[] = {
static ctl_table xfs_root_table[] = { static ctl_table xfs_root_table[] = {
{ {
.ctl_name = CTL_FS,
.procname = "fs", .procname = "fs",
.mode = 0555, .mode = 0555,
.child = xfs_dir_table .child = xfs_dir_table
......
...@@ -15,9 +15,6 @@ ...@@ -15,9 +15,6 @@
** The kernel will then return -ENOTDIR to any application using ** The kernel will then return -ENOTDIR to any application using
** the old binary interface. ** the old binary interface.
** **
** For new interfaces unless you really need a binary number
** please use CTL_UNNUMBERED.
**
**************************************************************** ****************************************************************
**************************************************************** ****************************************************************
*/ */
...@@ -50,12 +47,6 @@ struct __sysctl_args { ...@@ -50,12 +47,6 @@ struct __sysctl_args {
/* Top-level names: */ /* Top-level names: */
/* For internal pattern-matching use only: */
#ifdef __KERNEL__
#define CTL_NONE 0
#define CTL_UNNUMBERED CTL_NONE /* sysctl without a binary number */
#endif
enum enum
{ {
CTL_KERN=1, /* General kernel info and control */ CTL_KERN=1, /* General kernel info and control */
...@@ -972,10 +963,6 @@ extern int sysctl_perm(struct ctl_table_root *root, ...@@ -972,10 +963,6 @@ extern int sysctl_perm(struct ctl_table_root *root,
typedef struct ctl_table ctl_table; typedef struct ctl_table ctl_table;
typedef int ctl_handler (struct ctl_table *table,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen);
typedef int proc_handler (struct ctl_table *ctl, int write, typedef int proc_handler (struct ctl_table *ctl, int write,
void __user *buffer, size_t *lenp, loff_t *ppos); void __user *buffer, size_t *lenp, loff_t *ppos);
...@@ -996,21 +983,10 @@ extern int proc_doulongvec_minmax(struct ctl_table *, int, ...@@ -996,21 +983,10 @@ extern int proc_doulongvec_minmax(struct ctl_table *, int,
extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int, extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int,
void __user *, size_t *, loff_t *); void __user *, size_t *, loff_t *);
extern int do_sysctl (int __user *name, int nlen,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen);
extern ctl_handler sysctl_data;
extern ctl_handler sysctl_string;
extern ctl_handler sysctl_intvec;
extern ctl_handler sysctl_jiffies;
extern ctl_handler sysctl_ms_jiffies;
/* /*
* Register a set of sysctl names by calling register_sysctl_table * Register a set of sysctl names by calling register_sysctl_table
* with an initialised array of struct ctl_table's. An entry with zero * with an initialised array of struct ctl_table's. An entry with
* ctl_name and NULL procname terminates the table. table->de will be * NULL procname terminates the table. table->de will be
* set up by the registration and need not be initialised in advance. * set up by the registration and need not be initialised in advance.
* *
* sysctl names can be mirrored automatically under /proc/sys. The * sysctl names can be mirrored automatically under /proc/sys. The
...@@ -1023,24 +999,11 @@ extern ctl_handler sysctl_ms_jiffies; ...@@ -1023,24 +999,11 @@ extern ctl_handler sysctl_ms_jiffies;
* under /proc; non-leaf nodes will be represented by directories. A * under /proc; non-leaf nodes will be represented by directories. A
* null procname disables /proc mirroring at this node. * null procname disables /proc mirroring at this node.
* *
* sysctl entries with a zero ctl_name will not be available through
* the binary sysctl interface.
*
* sysctl(2) can automatically manage read and write requests through * sysctl(2) can automatically manage read and write requests through
* the sysctl table. The data and maxlen fields of the ctl_table * the sysctl table. The data and maxlen fields of the ctl_table
* struct enable minimal validation of the values being written to be * struct enable minimal validation of the values being written to be
* performed, and the mode field allows minimal authentication. * performed, and the mode field allows minimal authentication.
* *
* More sophisticated management can be enabled by the provision of a
* strategy routine with the table entry. This will be called before
* any automatic read or write of the data is performed.
*
* The strategy routine may return:
* <0: Error occurred (error is passed to user process)
* 0: OK - proceed with automatic read or write.
* >0: OK - read or write has been done by the strategy routine, so
* return immediately.
*
* There must be a proc_handler routine for any terminal nodes * There must be a proc_handler routine for any terminal nodes
* mirrored under /proc/sys (non-terminals are handled by a built-in * mirrored under /proc/sys (non-terminals are handled by a built-in
* directory handler). Several default handlers are available to * directory handler). Several default handlers are available to
...@@ -1050,7 +1013,6 @@ extern ctl_handler sysctl_ms_jiffies; ...@@ -1050,7 +1013,6 @@ extern ctl_handler sysctl_ms_jiffies;
/* A sysctl table is an array of struct ctl_table: */ /* A sysctl table is an array of struct ctl_table: */
struct ctl_table struct ctl_table
{ {
int ctl_name; /* Binary ID */
const char *procname; /* Text ID for /proc/sys, or zero */ const char *procname; /* Text ID for /proc/sys, or zero */
void *data; void *data;
int maxlen; int maxlen;
...@@ -1058,7 +1020,6 @@ struct ctl_table ...@@ -1058,7 +1020,6 @@ struct ctl_table
struct ctl_table *child; struct ctl_table *child;
struct ctl_table *parent; /* Automatically set */ struct ctl_table *parent; /* Automatically set */
proc_handler *proc_handler; /* Callback for text formatting */ proc_handler *proc_handler; /* Callback for text formatting */
ctl_handler *strategy; /* Callback function for all r/w */
void *extra1; void *extra1;
void *extra2; void *extra2;
}; };
...@@ -1092,7 +1053,6 @@ struct ctl_table_header ...@@ -1092,7 +1053,6 @@ struct ctl_table_header
/* struct ctl_path describes where in the hierarchy a table is added */ /* struct ctl_path describes where in the hierarchy a table is added */
struct ctl_path { struct ctl_path {
const char *procname; const char *procname;
int ctl_name;
}; };
void register_sysctl_root(struct ctl_table_root *root); void register_sysctl_root(struct ctl_table_root *root);
......
...@@ -75,7 +75,6 @@ struct dn_dev_parms { ...@@ -75,7 +75,6 @@ struct dn_dev_parms {
unsigned long t3; /* Default value of t3 */ unsigned long t3; /* Default value of t3 */
int priority; /* Priority to be a router */ int priority; /* Priority to be a router */
char *name; /* Name for sysctl */ char *name; /* Name for sysctl */
int ctl_name; /* Index for sysctl */
int (*up)(struct net_device *); int (*up)(struct net_device *);
void (*down)(struct net_device *); void (*down)(struct net_device *);
void (*timer3)(struct net_device *, struct dn_ifaddr *ifa); void (*timer3)(struct net_device *, struct dn_ifaddr *ifa);
......
...@@ -264,8 +264,7 @@ extern int neigh_sysctl_register(struct net_device *dev, ...@@ -264,8 +264,7 @@ extern int neigh_sysctl_register(struct net_device *dev,
struct neigh_parms *p, struct neigh_parms *p,
int p_id, int pdev_id, int p_id, int pdev_id,
char *p_name, char *p_name,
proc_handler *proc_handler, proc_handler *proc_handler);
ctl_handler *strategy);
extern void neigh_sysctl_unregister(struct neigh_parms *p); extern void neigh_sysctl_unregister(struct neigh_parms *p);
static inline void __neigh_parms_put(struct neigh_parms *parms) static inline void __neigh_parms_put(struct neigh_parms *parms)
......
...@@ -763,6 +763,7 @@ config UID16 ...@@ -763,6 +763,7 @@ config UID16
config SYSCTL_SYSCALL config SYSCTL_SYSCALL
bool "Sysctl syscall support" if EMBEDDED bool "Sysctl syscall support" if EMBEDDED
depends on PROC_SYSCTL
default y default y
select SYSCTL select SYSCTL
---help--- ---help---
......
...@@ -129,136 +129,60 @@ static int proc_ipcauto_dointvec_minmax(ctl_table *table, int write, ...@@ -129,136 +129,60 @@ static int proc_ipcauto_dointvec_minmax(ctl_table *table, int write,
#define proc_ipcauto_dointvec_minmax NULL #define proc_ipcauto_dointvec_minmax NULL
#endif #endif
#ifdef CONFIG_SYSCTL_SYSCALL
/* The generic sysctl ipc data routine. */
static int sysctl_ipc_data(ctl_table *table,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
size_t len;
void *data;
/* Get out of I don't have a variable */
if (!table->data || !table->maxlen)
return -ENOTDIR;
data = get_ipc(table);
if (!data)
return -ENOTDIR;
if (oldval && oldlenp) {
if (get_user(len, oldlenp))
return -EFAULT;
if (len) {
if (len > table->maxlen)
len = table->maxlen;
if (copy_to_user(oldval, data, len))
return -EFAULT;
if (put_user(len, oldlenp))
return -EFAULT;
}
}
if (newval && newlen) {
if (newlen > table->maxlen)
newlen = table->maxlen;
if (copy_from_user(data, newval, newlen))
return -EFAULT;
}
return 1;
}
static int sysctl_ipc_registered_data(ctl_table *table,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
int rc;
rc = sysctl_ipc_data(table, oldval, oldlenp, newval, newlen);
if (newval && newlen && rc > 0)
/*
* Tunable has successfully been changed from userland
*/
unregister_ipcns_notifier(current->nsproxy->ipc_ns);
return rc;
}
#else
#define sysctl_ipc_data NULL
#define sysctl_ipc_registered_data NULL
#endif
static int zero; static int zero;
static int one = 1; static int one = 1;
static struct ctl_table ipc_kern_table[] = { static struct ctl_table ipc_kern_table[] = {
{ {
.ctl_name = KERN_SHMMAX,
.procname = "shmmax", .procname = "shmmax",
.data = &init_ipc_ns.shm_ctlmax, .data = &init_ipc_ns.shm_ctlmax,
.maxlen = sizeof (init_ipc_ns.shm_ctlmax), .maxlen = sizeof (init_ipc_ns.shm_ctlmax),
.mode = 0644, .mode = 0644,
.proc_handler = proc_ipc_doulongvec_minmax, .proc_handler = proc_ipc_doulongvec_minmax,
.strategy = sysctl_ipc_data,
}, },
{ {
.ctl_name = KERN_SHMALL,
.procname = "shmall", .procname = "shmall",
.data = &init_ipc_ns.shm_ctlall, .data = &init_ipc_ns.shm_ctlall,
.maxlen = sizeof (init_ipc_ns.shm_ctlall), .maxlen = sizeof (init_ipc_ns.shm_ctlall),
.mode = 0644, .mode = 0644,
.proc_handler = proc_ipc_doulongvec_minmax, .proc_handler = proc_ipc_doulongvec_minmax,
.strategy = sysctl_ipc_data,
}, },
{ {
.ctl_name = KERN_SHMMNI,
.procname = "shmmni", .procname = "shmmni",
.data = &init_ipc_ns.shm_ctlmni, .data = &init_ipc_ns.shm_ctlmni,
.maxlen = sizeof (init_ipc_ns.shm_ctlmni), .maxlen = sizeof (init_ipc_ns.shm_ctlmni),
.mode = 0644, .mode = 0644,
.proc_handler = proc_ipc_dointvec, .proc_handler = proc_ipc_dointvec,
.strategy = sysctl_ipc_data,
}, },
{ {
.ctl_name = KERN_MSGMAX,
.procname = "msgmax", .procname = "msgmax",
.data = &init_ipc_ns.msg_ctlmax, .data = &init_ipc_ns.msg_ctlmax,
.maxlen = sizeof (init_ipc_ns.msg_ctlmax), .maxlen = sizeof (init_ipc_ns.msg_ctlmax),
.mode = 0644, .mode = 0644,
.proc_handler = proc_ipc_dointvec, .proc_handler = proc_ipc_dointvec,
.strategy = sysctl_ipc_data,
}, },
{ {
.ctl_name = KERN_MSGMNI,
.procname = "msgmni", .procname = "msgmni",
.data = &init_ipc_ns.msg_ctlmni, .data = &init_ipc_ns.msg_ctlmni,
.maxlen = sizeof (init_ipc_ns.msg_ctlmni), .maxlen = sizeof (init_ipc_ns.msg_ctlmni),
.mode = 0644, .mode = 0644,
.proc_handler = proc_ipc_callback_dointvec, .proc_handler = proc_ipc_callback_dointvec,
.strategy = sysctl_ipc_registered_data,
}, },
{ {
.ctl_name = KERN_MSGMNB,
.procname = "msgmnb", .procname = "msgmnb",
.data = &init_ipc_ns.msg_ctlmnb, .data = &init_ipc_ns.msg_ctlmnb,
.maxlen = sizeof (init_ipc_ns.msg_ctlmnb), .maxlen = sizeof (init_ipc_ns.msg_ctlmnb),
.mode = 0644, .mode = 0644,
.proc_handler = proc_ipc_dointvec, .proc_handler = proc_ipc_dointvec,
.strategy = sysctl_ipc_data,
}, },
{ {
.ctl_name = KERN_SEM,
.procname = "sem", .procname = "sem",
.data = &init_ipc_ns.sem_ctls, .data = &init_ipc_ns.sem_ctls,
.maxlen = 4*sizeof (int), .maxlen = 4*sizeof (int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_ipc_dointvec, .proc_handler = proc_ipc_dointvec,
.strategy = sysctl_ipc_data,
}, },
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "auto_msgmni", .procname = "auto_msgmni",
.data = &init_ipc_ns.auto_msgmni, .data = &init_ipc_ns.auto_msgmni,
.maxlen = sizeof(int), .maxlen = sizeof(int),
...@@ -272,7 +196,6 @@ static struct ctl_table ipc_kern_table[] = { ...@@ -272,7 +196,6 @@ static struct ctl_table ipc_kern_table[] = {
static struct ctl_table ipc_root_table[] = { static struct ctl_table ipc_root_table[] = {
{ {
.ctl_name = CTL_KERN,
.procname = "kernel", .procname = "kernel",
.mode = 0555, .mode = 0555,
.child = ipc_kern_table, .child = ipc_kern_table,
......
...@@ -88,7 +88,7 @@ static ctl_table mq_sysctls[] = { ...@@ -88,7 +88,7 @@ static ctl_table mq_sysctls[] = {
.extra1 = &msg_maxsize_limit_min, .extra1 = &msg_maxsize_limit_min,
.extra2 = &msg_maxsize_limit_max, .extra2 = &msg_maxsize_limit_max,
}, },
{ .ctl_name = 0 } {}
}; };
static ctl_table mq_sysctl_dir[] = { static ctl_table mq_sysctl_dir[] = {
...@@ -97,17 +97,16 @@ static ctl_table mq_sysctl_dir[] = { ...@@ -97,17 +97,16 @@ static ctl_table mq_sysctl_dir[] = {
.mode = 0555, .mode = 0555,
.child = mq_sysctls, .child = mq_sysctls,
}, },
{ .ctl_name = 0 } {}
}; };
static ctl_table mq_sysctl_root[] = { static ctl_table mq_sysctl_root[] = {
{ {
.ctl_name = CTL_FS,
.procname = "fs", .procname = "fs",
.mode = 0555, .mode = 0555,
.child = mq_sysctl_dir, .child = mq_sysctl_dir,
}, },
{ .ctl_name = 0 } {}
}; };
struct ctl_table_header *mq_register_sysctl_table(void) struct ctl_table_header *mq_register_sysctl_table(void)
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
obj-y = sched.o fork.o exec_domain.o panic.o printk.o \ obj-y = sched.o fork.o exec_domain.o panic.o printk.o \
cpu.o exit.o itimer.o time.o softirq.o resource.o \ cpu.o exit.o itimer.o time.o softirq.o resource.o \
sysctl.o capability.o ptrace.o timer.o user.o \ sysctl.o sysctl_binary.o capability.o ptrace.o timer.o user.o \
signal.o sys.o kmod.o workqueue.o pid.o \ signal.o sys.o kmod.o workqueue.o pid.o \
rcupdate.o extable.o params.o posix-timers.o \ rcupdate.o extable.o params.o posix-timers.o \
kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \ kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \
......
...@@ -7444,17 +7444,16 @@ static struct ctl_table sd_ctl_dir[] = { ...@@ -7444,17 +7444,16 @@ static struct ctl_table sd_ctl_dir[] = {
.procname = "sched_domain", .procname = "sched_domain",
.mode = 0555, .mode = 0555,
}, },
{0, }, {}
}; };
static struct ctl_table sd_ctl_root[] = { static struct ctl_table sd_ctl_root[] = {
{ {
.ctl_name = CTL_KERN,
.procname = "kernel", .procname = "kernel",
.mode = 0555, .mode = 0555,
.child = sd_ctl_dir, .child = sd_ctl_dir,
}, },
{0, }, {}
}; };
static struct ctl_table *sd_alloc_ctl_entry(int n) static struct ctl_table *sd_alloc_ctl_entry(int n)
......
...@@ -49,7 +49,6 @@ static const int slow_work_max_vslow = 99; ...@@ -49,7 +49,6 @@ static const int slow_work_max_vslow = 99;
ctl_table slow_work_sysctls[] = { ctl_table slow_work_sysctls[] = {
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "min-threads", .procname = "min-threads",
.data = &slow_work_min_threads, .data = &slow_work_min_threads,
.maxlen = sizeof(unsigned), .maxlen = sizeof(unsigned),
...@@ -59,7 +58,6 @@ ctl_table slow_work_sysctls[] = { ...@@ -59,7 +58,6 @@ ctl_table slow_work_sysctls[] = {
.extra2 = &slow_work_max_threads, .extra2 = &slow_work_max_threads,
}, },
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "max-threads", .procname = "max-threads",
.data = &slow_work_max_threads, .data = &slow_work_max_threads,
.maxlen = sizeof(unsigned), .maxlen = sizeof(unsigned),
...@@ -69,16 +67,15 @@ ctl_table slow_work_sysctls[] = { ...@@ -69,16 +67,15 @@ ctl_table slow_work_sysctls[] = {
.extra2 = (void *) &slow_work_max_max_threads, .extra2 = (void *) &slow_work_max_max_threads,
}, },
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "vslow-percentage", .procname = "vslow-percentage",
.data = &vslow_work_proportion, .data = &vslow_work_proportion,
.maxlen = sizeof(unsigned), .maxlen = sizeof(unsigned),
.mode = 0644, .mode = 0644,
.proc_handler = &proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.extra1 = (void *) &slow_work_min_vslow, .extra1 = (void *) &slow_work_min_vslow,
.extra2 = (void *) &slow_work_max_vslow, .extra2 = (void *) &slow_work_max_vslow,
}, },
{ .ctl_name = 0 } {}
}; };
#endif #endif
......
...@@ -139,7 +139,6 @@ cond_syscall(sys_pciconfig_read); ...@@ -139,7 +139,6 @@ cond_syscall(sys_pciconfig_read);
cond_syscall(sys_pciconfig_write); cond_syscall(sys_pciconfig_write);
cond_syscall(sys_pciconfig_iobase); cond_syscall(sys_pciconfig_iobase);
cond_syscall(sys32_ipc); cond_syscall(sys32_ipc);
cond_syscall(sys32_sysctl);
cond_syscall(ppc_rtas); cond_syscall(ppc_rtas);
cond_syscall(sys_spu_run); cond_syscall(sys_spu_run);
cond_syscall(sys_spu_create); cond_syscall(sys_spu_create);
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
...@@ -57,78 +57,47 @@ static int proc_do_uts_string(ctl_table *table, int write, ...@@ -57,78 +57,47 @@ static int proc_do_uts_string(ctl_table *table, int write,
#define proc_do_uts_string NULL #define proc_do_uts_string NULL
#endif #endif
#ifdef CONFIG_SYSCTL_SYSCALL
/* The generic string strategy routine: */
static int sysctl_uts_string(ctl_table *table,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
struct ctl_table uts_table;
int r, write;
write = newval && newlen;
memcpy(&uts_table, table, sizeof(uts_table));
uts_table.data = get_uts(table, write);
r = sysctl_string(&uts_table, oldval, oldlenp, newval, newlen);
put_uts(table, write, uts_table.data);
return r;
}
#else
#define sysctl_uts_string NULL
#endif
static struct ctl_table uts_kern_table[] = { static struct ctl_table uts_kern_table[] = {
{ {
.ctl_name = KERN_OSTYPE,
.procname = "ostype", .procname = "ostype",
.data = init_uts_ns.name.sysname, .data = init_uts_ns.name.sysname,
.maxlen = sizeof(init_uts_ns.name.sysname), .maxlen = sizeof(init_uts_ns.name.sysname),
.mode = 0444, .mode = 0444,
.proc_handler = proc_do_uts_string, .proc_handler = proc_do_uts_string,
.strategy = sysctl_uts_string,
}, },
{ {
.ctl_name = KERN_OSRELEASE,
.procname = "osrelease", .procname = "osrelease",
.data = init_uts_ns.name.release, .data = init_uts_ns.name.release,
.maxlen = sizeof(init_uts_ns.name.release), .maxlen = sizeof(init_uts_ns.name.release),
.mode = 0444, .mode = 0444,
.proc_handler = proc_do_uts_string, .proc_handler = proc_do_uts_string,
.strategy = sysctl_uts_string,
}, },
{ {
.ctl_name = KERN_VERSION,
.procname = "version", .procname = "version",
.data = init_uts_ns.name.version, .data = init_uts_ns.name.version,
.maxlen = sizeof(init_uts_ns.name.version), .maxlen = sizeof(init_uts_ns.name.version),
.mode = 0444, .mode = 0444,
.proc_handler = proc_do_uts_string, .proc_handler = proc_do_uts_string,
.strategy = sysctl_uts_string,
}, },
{ {
.ctl_name = KERN_NODENAME,
.procname = "hostname", .procname = "hostname",
.data = init_uts_ns.name.nodename, .data = init_uts_ns.name.nodename,
.maxlen = sizeof(init_uts_ns.name.nodename), .maxlen = sizeof(init_uts_ns.name.nodename),
.mode = 0644, .mode = 0644,
.proc_handler = proc_do_uts_string, .proc_handler = proc_do_uts_string,
.strategy = sysctl_uts_string,
}, },
{ {
.ctl_name = KERN_DOMAINNAME,
.procname = "domainname", .procname = "domainname",
.data = init_uts_ns.name.domainname, .data = init_uts_ns.name.domainname,
.maxlen = sizeof(init_uts_ns.name.domainname), .maxlen = sizeof(init_uts_ns.name.domainname),
.mode = 0644, .mode = 0644,
.proc_handler = proc_do_uts_string, .proc_handler = proc_do_uts_string,
.strategy = sysctl_uts_string,
}, },
{} {}
}; };
static struct ctl_table uts_root_table[] = { static struct ctl_table uts_root_table[] = {
{ {
.ctl_name = CTL_KERN,
.procname = "kernel", .procname = "kernel",
.mode = 0555, .mode = 0555,
.child = uts_kern_table, .child = uts_kern_table,
......
...@@ -912,7 +912,7 @@ config LATENCYTOP ...@@ -912,7 +912,7 @@ config LATENCYTOP
config SYSCTL_SYSCALL_CHECK config SYSCTL_SYSCALL_CHECK
bool "Sysctl checks" bool "Sysctl checks"
depends on SYSCTL_SYSCALL depends on SYSCTL
---help--- ---help---
sys_sysctl uses binary paths that have been found challenging sys_sysctl uses binary paths that have been found challenging
to properly maintain and use. This enables checks that help to properly maintain and use. This enables checks that help
......
...@@ -635,19 +635,18 @@ struct net_device *alloc_trdev(int sizeof_priv) ...@@ -635,19 +635,18 @@ struct net_device *alloc_trdev(int sizeof_priv)
#ifdef CONFIG_SYSCTL #ifdef CONFIG_SYSCTL
static struct ctl_table tr_table[] = { static struct ctl_table tr_table[] = {
{ {
.ctl_name = NET_TR_RIF_TIMEOUT,
.procname = "rif_timeout", .procname = "rif_timeout",
.data = &sysctl_tr_rif_timeout, .data = &sysctl_tr_rif_timeout,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dointvec
}, },
{ 0 }, { },
}; };
static __initdata struct ctl_path tr_path[] = { static __initdata struct ctl_path tr_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, }, { .procname = "net", },
{ .procname = "token-ring", .ctl_name = NET_TR, }, { .procname = "token-ring", },
{ } { }
}; };
#endif #endif
......
...@@ -12,25 +12,20 @@ ...@@ -12,25 +12,20 @@
static struct ctl_table atalk_table[] = { static struct ctl_table atalk_table[] = {
{ {
.ctl_name = NET_ATALK_AARP_EXPIRY_TIME,
.procname = "aarp-expiry-time", .procname = "aarp-expiry-time",
.data = &sysctl_aarp_expiry_time, .data = &sysctl_aarp_expiry_time,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_jiffies, .proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
}, },
{ {
.ctl_name = NET_ATALK_AARP_TICK_TIME,
.procname = "aarp-tick-time", .procname = "aarp-tick-time",
.data = &sysctl_aarp_tick_time, .data = &sysctl_aarp_tick_time,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_jiffies, .proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
}, },
{ {
.ctl_name = NET_ATALK_AARP_RETRANSMIT_LIMIT,
.procname = "aarp-retransmit-limit", .procname = "aarp-retransmit-limit",
.data = &sysctl_aarp_retransmit_limit, .data = &sysctl_aarp_retransmit_limit,
.maxlen = sizeof(int), .maxlen = sizeof(int),
...@@ -38,20 +33,18 @@ static struct ctl_table atalk_table[] = { ...@@ -38,20 +33,18 @@ static struct ctl_table atalk_table[] = {
.proc_handler = proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ {
.ctl_name = NET_ATALK_AARP_RESOLVE_TIME,
.procname = "aarp-resolve-time", .procname = "aarp-resolve-time",
.data = &sysctl_aarp_resolve_time, .data = &sysctl_aarp_resolve_time,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_jiffies, .proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
}, },
{ 0 }, { },
}; };
static struct ctl_path atalk_path[] = { static struct ctl_path atalk_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, }, { .procname = "net", },
{ .procname = "appletalk", .ctl_name = NET_ATALK, }, { .procname = "appletalk", },
{ } { }
}; };
......
...@@ -34,156 +34,128 @@ static ctl_table *ax25_table; ...@@ -34,156 +34,128 @@ static ctl_table *ax25_table;
static int ax25_table_size; static int ax25_table_size;
static struct ctl_path ax25_path[] = { static struct ctl_path ax25_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, }, { .procname = "net", },
{ .procname = "ax25", .ctl_name = NET_AX25, }, { .procname = "ax25", },
{ } { }
}; };
static const ctl_table ax25_param_table[] = { static const ctl_table ax25_param_table[] = {
{ {
.ctl_name = NET_AX25_IP_DEFAULT_MODE,
.procname = "ip_default_mode", .procname = "ip_default_mode",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_ipdefmode, .extra1 = &min_ipdefmode,
.extra2 = &max_ipdefmode .extra2 = &max_ipdefmode
}, },
{ {
.ctl_name = NET_AX25_DEFAULT_MODE,
.procname = "ax25_default_mode", .procname = "ax25_default_mode",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_axdefmode, .extra1 = &min_axdefmode,
.extra2 = &max_axdefmode .extra2 = &max_axdefmode
}, },
{ {
.ctl_name = NET_AX25_BACKOFF_TYPE,
.procname = "backoff_type", .procname = "backoff_type",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_backoff, .extra1 = &min_backoff,
.extra2 = &max_backoff .extra2 = &max_backoff
}, },
{ {
.ctl_name = NET_AX25_CONNECT_MODE,
.procname = "connect_mode", .procname = "connect_mode",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_conmode, .extra1 = &min_conmode,
.extra2 = &max_conmode .extra2 = &max_conmode
}, },
{ {
.ctl_name = NET_AX25_STANDARD_WINDOW,
.procname = "standard_window_size", .procname = "standard_window_size",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_window, .extra1 = &min_window,
.extra2 = &max_window .extra2 = &max_window
}, },
{ {
.ctl_name = NET_AX25_EXTENDED_WINDOW,
.procname = "extended_window_size", .procname = "extended_window_size",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_ewindow, .extra1 = &min_ewindow,
.extra2 = &max_ewindow .extra2 = &max_ewindow
}, },
{ {
.ctl_name = NET_AX25_T1_TIMEOUT,
.procname = "t1_timeout", .procname = "t1_timeout",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_t1, .extra1 = &min_t1,
.extra2 = &max_t1 .extra2 = &max_t1
}, },
{ {
.ctl_name = NET_AX25_T2_TIMEOUT,
.procname = "t2_timeout", .procname = "t2_timeout",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_t2, .extra1 = &min_t2,
.extra2 = &max_t2 .extra2 = &max_t2
}, },
{ {
.ctl_name = NET_AX25_T3_TIMEOUT,
.procname = "t3_timeout", .procname = "t3_timeout",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_t3, .extra1 = &min_t3,
.extra2 = &max_t3 .extra2 = &max_t3
}, },
{ {
.ctl_name = NET_AX25_IDLE_TIMEOUT,
.procname = "idle_timeout", .procname = "idle_timeout",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_idle, .extra1 = &min_idle,
.extra2 = &max_idle .extra2 = &max_idle
}, },
{ {
.ctl_name = NET_AX25_N2,
.procname = "maximum_retry_count", .procname = "maximum_retry_count",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_n2, .extra1 = &min_n2,
.extra2 = &max_n2 .extra2 = &max_n2
}, },
{ {
.ctl_name = NET_AX25_PACLEN,
.procname = "maximum_packet_length", .procname = "maximum_packet_length",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_paclen, .extra1 = &min_paclen,
.extra2 = &max_paclen .extra2 = &max_paclen
}, },
{ {
.ctl_name = NET_AX25_PROTOCOL,
.procname = "protocol", .procname = "protocol",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_proto, .extra1 = &min_proto,
.extra2 = &max_proto .extra2 = &max_proto
}, },
#ifdef CONFIG_AX25_DAMA_SLAVE #ifdef CONFIG_AX25_DAMA_SLAVE
{ {
.ctl_name = NET_AX25_DAMA_SLAVE_TIMEOUT,
.procname = "dama_slave_timeout", .procname = "dama_slave_timeout",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_ds_timeout, .extra1 = &min_ds_timeout,
.extra2 = &max_ds_timeout .extra2 = &max_ds_timeout
}, },
#endif #endif
{ .ctl_name = 0 } /* that's all, folks! */ { } /* that's all, folks! */
}; };
void ax25_register_sysctl(void) void ax25_register_sysctl(void)
...@@ -212,11 +184,9 @@ void ax25_register_sysctl(void) ...@@ -212,11 +184,9 @@ void ax25_register_sysctl(void)
return; return;
} }
ax25_table[n].child = ax25_dev->systable = child; ax25_table[n].child = ax25_dev->systable = child;
ax25_table[n].ctl_name = n + 1;
ax25_table[n].procname = ax25_dev->dev->name; ax25_table[n].procname = ax25_dev->dev->name;
ax25_table[n].mode = 0555; ax25_table[n].mode = 0555;
child[AX25_MAX_VALUES].ctl_name = 0; /* just in case... */
for (k = 0; k < AX25_MAX_VALUES; k++) for (k = 0; k < AX25_MAX_VALUES; k++)
child[k].data = &ax25_dev->values[k]; child[k].data = &ax25_dev->values[k];
...@@ -233,7 +203,7 @@ void ax25_unregister_sysctl(void) ...@@ -233,7 +203,7 @@ void ax25_unregister_sysctl(void)
ctl_table *p; ctl_table *p;
unregister_sysctl_table(ax25_table_header); unregister_sysctl_table(ax25_table_header);
for (p = ax25_table; p->ctl_name; p++) for (p = ax25_table; p->procname; p++)
kfree(p->child); kfree(p->child);
kfree(ax25_table); kfree(ax25_table);
} }
...@@ -1013,12 +1013,12 @@ static ctl_table brnf_table[] = { ...@@ -1013,12 +1013,12 @@ static ctl_table brnf_table[] = {
.mode = 0644, .mode = 0644,
.proc_handler = brnf_sysctl_call_tables, .proc_handler = brnf_sysctl_call_tables,
}, },
{ .ctl_name = 0 } { }
}; };
static struct ctl_path brnf_path[] = { static struct ctl_path brnf_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, }, { .procname = "net", },
{ .procname = "bridge", .ctl_name = NET_BRIDGE, }, { .procname = "bridge", },
{ } { }
}; };
#endif #endif
......
...@@ -2566,21 +2566,18 @@ static struct neigh_sysctl_table { ...@@ -2566,21 +2566,18 @@ static struct neigh_sysctl_table {
} neigh_sysctl_template __read_mostly = { } neigh_sysctl_template __read_mostly = {
.neigh_vars = { .neigh_vars = {
{ {
.ctl_name = NET_NEIGH_MCAST_SOLICIT,
.procname = "mcast_solicit", .procname = "mcast_solicit",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ {
.ctl_name = NET_NEIGH_UCAST_SOLICIT,
.procname = "ucast_solicit", .procname = "ucast_solicit",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ {
.ctl_name = NET_NEIGH_APP_SOLICIT,
.procname = "app_solicit", .procname = "app_solicit",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
...@@ -2593,38 +2590,30 @@ static struct neigh_sysctl_table { ...@@ -2593,38 +2590,30 @@ static struct neigh_sysctl_table {
.proc_handler = proc_dointvec_userhz_jiffies, .proc_handler = proc_dointvec_userhz_jiffies,
}, },
{ {
.ctl_name = NET_NEIGH_REACHABLE_TIME,
.procname = "base_reachable_time", .procname = "base_reachable_time",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_jiffies, .proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
}, },
{ {
.ctl_name = NET_NEIGH_DELAY_PROBE_TIME,
.procname = "delay_first_probe_time", .procname = "delay_first_probe_time",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_jiffies, .proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
}, },
{ {
.ctl_name = NET_NEIGH_GC_STALE_TIME,
.procname = "gc_stale_time", .procname = "gc_stale_time",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_jiffies, .proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
}, },
{ {
.ctl_name = NET_NEIGH_UNRES_QLEN,
.procname = "unres_qlen", .procname = "unres_qlen",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ {
.ctl_name = NET_NEIGH_PROXY_QLEN,
.procname = "proxy_qlen", .procname = "proxy_qlen",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
...@@ -2649,45 +2638,36 @@ static struct neigh_sysctl_table { ...@@ -2649,45 +2638,36 @@ static struct neigh_sysctl_table {
.proc_handler = proc_dointvec_userhz_jiffies, .proc_handler = proc_dointvec_userhz_jiffies,
}, },
{ {
.ctl_name = NET_NEIGH_RETRANS_TIME_MS,
.procname = "retrans_time_ms", .procname = "retrans_time_ms",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_ms_jiffies, .proc_handler = proc_dointvec_ms_jiffies,
.strategy = sysctl_ms_jiffies,
}, },
{ {
.ctl_name = NET_NEIGH_REACHABLE_TIME_MS,
.procname = "base_reachable_time_ms", .procname = "base_reachable_time_ms",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_ms_jiffies, .proc_handler = proc_dointvec_ms_jiffies,
.strategy = sysctl_ms_jiffies,
}, },
{ {
.ctl_name = NET_NEIGH_GC_INTERVAL,
.procname = "gc_interval", .procname = "gc_interval",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_jiffies, .proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
}, },
{ {
.ctl_name = NET_NEIGH_GC_THRESH1,
.procname = "gc_thresh1", .procname = "gc_thresh1",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ {
.ctl_name = NET_NEIGH_GC_THRESH2,
.procname = "gc_thresh2", .procname = "gc_thresh2",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ {
.ctl_name = NET_NEIGH_GC_THRESH3,
.procname = "gc_thresh3", .procname = "gc_thresh3",
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
...@@ -2699,7 +2679,7 @@ static struct neigh_sysctl_table { ...@@ -2699,7 +2679,7 @@ static struct neigh_sysctl_table {
int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
int p_id, int pdev_id, char *p_name, int p_id, int pdev_id, char *p_name,
proc_handler *handler, ctl_handler *strategy) proc_handler *handler)
{ {
struct neigh_sysctl_table *t; struct neigh_sysctl_table *t;
const char *dev_name_source = NULL; const char *dev_name_source = NULL;
...@@ -2710,10 +2690,10 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, ...@@ -2710,10 +2690,10 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
#define NEIGH_CTL_PATH_DEV 3 #define NEIGH_CTL_PATH_DEV 3
struct ctl_path neigh_path[] = { struct ctl_path neigh_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, }, { .procname = "net", },
{ .procname = "proto", .ctl_name = 0, }, { .procname = "proto", },
{ .procname = "neigh", .ctl_name = 0, }, { .procname = "neigh", },
{ .procname = "default", .ctl_name = NET_PROTO_CONF_DEFAULT, }, { .procname = "default", },
{ }, { },
}; };
...@@ -2738,7 +2718,6 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, ...@@ -2738,7 +2718,6 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
if (dev) { if (dev) {
dev_name_source = dev->name; dev_name_source = dev->name;
neigh_path[NEIGH_CTL_PATH_DEV].ctl_name = dev->ifindex;
/* Terminate the table early */ /* Terminate the table early */
memset(&t->neigh_vars[14], 0, sizeof(t->neigh_vars[14])); memset(&t->neigh_vars[14], 0, sizeof(t->neigh_vars[14]));
} else { } else {
...@@ -2750,31 +2729,19 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p, ...@@ -2750,31 +2729,19 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
} }
if (handler || strategy) { if (handler) {
/* RetransTime */ /* RetransTime */
t->neigh_vars[3].proc_handler = handler; t->neigh_vars[3].proc_handler = handler;
t->neigh_vars[3].strategy = strategy;
t->neigh_vars[3].extra1 = dev; t->neigh_vars[3].extra1 = dev;
if (!strategy)
t->neigh_vars[3].ctl_name = CTL_UNNUMBERED;
/* ReachableTime */ /* ReachableTime */
t->neigh_vars[4].proc_handler = handler; t->neigh_vars[4].proc_handler = handler;
t->neigh_vars[4].strategy = strategy;
t->neigh_vars[4].extra1 = dev; t->neigh_vars[4].extra1 = dev;
if (!strategy)
t->neigh_vars[4].ctl_name = CTL_UNNUMBERED;
/* RetransTime (in milliseconds)*/ /* RetransTime (in milliseconds)*/
t->neigh_vars[12].proc_handler = handler; t->neigh_vars[12].proc_handler = handler;
t->neigh_vars[12].strategy = strategy;
t->neigh_vars[12].extra1 = dev; t->neigh_vars[12].extra1 = dev;
if (!strategy)
t->neigh_vars[12].ctl_name = CTL_UNNUMBERED;
/* ReachableTime (in milliseconds) */ /* ReachableTime (in milliseconds) */
t->neigh_vars[13].proc_handler = handler; t->neigh_vars[13].proc_handler = handler;
t->neigh_vars[13].strategy = strategy;
t->neigh_vars[13].extra1 = dev; t->neigh_vars[13].extra1 = dev;
if (!strategy)
t->neigh_vars[13].ctl_name = CTL_UNNUMBERED;
} }
t->dev_name = kstrdup(dev_name_source, GFP_KERNEL); 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,9 +2749,7 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
goto free; goto free;
neigh_path[NEIGH_CTL_PATH_DEV].procname = t->dev_name; neigh_path[NEIGH_CTL_PATH_DEV].procname = t->dev_name;
neigh_path[NEIGH_CTL_PATH_NEIGH].ctl_name = pdev_id;
neigh_path[NEIGH_CTL_PATH_PROTO].procname = p_name; neigh_path[NEIGH_CTL_PATH_PROTO].procname = p_name;
neigh_path[NEIGH_CTL_PATH_PROTO].ctl_name = p_id;
t->sysctl_header = t->sysctl_header =
register_net_sysctl_table(neigh_parms_net(p), neigh_path, t->neigh_vars); register_net_sysctl_table(neigh_parms_net(p), neigh_path, t->neigh_vars);
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
static struct ctl_table net_core_table[] = { static struct ctl_table net_core_table[] = {
#ifdef CONFIG_NET #ifdef CONFIG_NET
{ {
.ctl_name = NET_CORE_WMEM_MAX,
.procname = "wmem_max", .procname = "wmem_max",
.data = &sysctl_wmem_max, .data = &sysctl_wmem_max,
.maxlen = sizeof(int), .maxlen = sizeof(int),
...@@ -27,7 +26,6 @@ static struct ctl_table net_core_table[] = { ...@@ -27,7 +26,6 @@ static struct ctl_table net_core_table[] = {
.proc_handler = proc_dointvec .proc_handler = proc_dointvec
}, },
{ {
.ctl_name = NET_CORE_RMEM_MAX,
.procname = "rmem_max", .procname = "rmem_max",
.data = &sysctl_rmem_max, .data = &sysctl_rmem_max,
.maxlen = sizeof(int), .maxlen = sizeof(int),
...@@ -35,7 +33,6 @@ static struct ctl_table net_core_table[] = { ...@@ -35,7 +33,6 @@ static struct ctl_table net_core_table[] = {
.proc_handler = proc_dointvec .proc_handler = proc_dointvec
}, },
{ {
.ctl_name = NET_CORE_WMEM_DEFAULT,
.procname = "wmem_default", .procname = "wmem_default",
.data = &sysctl_wmem_default, .data = &sysctl_wmem_default,
.maxlen = sizeof(int), .maxlen = sizeof(int),
...@@ -43,7 +40,6 @@ static struct ctl_table net_core_table[] = { ...@@ -43,7 +40,6 @@ static struct ctl_table net_core_table[] = {
.proc_handler = proc_dointvec .proc_handler = proc_dointvec
}, },
{ {
.ctl_name = NET_CORE_RMEM_DEFAULT,
.procname = "rmem_default", .procname = "rmem_default",
.data = &sysctl_rmem_default, .data = &sysctl_rmem_default,
.maxlen = sizeof(int), .maxlen = sizeof(int),
...@@ -51,7 +47,6 @@ static struct ctl_table net_core_table[] = { ...@@ -51,7 +47,6 @@ static struct ctl_table net_core_table[] = {
.proc_handler = proc_dointvec .proc_handler = proc_dointvec
}, },
{ {
.ctl_name = NET_CORE_DEV_WEIGHT,
.procname = "dev_weight", .procname = "dev_weight",
.data = &weight_p, .data = &weight_p,
.maxlen = sizeof(int), .maxlen = sizeof(int),
...@@ -59,7 +54,6 @@ static struct ctl_table net_core_table[] = { ...@@ -59,7 +54,6 @@ static struct ctl_table net_core_table[] = {
.proc_handler = proc_dointvec .proc_handler = proc_dointvec
}, },
{ {
.ctl_name = NET_CORE_MAX_BACKLOG,
.procname = "netdev_max_backlog", .procname = "netdev_max_backlog",
.data = &netdev_max_backlog, .data = &netdev_max_backlog,
.maxlen = sizeof(int), .maxlen = sizeof(int),
...@@ -67,16 +61,13 @@ static struct ctl_table net_core_table[] = { ...@@ -67,16 +61,13 @@ static struct ctl_table net_core_table[] = {
.proc_handler = proc_dointvec .proc_handler = proc_dointvec
}, },
{ {
.ctl_name = NET_CORE_MSG_COST,
.procname = "message_cost", .procname = "message_cost",
.data = &net_ratelimit_state.interval, .data = &net_ratelimit_state.interval,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_jiffies, .proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies,
}, },
{ {
.ctl_name = NET_CORE_MSG_BURST,
.procname = "message_burst", .procname = "message_burst",
.data = &net_ratelimit_state.burst, .data = &net_ratelimit_state.burst,
.maxlen = sizeof(int), .maxlen = sizeof(int),
...@@ -84,7 +75,6 @@ static struct ctl_table net_core_table[] = { ...@@ -84,7 +75,6 @@ static struct ctl_table net_core_table[] = {
.proc_handler = proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ {
.ctl_name = NET_CORE_OPTMEM_MAX,
.procname = "optmem_max", .procname = "optmem_max",
.data = &sysctl_optmem_max, .data = &sysctl_optmem_max,
.maxlen = sizeof(int), .maxlen = sizeof(int),
...@@ -93,7 +83,6 @@ static struct ctl_table net_core_table[] = { ...@@ -93,7 +83,6 @@ static struct ctl_table net_core_table[] = {
}, },
#endif /* CONFIG_NET */ #endif /* CONFIG_NET */
{ {
.ctl_name = NET_CORE_BUDGET,
.procname = "netdev_budget", .procname = "netdev_budget",
.data = &netdev_budget, .data = &netdev_budget,
.maxlen = sizeof(int), .maxlen = sizeof(int),
...@@ -101,31 +90,29 @@ static struct ctl_table net_core_table[] = { ...@@ -101,31 +90,29 @@ static struct ctl_table net_core_table[] = {
.proc_handler = proc_dointvec .proc_handler = proc_dointvec
}, },
{ {
.ctl_name = NET_CORE_WARNINGS,
.procname = "warnings", .procname = "warnings",
.data = &net_msg_warn, .data = &net_msg_warn,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dointvec
}, },
{ .ctl_name = 0 } { }
}; };
static struct ctl_table netns_core_table[] = { static struct ctl_table netns_core_table[] = {
{ {
.ctl_name = NET_CORE_SOMAXCONN,
.procname = "somaxconn", .procname = "somaxconn",
.data = &init_net.core.sysctl_somaxconn, .data = &init_net.core.sysctl_somaxconn,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dointvec
}, },
{ .ctl_name = 0 } { }
}; };
__net_initdata struct ctl_path net_core_path[] = { __net_initdata struct ctl_path net_core_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, }, { .procname = "net", },
{ .procname = "core", .ctl_name = NET_CORE, }, { .procname = "core", },
{ }, { },
}; };
......
...@@ -93,13 +93,13 @@ static struct ctl_table dccp_default_table[] = { ...@@ -93,13 +93,13 @@ static struct ctl_table dccp_default_table[] = {
.proc_handler = proc_dointvec_ms_jiffies, .proc_handler = proc_dointvec_ms_jiffies,
}, },
{ .ctl_name = 0, } { }
}; };
static struct ctl_path dccp_path[] = { static struct ctl_path dccp_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, }, { .procname = "net", },
{ .procname = "dccp", .ctl_name = NET_DCCP, }, { .procname = "dccp", },
{ .procname = "default", .ctl_name = NET_DCCP_DEFAULT, }, { .procname = "default", },
{ } { }
}; };
......
...@@ -89,7 +89,6 @@ static struct dn_dev_parms dn_dev_list[] = { ...@@ -89,7 +89,6 @@ static struct dn_dev_parms dn_dev_list[] = {
.t2 = 1, .t2 = 1,
.t3 = 10, .t3 = 10,
.name = "ethernet", .name = "ethernet",
.ctl_name = NET_DECNET_CONF_ETHER,
.up = dn_eth_up, .up = dn_eth_up,
.down = dn_eth_down, .down = dn_eth_down,
.timer3 = dn_send_brd_hello, .timer3 = dn_send_brd_hello,
...@@ -101,7 +100,6 @@ static struct dn_dev_parms dn_dev_list[] = { ...@@ -101,7 +100,6 @@ static struct dn_dev_parms dn_dev_list[] = {
.t2 = 1, .t2 = 1,
.t3 = 10, .t3 = 10,
.name = "ipgre", .name = "ipgre",
.ctl_name = NET_DECNET_CONF_GRE,
.timer3 = dn_send_brd_hello, .timer3 = dn_send_brd_hello,
}, },
#if 0 #if 0
...@@ -112,7 +110,6 @@ static struct dn_dev_parms dn_dev_list[] = { ...@@ -112,7 +110,6 @@ static struct dn_dev_parms dn_dev_list[] = {
.t2 = 1, .t2 = 1,
.t3 = 120, .t3 = 120,
.name = "x25", .name = "x25",
.ctl_name = NET_DECNET_CONF_X25,
.timer3 = dn_send_ptp_hello, .timer3 = dn_send_ptp_hello,
}, },
#endif #endif
...@@ -124,7 +121,6 @@ static struct dn_dev_parms dn_dev_list[] = { ...@@ -124,7 +121,6 @@ static struct dn_dev_parms dn_dev_list[] = {
.t2 = 1, .t2 = 1,
.t3 = 10, .t3 = 10,
.name = "ppp", .name = "ppp",
.ctl_name = NET_DECNET_CONF_PPP,
.timer3 = dn_send_brd_hello, .timer3 = dn_send_brd_hello,
}, },
#endif #endif
...@@ -135,7 +131,6 @@ static struct dn_dev_parms dn_dev_list[] = { ...@@ -135,7 +131,6 @@ static struct dn_dev_parms dn_dev_list[] = {
.t2 = 1, .t2 = 1,
.t3 = 120, .t3 = 120,
.name = "ddcmp", .name = "ddcmp",
.ctl_name = NET_DECNET_CONF_DDCMP,
.timer3 = dn_send_ptp_hello, .timer3 = dn_send_ptp_hello,
}, },
{ {
...@@ -145,7 +140,6 @@ static struct dn_dev_parms dn_dev_list[] = { ...@@ -145,7 +140,6 @@ static struct dn_dev_parms dn_dev_list[] = {
.t2 = 1, .t2 = 1,
.t3 = 10, .t3 = 10,
.name = "loopback", .name = "loopback",
.ctl_name = NET_DECNET_CONF_LOOPBACK,
.timer3 = dn_send_brd_hello, .timer3 = dn_send_brd_hello,
} }
}; };
...@@ -166,10 +160,6 @@ static int max_priority[] = { 127 }; /* From DECnet spec */ ...@@ -166,10 +160,6 @@ static int max_priority[] = { 127 }; /* From DECnet spec */
static int dn_forwarding_proc(ctl_table *, int, static int dn_forwarding_proc(ctl_table *, int,
void __user *, size_t *, loff_t *); void __user *, size_t *, loff_t *);
static int dn_forwarding_sysctl(ctl_table *table,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen);
static struct dn_dev_sysctl_table { static struct dn_dev_sysctl_table {
struct ctl_table_header *sysctl_header; struct ctl_table_header *sysctl_header;
ctl_table dn_dev_vars[5]; ctl_table dn_dev_vars[5];
...@@ -177,44 +167,36 @@ static struct dn_dev_sysctl_table { ...@@ -177,44 +167,36 @@ static struct dn_dev_sysctl_table {
NULL, NULL,
{ {
{ {
.ctl_name = NET_DECNET_CONF_DEV_FORWARDING,
.procname = "forwarding", .procname = "forwarding",
.data = (void *)DN_DEV_PARMS_OFFSET(forwarding), .data = (void *)DN_DEV_PARMS_OFFSET(forwarding),
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = dn_forwarding_proc, .proc_handler = dn_forwarding_proc,
.strategy = dn_forwarding_sysctl,
}, },
{ {
.ctl_name = NET_DECNET_CONF_DEV_PRIORITY,
.procname = "priority", .procname = "priority",
.data = (void *)DN_DEV_PARMS_OFFSET(priority), .data = (void *)DN_DEV_PARMS_OFFSET(priority),
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_priority, .extra1 = &min_priority,
.extra2 = &max_priority .extra2 = &max_priority
}, },
{ {
.ctl_name = NET_DECNET_CONF_DEV_T2,
.procname = "t2", .procname = "t2",
.data = (void *)DN_DEV_PARMS_OFFSET(t2), .data = (void *)DN_DEV_PARMS_OFFSET(t2),
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_t2, .extra1 = &min_t2,
.extra2 = &max_t2 .extra2 = &max_t2
}, },
{ {
.ctl_name = NET_DECNET_CONF_DEV_T3,
.procname = "t3", .procname = "t3",
.data = (void *)DN_DEV_PARMS_OFFSET(t3), .data = (void *)DN_DEV_PARMS_OFFSET(t3),
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_t3, .extra1 = &min_t3,
.extra2 = &max_t3 .extra2 = &max_t3
}, },
...@@ -230,9 +212,9 @@ static void dn_dev_sysctl_register(struct net_device *dev, struct dn_dev_parms * ...@@ -230,9 +212,9 @@ static void dn_dev_sysctl_register(struct net_device *dev, struct dn_dev_parms *
#define DN_CTL_PATH_DEV 3 #define DN_CTL_PATH_DEV 3
struct ctl_path dn_ctl_path[] = { struct ctl_path dn_ctl_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, }, { .procname = "net", },
{ .procname = "decnet", .ctl_name = NET_DECNET, }, { .procname = "decnet", },
{ .procname = "conf", .ctl_name = NET_DECNET_CONF, }, { .procname = "conf", },
{ /* to be set */ }, { /* to be set */ },
{ }, { },
}; };
...@@ -248,10 +230,8 @@ static void dn_dev_sysctl_register(struct net_device *dev, struct dn_dev_parms * ...@@ -248,10 +230,8 @@ static void dn_dev_sysctl_register(struct net_device *dev, struct dn_dev_parms *
if (dev) { if (dev) {
dn_ctl_path[DN_CTL_PATH_DEV].procname = dev->name; dn_ctl_path[DN_CTL_PATH_DEV].procname = dev->name;
dn_ctl_path[DN_CTL_PATH_DEV].ctl_name = dev->ifindex;
} else { } else {
dn_ctl_path[DN_CTL_PATH_DEV].procname = parms->name; dn_ctl_path[DN_CTL_PATH_DEV].procname = parms->name;
dn_ctl_path[DN_CTL_PATH_DEV].ctl_name = parms->ctl_name;
} }
t->dn_dev_vars[0].extra1 = (void *)dev; t->dn_dev_vars[0].extra1 = (void *)dev;
...@@ -317,44 +297,6 @@ static int dn_forwarding_proc(ctl_table *table, int write, ...@@ -317,44 +297,6 @@ static int dn_forwarding_proc(ctl_table *table, int write,
#endif #endif
} }
static int dn_forwarding_sysctl(ctl_table *table,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
#ifdef CONFIG_DECNET_ROUTER
struct net_device *dev = table->extra1;
struct dn_dev *dn_db;
int value;
if (table->extra1 == NULL)
return -EINVAL;
dn_db = dev->dn_ptr;
if (newval && newlen) {
if (newlen != sizeof(int))
return -EINVAL;
if (get_user(value, (int __user *)newval))
return -EFAULT;
if (value < 0)
return -EINVAL;
if (value > 2)
return -EINVAL;
if (dn_db->parms.down)
dn_db->parms.down(dev);
dn_db->parms.forwarding = value;
if (dn_db->parms.up)
dn_db->parms.up(dev);
}
return 0;
#else
return -EINVAL;
#endif
}
#else /* CONFIG_SYSCTL */ #else /* CONFIG_SYSCTL */
static void dn_dev_sysctl_unregister(struct dn_dev_parms *parms) static void dn_dev_sysctl_unregister(struct dn_dev_parms *parms)
{ {
......
...@@ -131,39 +131,6 @@ static int parse_addr(__le16 *addr, char *str) ...@@ -131,39 +131,6 @@ static int parse_addr(__le16 *addr, char *str)
return 0; return 0;
} }
static int dn_node_address_strategy(ctl_table *table,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
size_t len;
__le16 addr;
if (oldval && oldlenp) {
if (get_user(len, oldlenp))
return -EFAULT;
if (len) {
if (len != sizeof(unsigned short))
return -EINVAL;
if (put_user(decnet_address, (__le16 __user *)oldval))
return -EFAULT;
}
}
if (newval && newlen) {
if (newlen != sizeof(unsigned short))
return -EINVAL;
if (get_user(addr, (__le16 __user *)newval))
return -EFAULT;
dn_dev_devices_off();
decnet_address = addr;
dn_dev_devices_on();
}
return 0;
}
static int dn_node_address_handler(ctl_table *table, int write, static int dn_node_address_handler(ctl_table *table, int write,
void __user *buffer, void __user *buffer,
size_t *lenp, loff_t *ppos) size_t *lenp, loff_t *ppos)
...@@ -215,64 +182,6 @@ static int dn_node_address_handler(ctl_table *table, int write, ...@@ -215,64 +182,6 @@ static int dn_node_address_handler(ctl_table *table, int write,
return 0; return 0;
} }
static int dn_def_dev_strategy(ctl_table *table,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
size_t len;
struct net_device *dev;
char devname[17];
size_t namel;
int rv = 0;
devname[0] = 0;
if (oldval && oldlenp) {
if (get_user(len, oldlenp))
return -EFAULT;
if (len) {
dev = dn_dev_get_default();
if (dev) {
strcpy(devname, dev->name);
dev_put(dev);
}
namel = strlen(devname) + 1;
if (len > namel) len = namel;
if (copy_to_user(oldval, devname, len))
return -EFAULT;
if (put_user(len, oldlenp))
return -EFAULT;
}
}
if (newval && newlen) {
if (newlen > 16)
return -E2BIG;
if (copy_from_user(devname, newval, newlen))
return -EFAULT;
devname[newlen] = 0;
dev = dev_get_by_name(&init_net, devname);
if (dev == NULL)
return -ENODEV;
rv = -ENODEV;
if (dev->dn_ptr != NULL)
rv = dn_dev_set_default(dev, 1);
if (rv)
dev_put(dev);
}
return rv;
}
static int dn_def_dev_handler(ctl_table *table, int write, static int dn_def_dev_handler(ctl_table *table, int write,
void __user *buffer, void __user *buffer,
size_t *lenp, loff_t *ppos) size_t *lenp, loff_t *ppos)
...@@ -338,138 +247,112 @@ static int dn_def_dev_handler(ctl_table *table, int write, ...@@ -338,138 +247,112 @@ static int dn_def_dev_handler(ctl_table *table, int write,
static ctl_table dn_table[] = { static ctl_table dn_table[] = {
{ {
.ctl_name = NET_DECNET_NODE_ADDRESS,
.procname = "node_address", .procname = "node_address",
.maxlen = 7, .maxlen = 7,
.mode = 0644, .mode = 0644,
.proc_handler = dn_node_address_handler, .proc_handler = dn_node_address_handler,
.strategy = dn_node_address_strategy,
}, },
{ {
.ctl_name = NET_DECNET_NODE_NAME,
.procname = "node_name", .procname = "node_name",
.data = node_name, .data = node_name,
.maxlen = 7, .maxlen = 7,
.mode = 0644, .mode = 0644,
.proc_handler = proc_dostring, .proc_handler = proc_dostring,
.strategy = sysctl_string,
}, },
{ {
.ctl_name = NET_DECNET_DEFAULT_DEVICE,
.procname = "default_device", .procname = "default_device",
.maxlen = 16, .maxlen = 16,
.mode = 0644, .mode = 0644,
.proc_handler = dn_def_dev_handler, .proc_handler = dn_def_dev_handler,
.strategy = dn_def_dev_strategy,
}, },
{ {
.ctl_name = NET_DECNET_TIME_WAIT,
.procname = "time_wait", .procname = "time_wait",
.data = &decnet_time_wait, .data = &decnet_time_wait,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_decnet_time_wait, .extra1 = &min_decnet_time_wait,
.extra2 = &max_decnet_time_wait .extra2 = &max_decnet_time_wait
}, },
{ {
.ctl_name = NET_DECNET_DN_COUNT,
.procname = "dn_count", .procname = "dn_count",
.data = &decnet_dn_count, .data = &decnet_dn_count,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_state_count, .extra1 = &min_state_count,
.extra2 = &max_state_count .extra2 = &max_state_count
}, },
{ {
.ctl_name = NET_DECNET_DI_COUNT,
.procname = "di_count", .procname = "di_count",
.data = &decnet_di_count, .data = &decnet_di_count,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_state_count, .extra1 = &min_state_count,
.extra2 = &max_state_count .extra2 = &max_state_count
}, },
{ {
.ctl_name = NET_DECNET_DR_COUNT,
.procname = "dr_count", .procname = "dr_count",
.data = &decnet_dr_count, .data = &decnet_dr_count,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_state_count, .extra1 = &min_state_count,
.extra2 = &max_state_count .extra2 = &max_state_count
}, },
{ {
.ctl_name = NET_DECNET_DST_GC_INTERVAL,
.procname = "dst_gc_interval", .procname = "dst_gc_interval",
.data = &decnet_dst_gc_interval, .data = &decnet_dst_gc_interval,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_decnet_dst_gc_interval, .extra1 = &min_decnet_dst_gc_interval,
.extra2 = &max_decnet_dst_gc_interval .extra2 = &max_decnet_dst_gc_interval
}, },
{ {
.ctl_name = NET_DECNET_NO_FC_MAX_CWND,
.procname = "no_fc_max_cwnd", .procname = "no_fc_max_cwnd",
.data = &decnet_no_fc_max_cwnd, .data = &decnet_no_fc_max_cwnd,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &min_decnet_no_fc_max_cwnd, .extra1 = &min_decnet_no_fc_max_cwnd,
.extra2 = &max_decnet_no_fc_max_cwnd .extra2 = &max_decnet_no_fc_max_cwnd
}, },
{ {
.ctl_name = NET_DECNET_MEM,
.procname = "decnet_mem", .procname = "decnet_mem",
.data = &sysctl_decnet_mem, .data = &sysctl_decnet_mem,
.maxlen = sizeof(sysctl_decnet_mem), .maxlen = sizeof(sysctl_decnet_mem),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec, .proc_handler = proc_dointvec,
.strategy = sysctl_intvec,
}, },
{ {
.ctl_name = NET_DECNET_RMEM,
.procname = "decnet_rmem", .procname = "decnet_rmem",
.data = &sysctl_decnet_rmem, .data = &sysctl_decnet_rmem,
.maxlen = sizeof(sysctl_decnet_rmem), .maxlen = sizeof(sysctl_decnet_rmem),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec, .proc_handler = proc_dointvec,
.strategy = sysctl_intvec,
}, },
{ {
.ctl_name = NET_DECNET_WMEM,
.procname = "decnet_wmem", .procname = "decnet_wmem",
.data = &sysctl_decnet_wmem, .data = &sysctl_decnet_wmem,
.maxlen = sizeof(sysctl_decnet_wmem), .maxlen = sizeof(sysctl_decnet_wmem),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec, .proc_handler = proc_dointvec,
.strategy = sysctl_intvec,
}, },
{ {
.ctl_name = NET_DECNET_DEBUG_LEVEL,
.procname = "debug", .procname = "debug",
.data = &decnet_debug_level, .data = &decnet_debug_level,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec, .proc_handler = proc_dointvec,
.strategy = sysctl_intvec,
}, },
{0} { }
}; };
static struct ctl_path dn_path[] = { static struct ctl_path dn_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, }, { .procname = "net", },
{ .procname = "decnet", .ctl_name = NET_DECNET, }, { .procname = "decnet", },
{ } { }
}; };
......
...@@ -1240,7 +1240,7 @@ void __init arp_init(void) ...@@ -1240,7 +1240,7 @@ void __init arp_init(void)
arp_proc_init(); arp_proc_init();
#ifdef CONFIG_SYSCTL #ifdef CONFIG_SYSCTL
neigh_sysctl_register(NULL, &arp_tbl.parms, NET_IPV4, neigh_sysctl_register(NULL, &arp_tbl.parms, NET_IPV4,
NET_IPV4_NEIGH, "ipv4", NULL, NULL); NET_IPV4_NEIGH, "ipv4", NULL);
#endif #endif
register_netdevice_notifier(&arp_netdev_notifier); register_netdevice_notifier(&arp_netdev_notifier);
} }
......
...@@ -1293,58 +1293,6 @@ static int devinet_conf_proc(ctl_table *ctl, int write, ...@@ -1293,58 +1293,6 @@ static int devinet_conf_proc(ctl_table *ctl, int write,
return ret; return ret;
} }
static int devinet_conf_sysctl(ctl_table *table,
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
struct ipv4_devconf *cnf;
struct net *net;
int *valp = table->data;
int new;
int i;
if (!newval || !newlen)
return 0;
if (newlen != sizeof(int))
return -EINVAL;
if (get_user(new, (int __user *)newval))
return -EFAULT;
if (new == *valp)
return 0;
if (oldval && oldlenp) {
size_t len;
if (get_user(len, oldlenp))
return -EFAULT;
if (len) {
if (len > table->maxlen)
len = table->maxlen;
if (copy_to_user(oldval, valp, len))
return -EFAULT;
if (put_user(len, oldlenp))
return -EFAULT;
}
}
*valp = new;
cnf = table->extra1;
net = table->extra2;
i = (int *)table->data - cnf->data;
set_bit(i, cnf->state);
if (cnf == net->ipv4.devconf_dflt)
devinet_copy_dflt_conf(net, i);
return 1;
}
static int devinet_sysctl_forward(ctl_table *ctl, int write, static int devinet_sysctl_forward(ctl_table *ctl, int write,
void __user *buffer, void __user *buffer,
size_t *lenp, loff_t *ppos) size_t *lenp, loff_t *ppos)
...@@ -1390,47 +1338,28 @@ int ipv4_doint_and_flush(ctl_table *ctl, int write, ...@@ -1390,47 +1338,28 @@ int ipv4_doint_and_flush(ctl_table *ctl, int write,
return ret; return ret;
} }
int ipv4_doint_and_flush_strategy(ctl_table *table, #define DEVINET_SYSCTL_ENTRY(attr, name, mval, proc) \
void __user *oldval, size_t __user *oldlenp,
void __user *newval, size_t newlen)
{
int ret = devinet_conf_sysctl(table, oldval, oldlenp, newval, newlen);
struct net *net = table->extra2;
if (ret == 1)
rt_cache_flush(net, 0);
return ret;
}
#define DEVINET_SYSCTL_ENTRY(attr, name, mval, proc, sysctl) \
{ \ { \
.ctl_name = NET_IPV4_CONF_ ## attr, \
.procname = name, \ .procname = name, \
.data = ipv4_devconf.data + \ .data = ipv4_devconf.data + \
NET_IPV4_CONF_ ## attr - 1, \ NET_IPV4_CONF_ ## attr - 1, \
.maxlen = sizeof(int), \ .maxlen = sizeof(int), \
.mode = mval, \ .mode = mval, \
.proc_handler = proc, \ .proc_handler = proc, \
.strategy = sysctl, \
.extra1 = &ipv4_devconf, \ .extra1 = &ipv4_devconf, \
} }
#define DEVINET_SYSCTL_RW_ENTRY(attr, name) \ #define DEVINET_SYSCTL_RW_ENTRY(attr, name) \
DEVINET_SYSCTL_ENTRY(attr, name, 0644, devinet_conf_proc, \ DEVINET_SYSCTL_ENTRY(attr, name, 0644, devinet_conf_proc)
devinet_conf_sysctl)
#define DEVINET_SYSCTL_RO_ENTRY(attr, name) \ #define DEVINET_SYSCTL_RO_ENTRY(attr, name) \
DEVINET_SYSCTL_ENTRY(attr, name, 0444, devinet_conf_proc, \ DEVINET_SYSCTL_ENTRY(attr, name, 0444, devinet_conf_proc)
devinet_conf_sysctl)
#define DEVINET_SYSCTL_COMPLEX_ENTRY(attr, name, proc, sysctl) \ #define DEVINET_SYSCTL_COMPLEX_ENTRY(attr, name, proc) \
DEVINET_SYSCTL_ENTRY(attr, name, 0644, proc, sysctl) DEVINET_SYSCTL_ENTRY(attr, name, 0644, proc)
#define DEVINET_SYSCTL_FLUSHING_ENTRY(attr, name) \ #define DEVINET_SYSCTL_FLUSHING_ENTRY(attr, name) \
DEVINET_SYSCTL_COMPLEX_ENTRY(attr, name, ipv4_doint_and_flush, \ DEVINET_SYSCTL_COMPLEX_ENTRY(attr, name, ipv4_doint_and_flush)
ipv4_doint_and_flush_strategy)
static struct devinet_sysctl_table { static struct devinet_sysctl_table {
struct ctl_table_header *sysctl_header; struct ctl_table_header *sysctl_header;
...@@ -1439,8 +1368,7 @@ static struct devinet_sysctl_table { ...@@ -1439,8 +1368,7 @@ static struct devinet_sysctl_table {
} devinet_sysctl = { } devinet_sysctl = {
.devinet_vars = { .devinet_vars = {
DEVINET_SYSCTL_COMPLEX_ENTRY(FORWARDING, "forwarding", DEVINET_SYSCTL_COMPLEX_ENTRY(FORWARDING, "forwarding",
devinet_sysctl_forward, devinet_sysctl_forward),
devinet_conf_sysctl),
DEVINET_SYSCTL_RO_ENTRY(MC_FORWARDING, "mc_forwarding"), DEVINET_SYSCTL_RO_ENTRY(MC_FORWARDING, "mc_forwarding"),
DEVINET_SYSCTL_RW_ENTRY(ACCEPT_REDIRECTS, "accept_redirects"), DEVINET_SYSCTL_RW_ENTRY(ACCEPT_REDIRECTS, "accept_redirects"),
...@@ -1471,7 +1399,7 @@ static struct devinet_sysctl_table { ...@@ -1471,7 +1399,7 @@ static struct devinet_sysctl_table {
}; };
static int __devinet_sysctl_register(struct net *net, char *dev_name, static int __devinet_sysctl_register(struct net *net, char *dev_name,
int ctl_name, struct ipv4_devconf *p) struct ipv4_devconf *p)
{ {
int i; int i;
struct devinet_sysctl_table *t; struct devinet_sysctl_table *t;
...@@ -1479,9 +1407,9 @@ static int __devinet_sysctl_register(struct net *net, char *dev_name, ...@@ -1479,9 +1407,9 @@ static int __devinet_sysctl_register(struct net *net, char *dev_name,
#define DEVINET_CTL_PATH_DEV 3 #define DEVINET_CTL_PATH_DEV 3
struct ctl_path devinet_ctl_path[] = { struct ctl_path devinet_ctl_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, }, { .procname = "net", },
{ .procname = "ipv4", .ctl_name = NET_IPV4, }, { .procname = "ipv4", },
{ .procname = "conf", .ctl_name = NET_IPV4_CONF, }, { .procname = "conf", },
{ /* to be set */ }, { /* to be set */ },
{ }, { },
}; };
...@@ -1506,7 +1434,6 @@ static int __devinet_sysctl_register(struct net *net, char *dev_name, ...@@ -1506,7 +1434,6 @@ static int __devinet_sysctl_register(struct net *net, char *dev_name,
goto free; goto free;
devinet_ctl_path[DEVINET_CTL_PATH_DEV].procname = t->dev_name; devinet_ctl_path[DEVINET_CTL_PATH_DEV].procname = t->dev_name;
devinet_ctl_path[DEVINET_CTL_PATH_DEV].ctl_name = ctl_name;
t->sysctl_header = register_net_sysctl_table(net, devinet_ctl_path, t->sysctl_header = register_net_sysctl_table(net, devinet_ctl_path,
t->devinet_vars); t->devinet_vars);
...@@ -1540,9 +1467,9 @@ static void __devinet_sysctl_unregister(struct ipv4_devconf *cnf) ...@@ -1540,9 +1467,9 @@ static void __devinet_sysctl_unregister(struct ipv4_devconf *cnf)
static void devinet_sysctl_register(struct in_device *idev) static void devinet_sysctl_register(struct in_device *idev)
{ {
neigh_sysctl_register(idev->dev, idev->arp_parms, NET_IPV4, neigh_sysctl_register(idev->dev, idev->arp_parms, NET_IPV4,
NET_IPV4_NEIGH, "ipv4", NULL, NULL); NET_IPV4_NEIGH, "ipv4", NULL);
__devinet_sysctl_register(dev_net(idev->dev), idev->dev->name, __devinet_sysctl_register(dev_net(idev->dev), idev->dev->name,
idev->dev->ifindex, &idev->cnf); &idev->cnf);
} }
static void devinet_sysctl_unregister(struct in_device *idev) static void devinet_sysctl_unregister(struct in_device *idev)
...@@ -1553,14 +1480,12 @@ static void devinet_sysctl_unregister(struct in_device *idev) ...@@ -1553,14 +1480,12 @@ static void devinet_sysctl_unregister(struct in_device *idev)
static struct ctl_table ctl_forward_entry[] = { static struct ctl_table ctl_forward_entry[] = {
{ {
.ctl_name = NET_IPV4_FORWARD,
.procname = "ip_forward", .procname = "ip_forward",
.data = &ipv4_devconf.data[ .data = &ipv4_devconf.data[
NET_IPV4_CONF_FORWARDING - 1], NET_IPV4_CONF_FORWARDING - 1],
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = devinet_sysctl_forward, .proc_handler = devinet_sysctl_forward,
.strategy = devinet_conf_sysctl,
.extra1 = &ipv4_devconf, .extra1 = &ipv4_devconf,
.extra2 = &init_net, .extra2 = &init_net,
}, },
...@@ -1568,8 +1493,8 @@ static struct ctl_table ctl_forward_entry[] = { ...@@ -1568,8 +1493,8 @@ static struct ctl_table ctl_forward_entry[] = {
}; };
static __net_initdata struct ctl_path net_ipv4_path[] = { static __net_initdata struct ctl_path net_ipv4_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, }, { .procname = "net", },
{ .procname = "ipv4", .ctl_name = NET_IPV4, }, { .procname = "ipv4", },
{ }, { },
}; };
#endif #endif
...@@ -1608,13 +1533,11 @@ static __net_init int devinet_init_net(struct net *net) ...@@ -1608,13 +1533,11 @@ static __net_init int devinet_init_net(struct net *net)
} }
#ifdef CONFIG_SYSCTL #ifdef CONFIG_SYSCTL
err = __devinet_sysctl_register(net, "all", err = __devinet_sysctl_register(net, "all", all);
NET_PROTO_CONF_ALL, all);
if (err < 0) if (err < 0)
goto err_reg_all; goto err_reg_all;
err = __devinet_sysctl_register(net, "default", err = __devinet_sysctl_register(net, "default", dflt);
NET_PROTO_CONF_DEFAULT, dflt);
if (err < 0) if (err < 0)
goto err_reg_dflt; goto err_reg_dflt;
......
...@@ -603,7 +603,6 @@ static int zero; ...@@ -603,7 +603,6 @@ static int zero;
static struct ctl_table ip4_frags_ns_ctl_table[] = { static struct ctl_table ip4_frags_ns_ctl_table[] = {
{ {
.ctl_name = NET_IPV4_IPFRAG_HIGH_THRESH,
.procname = "ipfrag_high_thresh", .procname = "ipfrag_high_thresh",
.data = &init_net.ipv4.frags.high_thresh, .data = &init_net.ipv4.frags.high_thresh,
.maxlen = sizeof(int), .maxlen = sizeof(int),
...@@ -611,7 +610,6 @@ static struct ctl_table ip4_frags_ns_ctl_table[] = { ...@@ -611,7 +610,6 @@ static struct ctl_table ip4_frags_ns_ctl_table[] = {
.proc_handler = proc_dointvec .proc_handler = proc_dointvec
}, },
{ {
.ctl_name = NET_IPV4_IPFRAG_LOW_THRESH,
.procname = "ipfrag_low_thresh", .procname = "ipfrag_low_thresh",
.data = &init_net.ipv4.frags.low_thresh, .data = &init_net.ipv4.frags.low_thresh,
.maxlen = sizeof(int), .maxlen = sizeof(int),
...@@ -619,26 +617,22 @@ static struct ctl_table ip4_frags_ns_ctl_table[] = { ...@@ -619,26 +617,22 @@ static struct ctl_table ip4_frags_ns_ctl_table[] = {
.proc_handler = proc_dointvec .proc_handler = proc_dointvec
}, },
{ {
.ctl_name = NET_IPV4_IPFRAG_TIME,
.procname = "ipfrag_time", .procname = "ipfrag_time",
.data = &init_net.ipv4.frags.timeout, .data = &init_net.ipv4.frags.timeout,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_jiffies, .proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies
}, },
{ } { }
}; };
static struct ctl_table ip4_frags_ctl_table[] = { static struct ctl_table ip4_frags_ctl_table[] = {
{ {
.ctl_name = NET_IPV4_IPFRAG_SECRET_INTERVAL,
.procname = "ipfrag_secret_interval", .procname = "ipfrag_secret_interval",
.data = &ip4_frags.secret_interval, .data = &ip4_frags.secret_interval,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_jiffies, .proc_handler = proc_dointvec_jiffies,
.strategy = sysctl_jiffies
}, },
{ {
.procname = "ipfrag_max_dist", .procname = "ipfrag_max_dist",
......
...@@ -248,9 +248,9 @@ module_exit(ipv4_netfilter_fini); ...@@ -248,9 +248,9 @@ module_exit(ipv4_netfilter_fini);
#ifdef CONFIG_SYSCTL #ifdef CONFIG_SYSCTL
struct ctl_path nf_net_ipv4_netfilter_sysctl_path[] = { struct ctl_path nf_net_ipv4_netfilter_sysctl_path[] = {
{ .procname = "net", .ctl_name = CTL_NET, }, { .procname = "net", },
{ .procname = "ipv4", .ctl_name = NET_IPV4, }, { .procname = "ipv4", },
{ .procname = "netfilter", .ctl_name = NET_IPV4_NETFILTER, }, { .procname = "netfilter", },
{ } { }
}; };
EXPORT_SYMBOL_GPL(nf_net_ipv4_netfilter_sysctl_path); EXPORT_SYMBOL_GPL(nf_net_ipv4_netfilter_sysctl_path);
......
...@@ -516,14 +516,13 @@ static struct ctl_table_header *ipq_sysctl_header; ...@@ -516,14 +516,13 @@ static struct ctl_table_header *ipq_sysctl_header;
static ctl_table ipq_table[] = { static ctl_table ipq_table[] = {
{ {
.ctl_name = NET_IPQ_QMAX,
.procname = NET_IPQ_QMAX_NAME, .procname = NET_IPQ_QMAX_NAME,
.data = &queue_maxlen, .data = &queue_maxlen,
.maxlen = sizeof(queue_maxlen), .maxlen = sizeof(queue_maxlen),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dointvec
}, },
{ .ctl_name = 0 } { }
}; };
#endif #endif
......
...@@ -195,7 +195,6 @@ static int log_invalid_proto_max = 255; ...@@ -195,7 +195,6 @@ static int log_invalid_proto_max = 255;
static ctl_table ip_ct_sysctl_table[] = { static ctl_table ip_ct_sysctl_table[] = {
{ {
.ctl_name = NET_IPV4_NF_CONNTRACK_MAX,
.procname = "ip_conntrack_max", .procname = "ip_conntrack_max",
.data = &nf_conntrack_max, .data = &nf_conntrack_max,
.maxlen = sizeof(int), .maxlen = sizeof(int),
...@@ -203,7 +202,6 @@ static ctl_table ip_ct_sysctl_table[] = { ...@@ -203,7 +202,6 @@ static ctl_table ip_ct_sysctl_table[] = {
.proc_handler = proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ {
.ctl_name = NET_IPV4_NF_CONNTRACK_COUNT,
.procname = "ip_conntrack_count", .procname = "ip_conntrack_count",
.data = &init_net.ct.count, .data = &init_net.ct.count,
.maxlen = sizeof(int), .maxlen = sizeof(int),
...@@ -211,7 +209,6 @@ static ctl_table ip_ct_sysctl_table[] = { ...@@ -211,7 +209,6 @@ static ctl_table ip_ct_sysctl_table[] = {
.proc_handler = proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ {
.ctl_name = NET_IPV4_NF_CONNTRACK_BUCKETS,
.procname = "ip_conntrack_buckets", .procname = "ip_conntrack_buckets",
.data = &nf_conntrack_htable_size, .data = &nf_conntrack_htable_size,
.maxlen = sizeof(unsigned int), .maxlen = sizeof(unsigned int),
...@@ -219,7 +216,6 @@ static ctl_table ip_ct_sysctl_table[] = { ...@@ -219,7 +216,6 @@ static ctl_table ip_ct_sysctl_table[] = {
.proc_handler = proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ {
.ctl_name = NET_IPV4_NF_CONNTRACK_CHECKSUM,
.procname = "ip_conntrack_checksum", .procname = "ip_conntrack_checksum",
.data = &init_net.ct.sysctl_checksum, .data = &init_net.ct.sysctl_checksum,
.maxlen = sizeof(int), .maxlen = sizeof(int),
...@@ -227,19 +223,15 @@ static ctl_table ip_ct_sysctl_table[] = { ...@@ -227,19 +223,15 @@ static ctl_table ip_ct_sysctl_table[] = {
.proc_handler = proc_dointvec, .proc_handler = proc_dointvec,
}, },
{ {
.ctl_name = NET_IPV4_NF_CONNTRACK_LOG_INVALID,
.procname = "ip_conntrack_log_invalid", .procname = "ip_conntrack_log_invalid",
.data = &init_net.ct.sysctl_log_invalid, .data = &init_net.ct.sysctl_log_invalid,
.maxlen = sizeof(unsigned int), .maxlen = sizeof(unsigned int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_minmax, .proc_handler = proc_dointvec_minmax,
.strategy = sysctl_intvec,
.extra1 = &log_invalid_proto_min, .extra1 = &log_invalid_proto_min,
.extra2 = &log_invalid_proto_max, .extra2 = &log_invalid_proto_max,
}, },
{ { }
.ctl_name = 0
}
}; };
#endif /* CONFIG_SYSCTL && CONFIG_NF_CONNTRACK_PROC_COMPAT */ #endif /* CONFIG_SYSCTL && CONFIG_NF_CONNTRACK_PROC_COMPAT */
......
...@@ -270,9 +270,7 @@ static struct ctl_table icmp_sysctl_table[] = { ...@@ -270,9 +270,7 @@ static struct ctl_table icmp_sysctl_table[] = {
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_jiffies, .proc_handler = proc_dointvec_jiffies,
}, },
{ { }
.ctl_name = 0
}
}; };
#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT #ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT
static struct ctl_table icmp_compat_sysctl_table[] = { static struct ctl_table icmp_compat_sysctl_table[] = {
...@@ -283,9 +281,7 @@ static struct ctl_table icmp_compat_sysctl_table[] = { ...@@ -283,9 +281,7 @@ static struct ctl_table icmp_compat_sysctl_table[] = {
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_jiffies, .proc_handler = proc_dointvec_jiffies,
}, },
{ { }
.ctl_name = 0
}
}; };
#endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */ #endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */
#endif /* CONFIG_SYSCTL */ #endif /* CONFIG_SYSCTL */
......
此差异已折叠。
此差异已折叠。
...@@ -267,7 +267,6 @@ static struct xfrm_policy_afinfo xfrm4_policy_afinfo = { ...@@ -267,7 +267,6 @@ static struct xfrm_policy_afinfo xfrm4_policy_afinfo = {
#ifdef CONFIG_SYSCTL #ifdef CONFIG_SYSCTL
static struct ctl_table xfrm4_policy_table[] = { static struct ctl_table xfrm4_policy_table[] = {
{ {
.ctl_name = CTL_UNNUMBERED,
.procname = "xfrm4_gc_thresh", .procname = "xfrm4_gc_thresh",
.data = &xfrm4_dst_ops.gc_thresh, .data = &xfrm4_dst_ops.gc_thresh,
.maxlen = sizeof(int), .maxlen = sizeof(int),
......
此差异已折叠。
...@@ -942,15 +942,13 @@ EXPORT_SYMBOL(icmpv6_err_convert); ...@@ -942,15 +942,13 @@ EXPORT_SYMBOL(icmpv6_err_convert);
#ifdef CONFIG_SYSCTL #ifdef CONFIG_SYSCTL
ctl_table ipv6_icmp_table_template[] = { ctl_table ipv6_icmp_table_template[] = {
{ {
.ctl_name = NET_IPV6_ICMP_RATELIMIT,
.procname = "ratelimit", .procname = "ratelimit",
.data = &init_net.ipv6.sysctl.icmpv6_time, .data = &init_net.ipv6.sysctl.icmpv6_time,
.maxlen = sizeof(int), .maxlen = sizeof(int),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec_ms_jiffies, .proc_handler = proc_dointvec_ms_jiffies,
.strategy = sysctl_ms_jiffies
}, },
{ .ctl_name = 0 }, { },
}; };
struct ctl_table *ipv6_icmp_sysctl_init(struct net *net) struct ctl_table *ipv6_icmp_sysctl_init(struct net *net)
......
此差异已折叠。
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
#define IPQ_QMAX_DEFAULT 1024 #define IPQ_QMAX_DEFAULT 1024
#define IPQ_PROC_FS_NAME "ip6_queue" #define IPQ_PROC_FS_NAME "ip6_queue"
#define NET_IPQ_QMAX 2088
#define NET_IPQ_QMAX_NAME "ip6_queue_maxlen" #define NET_IPQ_QMAX_NAME "ip6_queue_maxlen"
typedef int (*ipq_cmpfn)(struct nf_queue_entry *, unsigned long); typedef int (*ipq_cmpfn)(struct nf_queue_entry *, unsigned long);
...@@ -518,14 +517,13 @@ static struct ctl_table_header *ipq_sysctl_header; ...@@ -518,14 +517,13 @@ static struct ctl_table_header *ipq_sysctl_header;
static ctl_table ipq_table[] = { static ctl_table ipq_table[] = {
{ {
.ctl_name = NET_IPQ_QMAX,
.procname = NET_IPQ_QMAX_NAME, .procname = NET_IPQ_QMAX_NAME,
.data = &queue_maxlen, .data = &queue_maxlen,
.maxlen = sizeof(queue_maxlen), .maxlen = sizeof(queue_maxlen),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec .proc_handler = proc_dointvec
}, },
{ .ctl_name = 0 } { }
}; };
#endif #endif
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册