Merge git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/sysctl-2.6
Linus Torvalds [Tue, 8 Dec 2009 15:38:50 +0000 (07:38 -0800)]
* 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
  ...

135 files changed:
Documentation/sysctl/ctl_unnumbered.txt [deleted file]
arch/arm/kernel/isa.c
arch/arm/mach-bcmring/arch.c
arch/frv/kernel/pm.c
arch/frv/kernel/sysctl.c
arch/ia64/ia32/ia32_entry.S
arch/ia64/ia32/sys_ia32.c
arch/ia64/kernel/crash.c
arch/ia64/kernel/perfmon.c
arch/mips/kernel/linux32.c
arch/mips/kernel/scall64-n32.S
arch/mips/kernel/scall64-o32.S
arch/mips/lasat/sysctl.c
arch/parisc/kernel/sys_parisc32.c
arch/parisc/kernel/syscall_table.S
arch/powerpc/kernel/idle.c
arch/powerpc/kernel/sys_ppc32.c
arch/s390/appldata/appldata_base.c
arch/s390/kernel/compat_linux.c
arch/s390/kernel/compat_linux.h
arch/s390/kernel/compat_wrapper.S
arch/s390/kernel/debug.c
arch/s390/mm/cmm.c
arch/sh/kernel/traps_64.c
arch/sparc/kernel/sys_sparc32.c
arch/sparc/kernel/systbls_64.S
arch/x86/ia32/ia32entry.S
arch/x86/ia32/sys_ia32.c
arch/x86/include/asm/sys_ia32.h
arch/x86/kernel/vsyscall_64.c
arch/x86/vdso/vdso32-setup.c
crypto/proc.c
drivers/cdrom/cdrom.c
drivers/char/hpet.c
drivers/char/ipmi/ipmi_poweroff.c
drivers/char/pty.c
drivers/char/random.c
drivers/char/rtc.c
drivers/macintosh/mac_hid.c
drivers/md/md.c
drivers/misc/sgi-xp/xpc_main.c
drivers/net/wireless/arlan-proc.c
drivers/parport/procfs.c
drivers/s390/char/sclp_async.c
drivers/scsi/scsi_sysctl.c
fs/coda/sysctl.c
fs/eventpoll.c
fs/lockd/svc.c
fs/nfs/sysctl.c
fs/notify/inotify/inotify_user.c
fs/ntfs/sysctl.c
fs/ocfs2/stackglue.c
fs/proc/proc_sysctl.c
fs/quota/dquot.c
fs/xfs/linux-2.6/xfs_sysctl.c
include/linux/sysctl.h
include/net/dn_dev.h
include/net/neighbour.h
init/Kconfig
ipc/ipc_sysctl.c
ipc/mq_sysctl.c
kernel/Makefile
kernel/sched.c
kernel/slow-work.c
kernel/sys_ni.c
kernel/sysctl.c
kernel/sysctl_binary.c [new file with mode: 0644]
kernel/sysctl_check.c
kernel/utsname_sysctl.c
lib/Kconfig.debug
net/802/tr.c
net/appletalk/sysctl_net_atalk.c
net/ax25/sysctl_net_ax25.c
net/bridge/br_netfilter.c
net/core/neighbour.c
net/core/sysctl_net_core.c
net/dccp/sysctl.c
net/decnet/dn_dev.c
net/decnet/sysctl_net_decnet.c
net/ipv4/arp.c
net/ipv4/devinet.c
net/ipv4/ip_fragment.c
net/ipv4/netfilter.c
net/ipv4/netfilter/ip_queue.c
net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c
net/ipv4/netfilter/nf_conntrack_proto_icmp.c
net/ipv4/route.c
net/ipv4/sysctl_net_ipv4.c
net/ipv4/xfrm4_policy.c
net/ipv6/addrconf.c
net/ipv6/icmp.c
net/ipv6/ndisc.c
net/ipv6/netfilter/ip6_queue.c
net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
net/ipv6/netfilter/nf_conntrack_reasm.c
net/ipv6/reassembly.c
net/ipv6/route.c
net/ipv6/sysctl_net_ipv6.c
net/ipv6/xfrm6_policy.c
net/ipx/sysctl_net_ipx.c
net/irda/irsysctl.c
net/llc/sysctl_net_llc.c
net/netfilter/core.c
net/netfilter/ipvs/ip_vs_ctl.c
net/netfilter/ipvs/ip_vs_lblc.c
net/netfilter/ipvs/ip_vs_lblcr.c
net/netfilter/nf_conntrack_acct.c
net/netfilter/nf_conntrack_ecache.c
net/netfilter/nf_conntrack_proto_dccp.c
net/netfilter/nf_conntrack_proto_generic.c
net/netfilter/nf_conntrack_proto_sctp.c
net/netfilter/nf_conntrack_proto_tcp.c
net/netfilter/nf_conntrack_proto_udp.c
net/netfilter/nf_conntrack_proto_udplite.c
net/netfilter/nf_conntrack_standalone.c
net/netfilter/nf_log.c
net/netrom/sysctl_net_netrom.c
net/phonet/sysctl.c
net/rds/ib_sysctl.c
net/rds/iw_sysctl.c
net/rds/sysctl.c
net/rose/sysctl_net_rose.c
net/sctp/sysctl.c
net/sunrpc/sysctl.c
net/sunrpc/xprtrdma/svc_rdma.c
net/sunrpc/xprtrdma/transport.c
net/sunrpc/xprtsock.c
net/unix/sysctl_net_unix.c
net/x25/sysctl_net_x25.c
net/xfrm/xfrm_sysctl.c
security/keys/sysctl.c
security/tomoyo/file.c
security/tomoyo/realpath.c
security/tomoyo/tomoyo.c
security/tomoyo/tomoyo.h

diff --git a/Documentation/sysctl/ctl_unnumbered.txt b/Documentation/sysctl/ctl_unnumbered.txt
deleted file mode 100644 (file)
index 23003a8..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-
-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)
index 8ac9b84..3464859 100644 (file)
@@ -22,47 +22,42 @@ static unsigned int isa_membase, isa_portbase, isa_portshift;
 
 static ctl_table ctl_isa_vars[4] = {
        {
-               .ctl_name       = BUS_ISA_MEM_BASE,
                .procname       = "membase",
                .data           = &isa_membase, 
                .maxlen         = sizeof(isa_membase),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        }, {
-               .ctl_name       = BUS_ISA_PORT_BASE,
                .procname       = "portbase",
                .data           = &isa_portbase, 
                .maxlen         = sizeof(isa_portbase),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        }, {
-               .ctl_name       = BUS_ISA_PORT_SHIFT,
                .procname       = "portshift",
                .data           = &isa_portshift, 
                .maxlen         = sizeof(isa_portshift),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
-       }, {0}
+               .proc_handler   = proc_dointvec,
+       }, {}
 };
 
 static struct ctl_table_header *isa_sysctl_header;
 
 static ctl_table ctl_isa[2] = {
        {
-               .ctl_name       = CTL_BUS_ISA,
                .procname       = "isa",
                .mode           = 0555,
                .child          = ctl_isa_vars,
-       }, {0}
+       }, {}
 };
 
 static ctl_table ctl_bus[2] = {
        {
-               .ctl_name       = CTL_BUS,
                .procname       = "bus",
                .mode           = 0555,
                .child          = ctl_isa,
-       }, {0}
+       }, {}
 };
 
 void __init
index 0da693b..fbe6fa0 100644 (file)
@@ -47,10 +47,6 @@ HW_DECLARE_SPINLOCK(gpio)
     EXPORT_SYMBOL(bcmring_gpio_reg_lock);
 #endif
 
-/* FIXME: temporary solution */
-#define BCM_SYSCTL_REBOOT_WARM               1
-#define CTL_BCM_REBOOT                 112
-
 /* sysctl */
 int bcmring_arch_warm_reboot;  /* do a warm reboot on hard reset */
 
@@ -58,18 +54,16 @@ static struct ctl_table_header *bcmring_sysctl_header;
 
 static struct ctl_table bcmring_sysctl_warm_reboot[] = {
        {
-        .ctl_name = BCM_SYSCTL_REBOOT_WARM,
         .procname = "warm",
         .data = &bcmring_arch_warm_reboot,
         .maxlen = sizeof(int),
         .mode = 0644,
-        .proc_handler = &proc_dointvec},
+        .proc_handler = proc_dointvec},
        {}
 };
 
 static struct ctl_table bcmring_sysctl_reboot[] = {
        {
-        .ctl_name = CTL_BCM_REBOOT,
         .procname = "reboot",
         .mode = 0555,
         .child = bcmring_sysctl_warm_reboot},
index 0d4d3e3..5fa3889 100644 (file)
@@ -211,37 +211,6 @@ static int cmode_procctl(ctl_table *ctl, int write,
        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)
 {
        unsigned long flags, clkc;
@@ -314,37 +283,6 @@ static int p0_procctl(ctl_table *ctl, int write,
        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,
                      void __user *buffer, size_t *lenp, loff_t *fpos)
 {
@@ -358,87 +296,47 @@ static int cm_procctl(ctl_table *ctl, int write,
        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[] =
 {
        {
-               .ctl_name       = CTL_PM_SUSPEND,
                .procname       = "suspend",
                .data           = NULL,
                .maxlen         = 0,
                .mode           = 0200,
-               .proc_handler   = &sysctl_pm_do_suspend,
+               .proc_handler   = sysctl_pm_do_suspend,
        },
        {
-               .ctl_name       = CTL_PM_CMODE,
                .procname       = "cmode",
                .data           = &clock_cmode_current,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &cmode_procctl,
-               .strategy       = &cmode_sysctl,
+               .proc_handler   = cmode_procctl,
        },
        {
-               .ctl_name       = CTL_PM_P0,
                .procname       = "p0",
                .data           = &clock_p0_current,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &p0_procctl,
-               .strategy       = &p0_sysctl,
+               .proc_handler   = p0_procctl,
        },
        {
-               .ctl_name       = CTL_PM_CM,
                .procname       = "cm",
                .data           = &clock_cm_current,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &cm_procctl,
-               .strategy       = &cm_sysctl,
+               .proc_handler   = cm_procctl,
        },
-       { .ctl_name = 0}
+       { }
 };
 
 static struct ctl_table pm_dir_table[] =
 {
        {
-               .ctl_name       = CTL_PM,
                .procname       = "pm",
                .mode           = 0555,
                .child          = pm_table,
        },
-       { .ctl_name = 0}
+       { }
 };
 
 /*
index 3e9d7e0..035516c 100644 (file)
@@ -176,21 +176,19 @@ static int procctl_frv_pin_cxnr(ctl_table *table, int write, struct file *filp,
 static struct ctl_table frv_table[] =
 {
        {
-               .ctl_name       = 1,
                .procname       = "cache-mode",
                .data           = NULL,
                .maxlen         = 0,
                .mode           = 0644,
-               .proc_handler   = &procctl_frv_cachemode,
+               .proc_handler   = procctl_frv_cachemode,
        },
 #ifdef CONFIG_MMU
        {
-               .ctl_name       = 2,
                .procname       = "pin-cxnr",
                .data           = NULL,
                .maxlen         = 0,
                .mode           = 0644,
-               .proc_handler   = &procctl_frv_pin_cxnr
+               .proc_handler   = procctl_frv_pin_cxnr
        },
 #endif
        {}
@@ -203,7 +201,6 @@ static struct ctl_table frv_table[] =
 static struct ctl_table frv_dir_table[] =
 {
        {
-               .ctl_name       = CTL_FRV,
                .procname       = "frv",
                .mode           = 0555,
                .child          = frv_table
index af9405c..10c3751 100644 (file)
@@ -327,7 +327,7 @@ ia32_syscall_table:
        data8 compat_sys_writev
        data8 sys_getsid
        data8 sys_fdatasync
-       data8 sys32_sysctl
+       data8 compat_sys_sysctl
        data8 sys_mlock           /* 150 */
        data8 sys_munlock
        data8 sys_mlockall
index 625ed8f..429ec96 100644 (file)
@@ -1628,61 +1628,6 @@ sys32_msync (unsigned int start, unsigned int len, int 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
 sys32_newuname (struct new_utsname __user *name)
 {
index 6631a9d..b942f40 100644 (file)
@@ -239,32 +239,29 @@ kdump_init_notifier(struct notifier_block *self, unsigned long val, void *data)
 #ifdef CONFIG_SYSCTL
 static ctl_table kdump_ctl_table[] = {
        {
-               .ctl_name = CTL_UNNUMBERED,
                .procname = "kdump_on_init",
                .data = &kdump_on_init,
                .maxlen = sizeof(int),
                .mode = 0644,
-               .proc_handler = &proc_dointvec,
+               .proc_handler = proc_dointvec,
        },
        {
-               .ctl_name = CTL_UNNUMBERED,
                .procname = "kdump_on_fatal_mca",
                .data = &kdump_on_fatal_mca,
                .maxlen = sizeof(int),
                .mode = 0644,
-               .proc_handler = &proc_dointvec,
+               .proc_handler = proc_dointvec,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 static ctl_table sys_table[] = {
        {
-         .ctl_name = CTL_KERN,
          .procname = "kernel",
          .mode = 0555,
          .child = kdump_ctl_table,
        },
-       { .ctl_name = 0 }
+       { }
 };
 #endif
 
index f178270..402698b 100644 (file)
@@ -522,42 +522,37 @@ EXPORT_SYMBOL(pfm_sysctl);
 
 static ctl_table pfm_ctl_table[]={
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "debug",
                .data           = &pfm_sysctl.debug,
                .maxlen         = sizeof(int),
                .mode           = 0666,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "debug_ovfl",
                .data           = &pfm_sysctl.debug_ovfl,
                .maxlen         = sizeof(int),
                .mode           = 0666,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "fastctxsw",
                .data           = &pfm_sysctl.fastctxsw,
                .maxlen         = sizeof(int),
                .mode           = 0600,
-               .proc_handler   =  &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "expert_mode",
                .data           = &pfm_sysctl.expert_mode,
                .maxlen         = sizeof(int),
                .mode           = 0600,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {}
 };
 static ctl_table pfm_sysctl_dir[] = {
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "perfmon",
                .mode           = 0555,
                .child          = pfm_ctl_table,
@@ -566,7 +561,6 @@ static ctl_table pfm_sysctl_dir[] = {
 };
 static ctl_table pfm_sysctl_root[] = {
        {
-               .ctl_name       = CTL_KERN,
                .procname       = "kernel",
                .mode           = 0555,
                .child          = pfm_sysctl_dir,
index b77fefa..1a2793e 100644 (file)
@@ -265,67 +265,6 @@ SYSCALL_DEFINE5(n32_msgrcv, int, msqid, u32, msgp, size_t, msgsz,
 }
 #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)
 {
        int ret = 0;
index 6ebc079..8a0be0b 100644 (file)
@@ -272,7 +272,7 @@ EXPORT(sysn32_call_table)
        PTR     sys_munlockall
        PTR     sys_vhangup                     /* 6150 */
        PTR     sys_pivot_root
-       PTR     sys_32_sysctl
+       PTR     compat_sys_sysctl
        PTR     sys_prctl
        PTR     compat_sys_adjtimex
        PTR     compat_sys_setrlimit            /* 6155 */
index 14dde4c..41dbdb7 100644 (file)
@@ -356,7 +356,7 @@ sys_call_table:
        PTR     sys_ni_syscall                  /* 4150 */
        PTR     sys_getsid
        PTR     sys_fdatasync
-       PTR     sys_32_sysctl
+       PTR     compat_sys_sysctl
        PTR     sys_mlock
        PTR     sys_munlock                     /* 4155 */
        PTR     sys_mlockall
index b3deed8..14b9a28 100644 (file)
 #include "ds1603.h"
 #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 */
 int proc_dolasatstring(ctl_table *table, int write,
@@ -113,46 +96,6 @@ int proc_dolasatrtc(ctl_table *table, int write,
 }
 #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
 int proc_lasat_ip(ctl_table *table, int write,
                       void *buffer, size_t *lenp, loff_t *ppos)
@@ -214,23 +157,6 @@ int proc_lasat_ip(ctl_table *table, int write,
 }
 #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,
                       void *buffer, size_t *lenp, loff_t *ppos)
 {
@@ -252,115 +178,92 @@ extern int lasat_boot_to_service;
 
 static ctl_table lasat_table[] = {
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "cpu-hz",
                .data           = &lasat_board_info.li_cpu_hz,
                .maxlen         = sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
-               .strategy       = &sysctl_intvec
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "bus-hz",
                .data           = &lasat_board_info.li_bus_hz,
                .maxlen         = sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
-               .strategy       = &sysctl_intvec
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "bmid",
                .data           = &lasat_board_info.li_bmid,
                .maxlen         = sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
-               .strategy       = &sysctl_intvec
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "prid",
                .data           = &lasat_board_info.li_prid,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_lasat_prid,
-               .strategy       = &sysctl_lasat_prid
-       },
+               .proc_handler   = proc_lasat_prid,
+.      },
 #ifdef CONFIG_INET
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "ipaddr",
                .data           = &lasat_board_info.li_eeprom_info.ipaddr,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_lasat_ip,
-               .strategy       = &sysctl_lasat_intvec
+               .proc_handler   = proc_lasat_ip,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "netmask",
                .data           = &lasat_board_info.li_eeprom_info.netmask,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_lasat_ip,
-               .strategy       = &sysctl_lasat_intvec
+               .proc_handler   = proc_lasat_ip,
        },
 #endif
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "passwd_hash",
                .data           = &lasat_board_info.li_eeprom_info.passwd_hash,
                .maxlen         =
                        sizeof(lasat_board_info.li_eeprom_info.passwd_hash),
                .mode           = 0600,
-               .proc_handler   = &proc_dolasatstring,
-               .strategy       = &sysctl_lasatstring
+               .proc_handler   = proc_dolasatstring,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "boot-service",
                .data           = &lasat_boot_to_service,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
-               .strategy       = &sysctl_intvec
+               .proc_handler   = proc_dointvec,
        },
 #ifdef CONFIG_DS1603
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "rtc",
                .data           = &rtctmp,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dolasatrtc,
-               .strategy       = &sysctl_lasat_rtc
+               .proc_handler   = proc_dolasatrtc,
        },
 #endif
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "namestr",
                .data           = &lasat_board_info.li_namestr,
                .maxlen         = sizeof(lasat_board_info.li_namestr),
                .mode           = 0444,
-               .proc_handler   = &proc_dostring,
-               .strategy       = &sysctl_string
+               .proc_handler   = proc_dostring,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "typestr",
                .data           = &lasat_board_info.li_typestr,
                .maxlen         = sizeof(lasat_board_info.li_typestr),
                .mode           = 0444,
-               .proc_handler   = &proc_dostring,
-               .strategy       = &sysctl_string
+               .proc_handler   = proc_dostring,
        },
        {}
 };
 
 static ctl_table lasat_root_table[] = {
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "lasat",
                .mode           =  0555,
                .child          = lasat_table
index 561388b..76d23ec 100644 (file)
@@ -90,77 +90,6 @@ asmlinkage long sys32_unimplemented(int r26, int r25, int r24, int r23,
     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,
        struct compat_timespec __user *interval)
 {
index 843f423..01c4fcf 100644 (file)
        ENTRY_SAME(getsid)
        ENTRY_SAME(fdatasync)
        /* struct __sysctl_args is a mess */
-       ENTRY_DIFF(sysctl)
+       ENTRY_COMP(sysctl)
        ENTRY_SAME(mlock)               /* 150 */
        ENTRY_SAME(munlock)
        ENTRY_SAME(mlockall)
index 88d9c1d..049dda6 100644 (file)
@@ -110,18 +110,16 @@ int powersave_nap;
  */
 static ctl_table powersave_nap_ctl_table[]={
        {
-               .ctl_name       = KERN_PPC_POWERSAVE_NAP,
                .procname       = "powersave-nap",
                .data           = &powersave_nap,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {}
 };
 static ctl_table powersave_nap_sysctl_root[] = {
        {
-               .ctl_name       = CTL_KERN,
                .procname       = "kernel",
                .mode           = 0555,
                .child          = powersave_nap_ctl_table,
index b97c2d6..c5a4732 100644 (file)
@@ -520,58 +520,6 @@ asmlinkage long compat_sys_umask(u32 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 prot, unsigned long flags,
                          unsigned long fd, unsigned long pgoff)
index b55fd7e..4955899 100644 (file)
@@ -61,12 +61,12 @@ static struct ctl_table appldata_table[] = {
        {
                .procname       = "timer",
                .mode           = S_IRUGO | S_IWUSR,
-               .proc_handler   = &appldata_timer_handler,
+               .proc_handler   = appldata_timer_handler,
        },
        {
                .procname       = "interval",
                .mode           = S_IRUGO | S_IWUSR,
-               .proc_handler   = &appldata_interval_handler,
+               .proc_handler   = appldata_interval_handler,
        },
        { },
 };
index 0debcec..fda1a81 100644 (file)
@@ -527,59 +527,6 @@ asmlinkage long sys32_sendfile64(int out_fd, int in_fd,
        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 {
        unsigned long long  st_dev;
        unsigned int    __pad1;
index c07f9ca..45e9092 100644 (file)
@@ -162,7 +162,6 @@ struct ucontext32 {
        compat_sigset_t         uc_sigmask;     /* mask last for extensibility */
 };
 
-struct __sysctl_args32;
 struct stat64_emu31;
 struct mmap_arg_struct_emu31;
 struct fadvise64_64_args;
@@ -212,7 +211,6 @@ long sys32_sendfile(int out_fd, int in_fd, compat_off_t __user *offset,
                    size_t count);
 long sys32_sendfile64(int out_fd, int in_fd, compat_loff_t __user *offset,
                      s32 count);
-long sys32_sysctl(struct __sysctl_args32 __user *args);
 long sys32_stat64(char __user * filename, struct stat64_emu31 __user * statbuf);
 long sys32_lstat64(char __user * filename,
                   struct stat64_emu31 __user * statbuf);
index cbd9901..30de2d0 100644 (file)
@@ -689,8 +689,6 @@ sys32_fdatasync_wrapper:
        llgfr   %r2,%r2                 # unsigned int
        jg      sys_fdatasync           # branch to system call
 
-#sys32_sysctl_wrapper                  # tbd
-
        .globl  sys32_mlock_wrapper
 sys32_mlock_wrapper:
        llgfr   %r2,%r2                 # unsigned long
@@ -1087,8 +1085,8 @@ sys32_stime_wrapper:
 
        .globl  sys32_sysctl_wrapper
 sys32_sysctl_wrapper:
-       llgtr   %r2,%r2                 # struct __sysctl_args32 *
-       jg      sys32_sysctl
+       llgtr   %r2,%r2                 # struct compat_sysctl_args *
+       jg      compat_sys_sysctl
 
        .globl  sys32_fstat64_wrapper
 sys32_fstat64_wrapper:
index 20f282c..071c81f 100644 (file)
@@ -893,35 +893,30 @@ s390dbf_procactive(ctl_table *table, int write,
 
 static struct ctl_table s390dbf_table[] = {
        {
-               .ctl_name       = CTL_S390DBF_STOPPABLE,
                .procname       = "debug_stoppable",
                .data           = &debug_stoppable,
                .maxlen         = sizeof(int),
                .mode           = S_IRUGO | S_IWUSR,
-               .proc_handler   = &proc_dointvec,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec,
        },
         {
-               .ctl_name       = CTL_S390DBF_ACTIVE,
                .procname       = "debug_active",
                .data           = &debug_active,
                .maxlen         = sizeof(int),
                .mode           = S_IRUGO | S_IWUSR,
-               .proc_handler   = &s390dbf_procactive,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = s390dbf_procactive,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 static struct ctl_table s390dbf_dir_table[] = {
        {
-               .ctl_name       = CTL_S390DBF,
                .procname       = "s390dbf",
                .maxlen         = 0,
                .mode           = S_IRUGO | S_IXUGO,
                .child          = s390dbf_table,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 static struct ctl_table_header *s390dbf_sysctl_header;
index b201135..ff58779 100644 (file)
@@ -343,30 +343,29 @@ static struct ctl_table cmm_table[] = {
        {
                .procname       = "cmm_pages",
                .mode           = 0644,
-               .proc_handler   = &cmm_pages_handler,
+               .proc_handler   = cmm_pages_handler,
        },
        {
                .procname       = "cmm_timed_pages",
                .mode           = 0644,
-               .proc_handler   = &cmm_pages_handler,
+               .proc_handler   = cmm_pages_handler,
        },
        {
                .procname       = "cmm_timeout",
                .mode           = 0644,
-               .proc_handler   = &cmm_timeout_handler,
+               .proc_handler   = cmm_timeout_handler,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 static struct ctl_table cmm_dir_table[] = {
        {
-               .ctl_name       = CTL_VM,
                .procname       = "vm",
                .maxlen         = 0,
                .mode           = 0555,
                .child          = cmm_table,
        },
-       { .ctl_name = 0 }
+       { }
 };
 #endif
 
index 267e5eb..75c0cbe 100644 (file)
@@ -877,44 +877,39 @@ static int misaligned_fixup(struct pt_regs *regs)
 
 static ctl_table unaligned_table[] = {
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "kernel_reports",
                .data           = &kernel_mode_unaligned_fixup_count,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec
+               .proc_handler   = proc_dointvec
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "user_reports",
                .data           = &user_mode_unaligned_fixup_count,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec
+               .proc_handler   = proc_dointvec
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "user_enable",
                .data           = &user_mode_unaligned_fixup_enable,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec},
+               .proc_handler   = proc_dointvec},
        {}
 };
 
 static ctl_table unaligned_root[] = {
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "unaligned_fixup",
                .mode           = 0555,
-               unaligned_table
+               .child          = unaligned_table
        },
        {}
 };
 
 static ctl_table sh64_root[] = {
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "sh64",
                .mode           = 0555,
                .child          = unaligned_root
index 04e28b2..f862372 100644 (file)
@@ -591,63 +591,6 @@ out:
        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,
                          unsigned long cookie_low,
                          char __user *buf, size_t len)
index 009825f..034b10e 100644 (file)
@@ -68,7 +68,7 @@ sys_call_table32:
        .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
        .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
 /*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
index 581b056..5d25848 100644 (file)
@@ -653,7 +653,7 @@ ia32_sys_call_table:
        .quad compat_sys_writev
        .quad sys_getsid
        .quad sys_fdatasync
-       .quad sys32_sysctl      /* sysctl */
+       .quad compat_sys_sysctl /* sysctl */
        .quad sys_mlock         /* 150 */
        .quad sys_munlock
        .quad sys_mlockall
index 9f55271..df82c0e 100644 (file)
@@ -434,62 +434,6 @@ asmlinkage long sys32_rt_sigqueueinfo(int pid, int sig,
        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 */
 asmlinkage long sys32_pread(unsigned int fd, char __user *ubuf, u32 count,
                            u32 poslo, u32 poshi)
index 72a6dcd..9af9dec 100644 (file)
@@ -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_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_pwrite(unsigned int, char __user *, u32, u32, u32);
 
index 8cb4974..e02d92d 100644 (file)
@@ -237,7 +237,7 @@ static ctl_table kernel_table2[] = {
 };
 
 static ctl_table kernel_root_table2[] = {
-       { .ctl_name = CTL_KERN, .procname = "kernel", .mode = 0555,
+       { .procname = "kernel", .mode = 0555,
          .child = kernel_table2 },
        {}
 };
index 58bc00f..02b442e 100644 (file)
@@ -393,7 +393,6 @@ static ctl_table abi_table2[] = {
 
 static ctl_table abi_root_table2[] = {
        {
-               .ctl_name = CTL_ABI,
                .procname = "abi",
                .mode = 0555,
                .child = abi_table2
index 5dc07e4..1c38733 100644 (file)
 #ifdef CONFIG_CRYPTO_FIPS
 static struct ctl_table crypto_sysctl_table[] = {
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "fips_enabled",
                .data           = &fips_enabled,
                .maxlen         = sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec
-       },
-       {
-               .ctl_name = 0,
+               .proc_handler   = proc_dointvec
        },
+       {}
 };
 
 static struct ctl_table crypto_dir_table[] = {
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "crypto",
                .mode           = 0555,
                .child          = crypto_sysctl_table
        },
-       {
-               .ctl_name = 0,
-       },
+       {}
 };
 
 static struct ctl_table_header *crypto_sysctls;
index 614da5b..e3749d0 100644 (file)
@@ -3557,67 +3557,65 @@ static ctl_table cdrom_table[] = {
                .data           = &cdrom_sysctl_settings.info, 
                .maxlen         = CDROM_STR_SIZE,
                .mode           = 0444,
-               .proc_handler   = &cdrom_sysctl_info,
+               .proc_handler   = cdrom_sysctl_info,
        },
        {
                .procname       = "autoclose",
                .data           = &cdrom_sysctl_settings.autoclose,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &cdrom_sysctl_handler,
+               .proc_handler   = cdrom_sysctl_handler,
        },
        {
                .procname       = "autoeject",
                .data           = &cdrom_sysctl_settings.autoeject,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &cdrom_sysctl_handler,
+               .proc_handler   = cdrom_sysctl_handler,
        },
        {
                .procname       = "debug",
                .data           = &cdrom_sysctl_settings.debug,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &cdrom_sysctl_handler,
+               .proc_handler   = cdrom_sysctl_handler,
        },
        {
                .procname       = "lock",
                .data           = &cdrom_sysctl_settings.lock,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &cdrom_sysctl_handler,
+               .proc_handler   = cdrom_sysctl_handler,
        },
        {
                .procname       = "check_media",
                .data           = &cdrom_sysctl_settings.check,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &cdrom_sysctl_handler
+               .proc_handler   = cdrom_sysctl_handler
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 static ctl_table cdrom_cdrom_table[] = {
        {
-               .ctl_name       = DEV_CDROM,
                .procname       = "cdrom",
                .maxlen         = 0,
                .mode           = 0555,
                .child          = cdrom_table,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 /* Make sure that /proc/sys/dev is there */
 static ctl_table cdrom_root_table[] = {
        {
-               .ctl_name       = CTL_DEV,
                .procname       = "dev",
                .maxlen         = 0,
                .mode           = 0555,
                .child          = cdrom_cdrom_table,
        },
-       { .ctl_name = 0 }
+       { }
 };
 static struct ctl_table_header *cdrom_sysctl_header;
 
index 70a770a..e481c59 100644 (file)
@@ -675,36 +675,33 @@ static int hpet_is_known(struct hpet_data *hdp)
 
 static ctl_table hpet_table[] = {
        {
-        .ctl_name = CTL_UNNUMBERED,
         .procname = "max-user-freq",
         .data = &hpet_max_freq,
         .maxlen = sizeof(int),
         .mode = 0644,
-        .proc_handler = &proc_dointvec,
+        .proc_handler = proc_dointvec,
         },
-       {.ctl_name = 0}
+       {}
 };
 
 static ctl_table hpet_root[] = {
        {
-        .ctl_name = CTL_UNNUMBERED,
         .procname = "hpet",
         .maxlen = 0,
         .mode = 0555,
         .child = hpet_table,
         },
-       {.ctl_name = 0}
+       {}
 };
 
 static ctl_table dev_root[] = {
        {
-        .ctl_name = CTL_DEV,
         .procname = "dev",
         .maxlen = 0,
         .mode = 0555,
         .child = hpet_root,
         },
-       {.ctl_name = 0}
+       {}
 };
 
 static struct ctl_table_header *sysctl_header;
index 2e66b5f..0dec5da 100644 (file)
@@ -660,26 +660,23 @@ static struct ipmi_smi_watcher smi_watcher = {
 #include <linux/sysctl.h>
 
 static ctl_table ipmi_table[] = {
-       { .ctl_name     = DEV_IPMI_POWEROFF_POWERCYCLE,
-         .procname     = "poweroff_powercycle",
+       { .procname     = "poweroff_powercycle",
          .data         = &poweroff_powercycle,
          .maxlen       = sizeof(poweroff_powercycle),
          .mode         = 0644,
-         .proc_handler = &proc_dointvec },
+         .proc_handler = proc_dointvec },
        { }
 };
 
 static ctl_table ipmi_dir_table[] = {
-       { .ctl_name     = DEV_IPMI,
-         .procname     = "ipmi",
+       { .procname     = "ipmi",
          .mode         = 0555,
          .child        = ipmi_table },
        { }
 };
 
 static ctl_table ipmi_root_table[] = {
-       { .ctl_name     = CTL_DEV,
-         .procname     = "dev",
+       { .procname     = "dev",
          .mode         = 0555,
          .child        = ipmi_dir_table },
        { }
index 62f282e..d86c0bc 100644 (file)
@@ -431,30 +431,25 @@ static struct cdev ptmx_cdev;
 
 static struct ctl_table pty_table[] = {
        {
-               .ctl_name       = PTY_MAX,
                .procname       = "max",
                .maxlen         = sizeof(int),
                .mode           = 0644,
                .data           = &pty_limit,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &pty_limit_min,
                .extra2         = &pty_limit_max,
        }, {
-               .ctl_name       = PTY_NR,
                .procname       = "nr",
                .maxlen         = sizeof(int),
                .mode           = 0444,
                .data           = &pty_count,
-               .proc_handler   = &proc_dointvec,
-       }, {
-               .ctl_name       = 0
-       }
+               .proc_handler   = proc_dointvec,
+       }, 
+       {}
 };
 
 static struct ctl_table pty_kern_table[] = {
        {
-               .ctl_name       = KERN_PTY,
                .procname       = "pty",
                .mode           = 0555,
                .child          = pty_table,
@@ -464,7 +459,6 @@ static struct ctl_table pty_kern_table[] = {
 
 static struct ctl_table pty_root_table[] = {
        {
-               .ctl_name       = CTL_KERN,
                .procname       = "kernel",
                .mode           = 0555,
                .child          = pty_kern_table,
index 04b505e..dcd0863 100644 (file)
@@ -1257,94 +1257,54 @@ static int proc_do_uuid(ctl_table *table, int write,
        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;
 ctl_table random_table[] = {
        {
-               .ctl_name       = RANDOM_POOLSIZE,
                .procname       = "poolsize",
                .data           = &sysctl_poolsize,
                .maxlen         = sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = RANDOM_ENTROPY_COUNT,
                .procname       = "entropy_avail",
                .maxlen         = sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
                .data           = &input_pool.entropy_count,
        },
        {
-               .ctl_name       = RANDOM_READ_THRESH,
                .procname       = "read_wakeup_threshold",
                .data           = &random_read_wakeup_thresh,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &min_read_thresh,
                .extra2         = &max_read_thresh,
        },
        {
-               .ctl_name       = RANDOM_WRITE_THRESH,
                .procname       = "write_wakeup_threshold",
                .data           = &random_write_wakeup_thresh,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &min_write_thresh,
                .extra2         = &max_write_thresh,
        },
        {
-               .ctl_name       = RANDOM_BOOT_ID,
                .procname       = "boot_id",
                .data           = &sysctl_bootid,
                .maxlen         = 16,
                .mode           = 0444,
-               .proc_handler   = &proc_do_uuid,
-               .strategy       = &uuid_strategy,
+               .proc_handler   = proc_do_uuid,
        },
        {
-               .ctl_name       = RANDOM_UUID,
                .procname       = "uuid",
                .maxlen         = 16,
                .mode           = 0444,
-               .proc_handler   = &proc_do_uuid,
-               .strategy       = &uuid_strategy,
+               .proc_handler   = proc_do_uuid,
        },
-       { .ctl_name = 0 }
+       { }
 };
 #endif         /* CONFIG_SYSCTL */
 
index bc4ab3e..95acb8c 100644 (file)
@@ -282,34 +282,31 @@ static irqreturn_t rtc_interrupt(int irq, void *dev_id)
  */
 static ctl_table rtc_table[] = {
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "max-user-freq",
                .data           = &rtc_max_user_freq,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 static ctl_table rtc_root[] = {
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "rtc",
                .mode           = 0555,
                .child          = rtc_table,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 static ctl_table dev_root[] = {
        {
-               .ctl_name       = CTL_DEV,
                .procname       = "dev",
                .mode           = 0555,
                .child          = rtc_root,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 static struct ctl_table_header *sysctl_header;
index cc9f275..7b4ef5b 100644 (file)
@@ -27,54 +27,49 @@ static int mouse_last_keycode;
 /* file(s) in /proc/sys/dev/mac_hid */
 static ctl_table mac_hid_files[] = {
        {
-               .ctl_name       = DEV_MAC_HID_MOUSE_BUTTON_EMULATION,
                .procname       = "mouse_button_emulation",
                .data           = &mouse_emulate_buttons,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE,
                .procname       = "mouse_button2_keycode",
                .data           = &mouse_button2_keycode,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE,
                .procname       = "mouse_button3_keycode",
                .data           = &mouse_button3_keycode,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 /* dir in /proc/sys/dev */
 static ctl_table mac_hid_dir[] = {
        {
-               .ctl_name       = DEV_MAC_HID,
                .procname       = "mac_hid",
                .maxlen         = 0,
                .mode           = 0555,
                .child          = mac_hid_files,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 /* /proc/sys/dev itself, in case that is not there yet */
 static ctl_table mac_hid_root_dir[] = {
        {
-               .ctl_name       = CTL_DEV,
                .procname       = "dev",
                .maxlen         = 0,
                .mode           = 0555,
                .child          = mac_hid_dir,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 static struct ctl_table_header *mac_hid_sysctl_header;
index b182f86..5f154ef 100644 (file)
@@ -98,44 +98,40 @@ static struct ctl_table_header *raid_table_header;
 
 static ctl_table raid_table[] = {
        {
-               .ctl_name       = DEV_RAID_SPEED_LIMIT_MIN,
                .procname       = "speed_limit_min",
                .data           = &sysctl_speed_limit_min,
                .maxlen         = sizeof(int),
                .mode           = S_IRUGO|S_IWUSR,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = DEV_RAID_SPEED_LIMIT_MAX,
                .procname       = "speed_limit_max",
                .data           = &sysctl_speed_limit_max,
                .maxlen         = sizeof(int),
                .mode           = S_IRUGO|S_IWUSR,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 static ctl_table raid_dir_table[] = {
        {
-               .ctl_name       = DEV_RAID,
                .procname       = "raid",
                .maxlen         = 0,
                .mode           = S_IRUGO|S_IXUGO,
                .child          = raid_table,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 static ctl_table raid_root_table[] = {
        {
-               .ctl_name       = CTL_DEV,
                .procname       = "dev",
                .maxlen         = 0,
                .mode           = 0555,
                .child          = raid_dir_table,
        },
-       { .ctl_name = 0 }
+       {  }
 };
 
 static const struct block_device_operations md_fops;
index fd3688a..832ed4c 100644 (file)
@@ -89,48 +89,40 @@ static int xpc_disengage_max_timelimit = 120;
 
 static ctl_table xpc_sys_xpc_hb_dir[] = {
        {
-        .ctl_name = CTL_UNNUMBERED,
         .procname = "hb_interval",
         .data = &xpc_hb_interval,
         .maxlen = sizeof(int),
         .mode = 0644,
-        .proc_handler = &proc_dointvec_minmax,
-        .strategy = &sysctl_intvec,
+        .proc_handler = proc_dointvec_minmax,
         .extra1 = &xpc_hb_min_interval,
         .extra2 = &xpc_hb_max_interval},
        {
-        .ctl_name = CTL_UNNUMBERED,
         .procname = "hb_check_interval",
         .data = &xpc_hb_check_interval,
         .maxlen = sizeof(int),
         .mode = 0644,
-        .proc_handler = &proc_dointvec_minmax,
-        .strategy = &sysctl_intvec,
+        .proc_handler = proc_dointvec_minmax,
         .extra1 = &xpc_hb_check_min_interval,
         .extra2 = &xpc_hb_check_max_interval},
        {}
 };
 static ctl_table xpc_sys_xpc_dir[] = {
        {
-        .ctl_name = CTL_UNNUMBERED,
         .procname = "hb",
         .mode = 0555,
         .child = xpc_sys_xpc_hb_dir},
        {
-        .ctl_name = CTL_UNNUMBERED,
         .procname = "disengage_timelimit",
         .data = &xpc_disengage_timelimit,
         .maxlen = sizeof(int),
         .mode = 0644,
-        .proc_handler = &proc_dointvec_minmax,
-        .strategy = &sysctl_intvec,
+        .proc_handler = proc_dointvec_minmax,
         .extra1 = &xpc_disengage_min_timelimit,
         .extra2 = &xpc_disengage_max_timelimit},
        {}
 };
 static ctl_table xpc_sys_dir[] = {
        {
-        .ctl_name = CTL_UNNUMBERED,
         .procname = "xpc",
         .mode = 0555,
         .child = xpc_sys_xpc_dir},
index a8b6896..b22983e 100644 (file)
@@ -816,84 +816,83 @@ static int arlan_sysctl_reset(ctl_table * ctl, int write,
 
 
 /* Place files in /proc/sys/dev/arlan */
-#define CTBLN(num,card,nam) \
-        { .ctl_name = num,\
-          .procname = #nam,\
+#define CTBLN(card,nam) \
+        { .procname = #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
 
 #define ARLAN_PROC_DEBUG_ENTRIES \
-        { .ctl_name = 48, .procname = "entry_exit_debug",\
+        { .procname = "entry_exit_debug",\
           .data = &arlan_entry_and_exit_debug,\
-          .maxlen = sizeof(int), .mode = 0600, .proc_handler = &proc_dointvec},\
-       { .ctl_name = 49, .procname = "debug", .data = &arlan_debug,\
-          .maxlen = sizeof(int), .mode = 0600, .proc_handler = &proc_dointvec},
+          .maxlen = sizeof(int), .mode = 0600, .proc_handler = proc_dointvec},\
+       { .procname = "debug", .data = &arlan_debug,\
+          .maxlen = sizeof(int), .mode = 0600, .proc_handler = proc_dointvec},
 #else 
 #define ARLAN_PROC_DEBUG_ENTRIES
 #endif
 
 #define ARLAN_SYSCTL_TABLE_TOTAL(cardNo)\
-       CTBLN(1,cardNo,spreadingCode),\
-       CTBLN(2,cardNo, channelNumber),\
-       CTBLN(3,cardNo, scramblingDisable),\
-       CTBLN(4,cardNo, txAttenuation),\
-       CTBLN(5,cardNo, systemId), \
-       CTBLN(6,cardNo, maxDatagramSize),\
-       CTBLN(7,cardNo, maxFrameSize),\
-       CTBLN(8,cardNo, maxRetries),\
-       CTBLN(9,cardNo, receiveMode),\
-       CTBLN(10,cardNo, priority),\
-       CTBLN(11,cardNo, rootOrRepeater),\
-       CTBLN(12,cardNo, SID),\
-       CTBLN(13,cardNo, registrationMode),\
-       CTBLN(14,cardNo, registrationFill),\
-       CTBLN(15,cardNo, localTalkAddress),\
-       CTBLN(16,cardNo, codeFormat),\
-       CTBLN(17,cardNo, numChannels),\
-       CTBLN(18,cardNo, channel1),\
-       CTBLN(19,cardNo, channel2),\
-       CTBLN(20,cardNo, channel3),\
-       CTBLN(21,cardNo, channel4),\
-       CTBLN(22,cardNo, txClear),\
-       CTBLN(23,cardNo, txRetries),\
-       CTBLN(24,cardNo, txRouting),\
-       CTBLN(25,cardNo, txScrambled),\
-       CTBLN(26,cardNo, rxParameter),\
-       CTBLN(27,cardNo, txTimeoutMs),\
-       CTBLN(28,cardNo, waitCardTimeout),\
-       CTBLN(29,cardNo, channelSet), \
-       {.ctl_name = 30, .procname = "name",\
+       CTBLN(cardNo,spreadingCode),\
+       CTBLN(cardNo, channelNumber),\
+       CTBLN(cardNo, scramblingDisable),\
+       CTBLN(cardNo, txAttenuation),\
+       CTBLN(cardNo, systemId), \
+       CTBLN(cardNo, maxDatagramSize),\
+       CTBLN(cardNo, maxFrameSize),\
+       CTBLN(cardNo, maxRetries),\
+       CTBLN(cardNo, receiveMode),\
+       CTBLN(cardNo, priority),\
+       CTBLN(cardNo, rootOrRepeater),\
+       CTBLN(cardNo, SID),\
+       CTBLN(cardNo, registrationMode),\
+       CTBLN(cardNo, registrationFill),\
+       CTBLN(cardNo, localTalkAddress),\
+       CTBLN(cardNo, codeFormat),\
+       CTBLN(cardNo, numChannels),\
+       CTBLN(cardNo, channel1),\
+       CTBLN(cardNo, channel2),\
+       CTBLN(cardNo, channel3),\
+       CTBLN(cardNo, channel4),\
+       CTBLN(cardNo, txClear),\
+       CTBLN(cardNo, txRetries),\
+       CTBLN(cardNo, txRouting),\
+       CTBLN(cardNo, txScrambled),\
+       CTBLN(cardNo, rxParameter),\
+       CTBLN(cardNo, txTimeoutMs),\
+       CTBLN(cardNo, waitCardTimeout),\
+       CTBLN(cardNo, channelSet), \
+       { .procname = "name",\
         .data = arlan_conf[cardNo].siteName,\
-        .maxlen = 16, .mode = 0600, .proc_handler = &proc_dostring},\
-       CTBLN(31,cardNo,waitTime),\
-       CTBLN(32,cardNo,lParameter),\
-       CTBLN(33,cardNo,_15),\
-       CTBLN(34,cardNo,headerSize),\
-       CTBLN(36,cardNo,tx_delay_ms),\
-       CTBLN(37,cardNo,retries),\
-       CTBLN(38,cardNo,ReTransmitPacketMaxSize),\
-       CTBLN(39,cardNo,waitReTransmitPacketMaxSize),\
-       CTBLN(40,cardNo,fastReTransCount),\
-       CTBLN(41,cardNo,driverRetransmissions),\
-       CTBLN(42,cardNo,txAckTimeoutMs),\
-       CTBLN(43,cardNo,registrationInterrupts),\
-       CTBLN(44,cardNo,hardwareType),\
-       CTBLN(45,cardNo,radioType),\
-       CTBLN(46,cardNo,writeEEPROM),\
-       CTBLN(47,cardNo,writeRadioType),\
+        .maxlen = 16, .mode = 0600, .proc_handler = proc_dostring},\
+       CTBLN(cardNo,waitTime),\
+       CTBLN(cardNo,lParameter),\
+       CTBLN(cardNo,_15),\
+       CTBLN(cardNo,headerSize),\
+       CTBLN(cardNo,tx_delay_ms),\
+       CTBLN(cardNo,retries),\
+       CTBLN(cardNo,ReTransmitPacketMaxSize),\
+       CTBLN(cardNo,waitReTransmitPacketMaxSize),\
+       CTBLN(cardNo,fastReTransCount),\
+       CTBLN(cardNo,driverRetransmissions),\
+       CTBLN(cardNo,txAckTimeoutMs),\
+       CTBLN(cardNo,registrationInterrupts),\
+       CTBLN(cardNo,hardwareType),\
+       CTBLN(cardNo,radioType),\
+       CTBLN(cardNo,writeEEPROM),\
+       CTBLN(cardNo,writeRadioType),\
        ARLAN_PROC_DEBUG_ENTRIES\
-       CTBLN(50,cardNo,in_speed),\
-       CTBLN(51,cardNo,out_speed),\
-       CTBLN(52,cardNo,in_speed10),\
-       CTBLN(53,cardNo,out_speed10),\
-       CTBLN(54,cardNo,in_speed_max),\
-       CTBLN(55,cardNo,out_speed_max),\
-       CTBLN(56,cardNo,measure_rate),\
-       CTBLN(57,cardNo,pre_Command_Wait),\
-       CTBLN(58,cardNo,rx_tweak1),\
-       CTBLN(59,cardNo,rx_tweak2),\
-       CTBLN(60,cardNo,tx_queue_len),\
+       CTBLN(cardNo,in_speed),\
+       CTBLN(cardNo,out_speed),\
+       CTBLN(cardNo,in_speed10),\
+       CTBLN(cardNo,out_speed10),\
+       CTBLN(cardNo,in_speed_max),\
+       CTBLN(cardNo,out_speed_max),\
+       CTBLN(cardNo,measure_rate),\
+       CTBLN(cardNo,pre_Command_Wait),\
+       CTBLN(cardNo,rx_tweak1),\
+       CTBLN(cardNo,rx_tweak2),\
+       CTBLN(cardNo,tx_queue_len),\
 
 
 
@@ -903,63 +902,56 @@ static ctl_table arlan_conf_table0[] =
 
 #ifdef ARLAN_PROC_SHM_DUMP
        {
-               .ctl_name       = 150,
                .procname       = "arlan0-txRing",
                .data           = &arlan_drive_info,
                .maxlen         = ARLAN_STR_SIZE,
                .mode           = 0400,
-               .proc_handler   = &arlan_sysctl_infotxRing,
+               .proc_handler   = arlan_sysctl_infotxRing,
        },
        {
-               .ctl_name       = 151,
                .procname       = "arlan0-rxRing",
                .data           = &arlan_drive_info,
                .maxlen         = ARLAN_STR_SIZE,
                .mode           = 0400,
-               .proc_handler   = &arlan_sysctl_inforxRing,
+               .proc_handler   = arlan_sysctl_inforxRing,
        },
        {
-               .ctl_name       = 152,
                .procname       = "arlan0-18",
                .data           = &arlan_drive_info,
                .maxlen         = ARLAN_STR_SIZE,
                .mode           = 0400,
-               .proc_handler   = &arlan_sysctl_info18,
+               .proc_handler   = arlan_sysctl_info18,
        },
        {
-               .ctl_name       = 153,
                .procname       = "arlan0-ring",
                .data           = &arlan_drive_info,
                .maxlen         = ARLAN_STR_SIZE,
                .mode           = 0400,
-               .proc_handler   = &arlan_sysctl_info161719,
+               .proc_handler   = arlan_sysctl_info161719,
        },
        {
-               .ctl_name       = 154,
                .procname       = "arlan0-shm-cpy",
                .data           = &arlan_drive_info,
                .maxlen         = ARLAN_STR_SIZE,
                .mode           = 0400,
-               .proc_handler   = &arlan_sysctl_info,
+               .proc_handler   = arlan_sysctl_info,
        },
 #endif
        {
-               .ctl_name       = 155,
                .procname       = "config0",
                .data           = &conf_reset_result,
                .maxlen         = 100,
                .mode           = 0400,
-               .proc_handler   = &arlan_configure
+               .proc_handler   = arlan_configure
        },
        {
-               .ctl_name       = 156,
                .procname       = "reset0",
                .data           = &conf_reset_result,
                .maxlen         = 100,
                .mode           = 0400,
-               .proc_handler   = &arlan_sysctl_reset,
+               .proc_handler   = arlan_sysctl_reset,
        },
-       { .ctl_name = 0 }
+       {  }
 };
 
 static ctl_table arlan_conf_table1[] =
@@ -969,63 +961,56 @@ static ctl_table arlan_conf_table1[] =
 
 #ifdef ARLAN_PROC_SHM_DUMP
        {
-               .ctl_name       = 150,
                .procname       = "arlan1-txRing",
                .data           = &arlan_drive_info,
                .maxlen         = ARLAN_STR_SIZE,
                .mode           = 0400,
-               .proc_handler   = &arlan_sysctl_infotxRing,
+               .proc_handler   = arlan_sysctl_infotxRing,
        },
        {
-               .ctl_name       = 151,
                .procname       = "arlan1-rxRing",
                .data           = &arlan_drive_info,
                .maxlen         = ARLAN_STR_SIZE,
                .mode           = 0400,
-               .proc_handler   = &arlan_sysctl_inforxRing,
+               .proc_handler   = arlan_sysctl_inforxRing,
        },
        {
-               .ctl_name       = 152,
                .procname       = "arlan1-18",
                .data           = &arlan_drive_info,
                .maxlen         = ARLAN_STR_SIZE,
                .mode           = 0400,
-               .proc_handler   = &arlan_sysctl_info18,
+               .proc_handler   = arlan_sysctl_info18,
        },
        {
-               .ctl_name       = 153,
                .procname       = "arlan1-ring",
                .data           = &arlan_drive_info,
                .maxlen         = ARLAN_STR_SIZE,
                .mode           = 0400,
-               .proc_handler   = &arlan_sysctl_info161719,
+               .proc_handler   = arlan_sysctl_info161719,
        },
        {
-               .ctl_name       = 154,
                .procname       = "arlan1-shm-cpy",
                .data           = &arlan_drive_info,
                .maxlen         = ARLAN_STR_SIZE,
                .mode           = 0400,
-               .proc_handler   = &arlan_sysctl_info,
+               .proc_handler   = arlan_sysctl_info,
        },
 #endif
        {
-               .ctl_name       = 155,
                .procname       = "config1",
                .data           = &conf_reset_result,
                .maxlen         = 100,
                .mode           = 0400,
-               .proc_handler   = &arlan_configure,
+               .proc_handler   = arlan_configure,
        },
        {
-               .ctl_name       = 156,
                .procname       = "reset1",
                .data           = &conf_reset_result,
                .maxlen         = 100,
                .mode           = 0400,
-               .proc_handler   = &arlan_sysctl_reset,
+               .proc_handler   = arlan_sysctl_reset,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 static ctl_table arlan_conf_table2[] =
@@ -1035,63 +1020,56 @@ static ctl_table arlan_conf_table2[] =
 
 #ifdef ARLAN_PROC_SHM_DUMP
        {
-               .ctl_name       = 150,
                .procname       = "arlan2-txRing",
                .data           = &arlan_drive_info,
                .maxlen         = ARLAN_STR_SIZE,
                .mode           = 0400,
-               .proc_handler   = &arlan_sysctl_infotxRing,
+               .proc_handler   = arlan_sysctl_infotxRing,
        },
        {
-               .ctl_name       = 151,
                .procname       = "arlan2-rxRing",
                .data           = &arlan_drive_info,
                .maxlen         = ARLAN_STR_SIZE,
                .mode           = 0400,
-               .proc_handler   = &arlan_sysctl_inforxRing,
+               .proc_handler   = arlan_sysctl_inforxRing,
        },
        {
-               .ctl_name       = 152,
                .procname       = "arlan2-18",
                .data           = &arlan_drive_info,
                .maxlen         = ARLAN_STR_SIZE,
                .mode           = 0400,
-               .proc_handler   = &arlan_sysctl_info18,
+               .proc_handler   = arlan_sysctl_info18,
        },
        {
-               .ctl_name       = 153,
                .procname       = "arlan2-ring",
                .data           = &arlan_drive_info,
                .maxlen         = ARLAN_STR_SIZE,
                .mode           = 0400,
-               .proc_handler   = &arlan_sysctl_info161719,
+               .proc_handler   = arlan_sysctl_info161719,
        },
        {
-               .ctl_name       = 154,
                .procname       = "arlan2-shm-cpy",
                .data           = &arlan_drive_info,
                .maxlen         = ARLAN_STR_SIZE,
                .mode           = 0400,
-               .proc_handler   = &arlan_sysctl_info,
+               .proc_handler   = arlan_sysctl_info,
        },
 #endif
        {
-               .ctl_name       = 155,
                .procname       = "config2",
                .data           = &conf_reset_result,
                .maxlen         = 100,
                .mode           = 0400,
-               .proc_handler   = &arlan_configure,
+               .proc_handler   = arlan_configure,
        },
        {
-               .ctl_name       = 156,
                .procname       = "reset2",
                .data           = &conf_reset_result,
                .maxlen         = 100,
                .mode           = 0400,
-               .proc_handler   = &arlan_sysctl_reset,
+               .proc_handler   = arlan_sysctl_reset,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 static ctl_table arlan_conf_table3[] =
@@ -1101,63 +1079,56 @@ static ctl_table arlan_conf_table3[] =
 
 #ifdef ARLAN_PROC_SHM_DUMP
        {
-               .ctl_name       = 150,
                .procname       = "arlan3-txRing",
                .data           = &arlan_drive_info,
                .maxlen         = ARLAN_STR_SIZE,
                .mode           = 0400,
-               .proc_handler   = &arlan_sysctl_infotxRing,
+               .proc_handler   = arlan_sysctl_infotxRing,
        },
        {
-               .ctl_name       = 151,
                .procname       = "arlan3-rxRing",
                .data           = &arlan_drive_info,
                .maxlen         = ARLAN_STR_SIZE,
                .mode           = 0400,
-               .proc_handler   = &arlan_sysctl_inforxRing,
+               .proc_handler   = arlan_sysctl_inforxRing,
        },
        {
-               .ctl_name       = 152,
                .procname       = "arlan3-18",
                .data           = &arlan_drive_info,
                .maxlen         = ARLAN_STR_SIZE,
                .mode           = 0400,
-               .proc_handler   = &arlan_sysctl_info18,
+               .proc_handler   = arlan_sysctl_info18,
        },
        {
-               .ctl_name       = 153,
                .procname       = "arlan3-ring",
                .data           = &arlan_drive_info,
                .maxlen         = ARLAN_STR_SIZE,
                .mode           = 0400,
-               .proc_handler   = &arlan_sysctl_info161719,
+               .proc_handler   = arlan_sysctl_info161719,
        },
        {
-               .ctl_name       = 154,
                .procname       = "arlan3-shm-cpy",
                .data           = &arlan_drive_info,
                .maxlen         = ARLAN_STR_SIZE,
                .mode           = 0400,
-               .proc_handler   = &arlan_sysctl_info,
+               .proc_handler   = arlan_sysctl_info,
        },
 #endif
        {
-               .ctl_name       = 155,
                .procname       = "config3",
                .data           = &conf_reset_result,
                .maxlen         = 100,
                .mode           = 0400,
-               .proc_handler   = &arlan_configure,
+               .proc_handler   = arlan_configure,
        },
        {
-               .ctl_name       = 156,
                .procname       = "reset3",
                .data           = &conf_reset_result,
                .maxlen         = 100,
                .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[] =
 static ctl_table arlan_table[] =
 {
        {
-               .ctl_name       = 0,
                .procname       = "arlan0",
                .maxlen         = 0,
                .mode           = 0600,
                .child          = arlan_conf_table0,
        },
        {
-               .ctl_name       = 0,
                .procname       = "arlan1",
                .maxlen         = 0,
                .mode           = 0600,
                .child          = arlan_conf_table1,
        },
        {
-               .ctl_name       = 0,
                .procname       = "arlan2",
                .maxlen         = 0,
                .mode           = 0600,
                .child          = arlan_conf_table2,
        },
        {
-               .ctl_name       = 0,
                .procname       = "arlan3",
                .maxlen         = 0,
                .mode           = 0600,
                .child          = arlan_conf_table3,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 #else
 
-static ctl_table arlan_table[MAX_ARLANS + 1] =
+static ctl_table arlan_table[] =
 {
-       { .ctl_name = 0 }
+       { }
 };
 #endif
 
@@ -1209,22 +1176,14 @@ static ctl_table arlan_table[MAX_ARLANS + 1] =
 static ctl_table arlan_root_table[] =
 {
        {
-               .ctl_name       = CTL_ARLAN,
                .procname       = "arlan",
                .maxlen         = 0,
                .mode           = 0555,
                .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;
 
@@ -1234,8 +1193,6 @@ int __init init_arlan_proc(void)
        int i = 0;
        if (arlan_device_sysctl_header)
                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);
        if (!arlan_device_sysctl_header)
                return -1;
index 8eefe56..3f56bc0 100644 (file)
@@ -233,10 +233,10 @@ static int do_hardware_modes (ctl_table *table, int write,
        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_PARPORT_DIR(CHILD) { .ctl_name = DEV_PARPORT, .procname = "parport", \
+#define PARPORT_PORT_DIR(CHILD) { .procname = NULL, .mode = 0555, .child = CHILD }
+#define PARPORT_PARPORT_DIR(CHILD) { .procname = "parport", \
                                      .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", \
                                     .mode = 0555, .child = NULL }
 
@@ -270,7 +270,7 @@ static const struct parport_sysctl_table parport_sysctl_template = {
                        .data           = NULL,
                        .maxlen         = sizeof(int),
                        .mode           = 0644,
-                       .proc_handler   = &proc_dointvec_minmax,
+                       .proc_handler   = proc_dointvec_minmax,
                        .extra1         = (void*) &parport_min_spintime_value,
                        .extra2         = (void*) &parport_max_spintime_value
                },
@@ -279,28 +279,28 @@ static const struct parport_sysctl_table parport_sysctl_template = {
                        .data           = NULL,
                        .maxlen         = 0,
                        .mode           = 0444,
-                       .proc_handler   = &do_hardware_base_addr
+                       .proc_handler   = do_hardware_base_addr
                },
                {
                        .procname       = "irq",
                        .data           = NULL,
                        .maxlen         = 0,
                        .mode           = 0444,
-                       .proc_handler   = &do_hardware_irq
+                       .proc_handler   = do_hardware_irq
                },
                {
                        .procname       = "dma",
                        .data           = NULL,
                        .maxlen         = 0,
                        .mode           = 0444,
-                       .proc_handler   = &do_hardware_dma
+                       .proc_handler   = do_hardware_dma
                },
                {
                        .procname       = "modes",
                        .data           = NULL,
                        .maxlen         = 0,
                        .mode           = 0444,
-                       .proc_handler   = &do_hardware_modes
+                       .proc_handler   = do_hardware_modes
                },
                PARPORT_DEVICES_ROOT_DIR,
 #ifdef CONFIG_PARPORT_1284
@@ -309,35 +309,35 @@ static const struct parport_sysctl_table parport_sysctl_template = {
                        .data           = NULL,
                        .maxlen         = 0,
                        .mode           = 0444,
-                       .proc_handler   = &do_autoprobe
+                       .proc_handler   = do_autoprobe
                },
                {
                        .procname       = "autoprobe0",
                        .data           = NULL,
                        .maxlen         = 0,
                        .mode           = 0444,
-                       .proc_handler   =  &do_autoprobe
+                       .proc_handler   = do_autoprobe
                },
                {
                        .procname       = "autoprobe1",
                        .data           = NULL,
                        .maxlen         = 0,
                        .mode           = 0444,
-                       .proc_handler   = &do_autoprobe
+                       .proc_handler   = do_autoprobe
                },
                {
                        .procname       = "autoprobe2",
                        .data           = NULL,
                        .maxlen         = 0,
                        .mode           = 0444,
-                       .proc_handler   = &do_autoprobe
+                       .proc_handler   = do_autoprobe
                },
                {
                        .procname       = "autoprobe3",
                        .data           = NULL,
                        .maxlen         = 0,
                        .mode           = 0444,
-                       .proc_handler   = &do_autoprobe
+                       .proc_handler   = do_autoprobe
                },
 #endif /* IEEE 1284 support */
                {}
@@ -348,7 +348,7 @@ static const struct parport_sysctl_table parport_sysctl_template = {
                        .data           = NULL,
                        .maxlen         = 0,
                        .mode           = 0444,
-                       .proc_handler   = &do_active_device
+                       .proc_handler   = do_active_device
                },
                {}
        },
@@ -386,14 +386,13 @@ parport_device_sysctl_template = {
                        .data           = NULL,
                        .maxlen         = sizeof(unsigned long),
                        .mode           = 0644,
-                       .proc_handler   = &proc_doulongvec_ms_jiffies_minmax,
+                       .proc_handler   = proc_doulongvec_ms_jiffies_minmax,
                        .extra1         = (void*) &parport_min_timeslice_value,
                        .extra2         = (void*) &parport_max_timeslice_value
                },
        },
        {
                {
-                       .ctl_name       = 0,
                        .procname       = NULL,
                        .data           = NULL,
                        .maxlen         = 0,
@@ -438,7 +437,7 @@ parport_default_sysctl_table = {
                        .data           = &parport_default_timeslice,
                        .maxlen         = sizeof(parport_default_timeslice),
                        .mode           = 0644,
-                       .proc_handler   = &proc_doulongvec_ms_jiffies_minmax,
+                       .proc_handler   = proc_doulongvec_ms_jiffies_minmax,
                        .extra1         = (void*) &parport_min_timeslice_value,
                        .extra2         = (void*) &parport_max_timeslice_value
                },
@@ -447,7 +446,7 @@ parport_default_sysctl_table = {
                        .data           = &parport_default_spintime,
                        .maxlen         = sizeof(parport_default_spintime),
                        .mode           = 0644,
-                       .proc_handler   = &proc_dointvec_minmax,
+                       .proc_handler   = proc_dointvec_minmax,
                        .extra1         = (void*) &parport_min_spintime_value,
                        .extra2         = (void*) &parport_max_spintime_value
                },
@@ -455,7 +454,6 @@ parport_default_sysctl_table = {
        },
        {
                {
-                       .ctl_name       = DEV_PARPORT_DEFAULT,
                        .procname       = "default",
                        .mode           = 0555,
                        .child          = parport_default_sysctl_table.vars
@@ -495,7 +493,6 @@ int parport_proc_register(struct parport *port)
                t->vars[6 + i].extra2 = &port->probe_info[i];
 
        t->port_dir[0].procname = port->name;
-       t->port_dir[0].ctl_name = 0;
 
        t->port_dir[0].child = t->vars;
        t->parport_dir[0].child = t->port_dir;
@@ -534,11 +531,9 @@ int parport_device_proc_register(struct pardevice *device)
        t->dev_dir[0].child = t->parport_dir;
        t->parport_dir[0].child = t->port_dir;
        t->port_dir[0].procname = port->name;
-       t->port_dir[0].ctl_name = 0;
        t->port_dir[0].child = t->devices_root_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].child = t->vars;
        t->vars[0].data = &device->timeslice;
index b44462a..740fe40 100644 (file)
@@ -101,18 +101,17 @@ static struct ctl_table callhome_table[] = {
                .mode           = 0644,
                .proc_handler   = proc_handler_callhome,
        },
-       { .ctl_name = 0 }
+       {}
 };
 
 static struct ctl_table kern_dir_table[] = {
        {
-               .ctl_name       = CTL_KERN,
                .procname       = "kernel",
                .maxlen         = 0,
                .mode           = 0555,
                .child          = callhome_table,
        },
-       { .ctl_name = 0 }
+       {}
 };
 
 /*
index 63a30f5..2b6b93f 100644 (file)
 
 
 static ctl_table scsi_table[] = {
-       { .ctl_name     = DEV_SCSI_LOGGING_LEVEL,
-         .procname     = "logging_level",
+       { .procname     = "logging_level",
          .data         = &scsi_logging_level,
          .maxlen       = sizeof(scsi_logging_level),
          .mode         = 0644,
-         .proc_handler = &proc_dointvec },
+         .proc_handler = proc_dointvec },
        { }
 };
 
 static ctl_table scsi_dir_table[] = {
-       { .ctl_name     = DEV_SCSI,
-         .procname     = "scsi",
+       { .procname     = "scsi",
          .mode         = 0555,
          .child        = scsi_table },
        { }
 };
 
 static ctl_table scsi_root_table[] = {
-       { .ctl_name     = CTL_DEV,
-         .procname     = "dev",
+       { .procname     = "dev",
          .mode         = 0555,
          .child        = scsi_dir_table },
        { }
index 43c96ce..c6405ce 100644 (file)
@@ -17,28 +17,25 @@ static struct ctl_table_header *fs_table_header;
 
 static ctl_table coda_table[] = {
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "timeout",
                .data           = &coda_timeout,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec
+               .proc_handler   = proc_dointvec
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "hard",
                .data           = &coda_hard,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec
+               .proc_handler   = proc_dointvec
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "fake_statfs",
                .data           = &coda_fake_statfs,
                .maxlen         = sizeof(int),
                .mode           = 0600,
-               .proc_handler   = &proc_dointvec
+               .proc_handler   = proc_dointvec
        },
        {}
 };
@@ -46,7 +43,6 @@ static ctl_table coda_table[] = {
 #ifdef CONFIG_SYSCTL
 static ctl_table fs_table[] = {
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "coda",
                .mode           = 0555,
                .child          = coda_table
index 085c5c0..366c503 100644 (file)
@@ -251,10 +251,10 @@ ctl_table epoll_table[] = {
                .data           = &max_user_watches,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &zero,
        },
-       { .ctl_name = 0 }
+       { }
 };
 #endif /* CONFIG_SYSCTL */
 
index 1a54ae1..e50cfa3 100644 (file)
@@ -371,82 +371,74 @@ EXPORT_SYMBOL_GPL(lockd_down);
 
 static ctl_table nlm_sysctls[] = {
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "nlm_grace_period",
                .data           = &nlm_grace_period,
                .maxlen         = sizeof(unsigned long),
                .mode           = 0644,
-               .proc_handler   = &proc_doulongvec_minmax,
+               .proc_handler   = proc_doulongvec_minmax,
                .extra1         = (unsigned long *) &nlm_grace_period_min,
                .extra2         = (unsigned long *) &nlm_grace_period_max,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "nlm_timeout",
                .data           = &nlm_timeout,
                .maxlen         = sizeof(unsigned long),
                .mode           = 0644,
-               .proc_handler   = &proc_doulongvec_minmax,
+               .proc_handler   = proc_doulongvec_minmax,
                .extra1         = (unsigned long *) &nlm_timeout_min,
                .extra2         = (unsigned long *) &nlm_timeout_max,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "nlm_udpport",
                .data           = &nlm_udpport,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = (int *) &nlm_port_min,
                .extra2         = (int *) &nlm_port_max,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "nlm_tcpport",
                .data           = &nlm_tcpport,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = (int *) &nlm_port_min,
                .extra2         = (int *) &nlm_port_max,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "nsm_use_hostnames",
                .data           = &nsm_use_hostnames,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "nsm_local_state",
                .data           = &nsm_local_state,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 static ctl_table nlm_sysctl_dir[] = {
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "nfs",
                .mode           = 0555,
                .child          = nlm_sysctls,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 static ctl_table nlm_sysctl_root[] = {
        {
-               .ctl_name       = CTL_FS,
                .procname       = "fs",
                .mode           = 0555,
                .child          = nlm_sysctl_dir,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 #endif /* CONFIG_SYSCTL */
index b62481d..70e1fbb 100644 (file)
@@ -22,63 +22,55 @@ static struct ctl_table_header *nfs_callback_sysctl_table;
 static ctl_table nfs_cb_sysctls[] = {
 #ifdef CONFIG_NFS_V4
        {
-               .ctl_name = CTL_UNNUMBERED,
                .procname = "nfs_callback_tcpport",
                .data = &nfs_callback_set_tcpport,
                .maxlen = sizeof(int),
                .mode = 0644,
-               .proc_handler = &proc_dointvec_minmax,
+               .proc_handler = proc_dointvec_minmax,
                .extra1 = (int *)&nfs_set_port_min,
                .extra2 = (int *)&nfs_set_port_max,
        },
        {
-               .ctl_name = CTL_UNNUMBERED,
                .procname = "idmap_cache_timeout",
                .data = &nfs_idmap_cache_timeout,
                .maxlen = sizeof(int),
                .mode = 0644,
-               .proc_handler = &proc_dointvec_jiffies,
-               .strategy = &sysctl_jiffies,
+               .proc_handler = proc_dointvec_jiffies,
        },
 #endif
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "nfs_mountpoint_timeout",
                .data           = &nfs_mountpoint_expiry_timeout,
                .maxlen         = sizeof(nfs_mountpoint_expiry_timeout),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_jiffies,
-               .strategy       = &sysctl_jiffies,
+               .proc_handler   = proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "nfs_congestion_kb",
                .data           = &nfs_congestion_kb,
                .maxlen         = sizeof(nfs_congestion_kb),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 static ctl_table nfs_cb_sysctl_dir[] = {
        {
-               .ctl_name = CTL_UNNUMBERED,
                .procname = "nfs",
                .mode = 0555,
                .child = nfs_cb_sysctls,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 static ctl_table nfs_cb_sysctl_root[] = {
        {
-               .ctl_name = CTL_FS,
                .procname = "fs",
                .mode = 0555,
                .child = nfs_cb_sysctl_dir,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 int nfs_register_sysctl(void)
index dcd2040..1d1d1a2 100644 (file)
@@ -69,36 +69,30 @@ static int zero;
 
 ctl_table inotify_table[] = {
        {
-               .ctl_name       = INOTIFY_MAX_USER_INSTANCES,
                .procname       = "max_user_instances",
                .data           = &inotify_max_user_instances,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &zero,
        },
        {
-               .ctl_name       = INOTIFY_MAX_USER_WATCHES,
                .procname       = "max_user_watches",
                .data           = &inotify_max_user_watches,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &zero,
        },
        {
-               .ctl_name       = INOTIFY_MAX_QUEUED_EVENTS,
                .procname       = "max_queued_events",
                .data           = &inotify_max_queued_events,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &zero
        },
-       { .ctl_name = 0 }
+       { }
 };
 #endif /* CONFIG_SYSCTL */
 
index 9ef85e6..79a8918 100644 (file)
 /* Definition of the ntfs sysctl. */
 static ctl_table ntfs_sysctls[] = {
        {
-               .ctl_name       = CTL_UNNUMBERED,       /* Binary and text IDs. */
                .procname       = "ntfs-debug",
                .data           = &debug_msgs,          /* Data pointer and size. */
                .maxlen         = sizeof(debug_msgs),
                .mode           = 0644,                 /* Mode, proc handler. */
-               .proc_handler   = &proc_dointvec
+               .proc_handler   = proc_dointvec
        },
        {}
 };
@@ -49,7 +48,6 @@ static ctl_table ntfs_sysctls[] = {
 /* Define the parent directory /proc/sys/fs. */
 static ctl_table sysctls_root[] = {
        {
-               .ctl_name       = CTL_FS,
                .procname       = "fs",
                .mode           = 0555,
                .child          = ntfs_sysctls
index 3f2f1c4..f3df0ba 100644 (file)
@@ -620,51 +620,46 @@ error:
 
 static ctl_table ocfs2_nm_table[] = {
        {
-               .ctl_name       = 1,
                .procname       = "hb_ctl_path",
                .data           = ocfs2_hb_ctl_path,
                .maxlen         = OCFS2_MAX_HB_CTL_PATH,
                .mode           = 0644,
-               .proc_handler   = &proc_dostring,
-               .strategy       = &sysctl_string,
+               .proc_handler   = proc_dostring,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 static ctl_table ocfs2_mod_table[] = {
        {
-               .ctl_name       = FS_OCFS2_NM,
                .procname       = "nm",
                .data           = NULL,
                .maxlen         = 0,
                .mode           = 0555,
                .child          = ocfs2_nm_table
        },
-       { .ctl_name = 0}
+       { }
 };
 
 static ctl_table ocfs2_kern_table[] = {
        {
-               .ctl_name       = FS_OCFS2,
                .procname       = "ocfs2",
                .data           = NULL,
                .maxlen         = 0,
                .mode           = 0555,
                .child          = ocfs2_mod_table
        },
-       { .ctl_name = 0}
+       { }
 };
 
 static ctl_table ocfs2_root_table[] = {
        {
-               .ctl_name       = CTL_FS,
                .procname       = "fs",
                .data           = NULL,
                .maxlen         = 0,
                .mode           = 0555,
                .child          = ocfs2_kern_table
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 static struct ctl_table_header *ocfs2_table_header = NULL;
index f667e8a..6ff9981 100644 (file)
@@ -48,7 +48,7 @@ out:
 static struct ctl_table *find_in_table(struct ctl_table *p, struct qstr *name)
 {
        int len;
-       for ( ; p->ctl_name || p->procname; p++) {
+       for ( ; p->procname; p++) {
 
                if (!p->procname)
                        continue;
@@ -218,7 +218,7 @@ static int scan(struct ctl_table_header *head, ctl_table *table,
                void *dirent, filldir_t filldir)
 {
 
-       for (; table->ctl_name || table->procname; table++, (*pos)++) {
+       for (; table->procname; table++, (*pos)++) {
                int res;
 
                /* Can't do anything without a proc name */
index 9b6ad90..eb5a755 100644 (file)
@@ -2404,100 +2404,89 @@ const struct quotactl_ops vfs_quotactl_ops = {
 
 static ctl_table fs_dqstats_table[] = {
        {
-               .ctl_name       = FS_DQ_LOOKUPS,
                .procname       = "lookups",
                .data           = &dqstats.lookups,
                .maxlen         = sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = FS_DQ_DROPS,
                .procname       = "drops",
                .data           = &dqstats.drops,
                .maxlen         = sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = FS_DQ_READS,
                .procname       = "reads",
                .data           = &dqstats.reads,
                .maxlen         = sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = FS_DQ_WRITES,
                .procname       = "writes",
                .data           = &dqstats.writes,
                .maxlen         = sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = FS_DQ_CACHE_HITS,
                .procname       = "cache_hits",
                .data           = &dqstats.cache_hits,
                .maxlen         = sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = FS_DQ_ALLOCATED,
                .procname       = "allocated_dquots",
                .data           = &dqstats.allocated_dquots,
                .maxlen         = sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = FS_DQ_FREE,
                .procname       = "free_dquots",
                .data           = &dqstats.free_dquots,
                .maxlen         = sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = FS_DQ_SYNCS,
                .procname       = "syncs",
                .data           = &dqstats.syncs,
                .maxlen         = sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #ifdef CONFIG_PRINT_QUOTA_WARNING
        {
-               .ctl_name       = FS_DQ_WARNINGS,
                .procname       = "warnings",
                .data           = &flag_print_warnings,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #endif
-       { .ctl_name = 0 },
+       { },
 };
 
 static ctl_table fs_table[] = {
        {
-               .ctl_name       = FS_DQSTATS,
                .procname       = "quota",
                .mode           = 0555,
                .child          = fs_dqstats_table,
        },
-       { .ctl_name = 0 },
+       { },
 };
 
 static ctl_table sys_table[] = {
        {
-               .ctl_name       = CTL_FS,
                .procname       = "fs",
                .mode           = 0555,
                .child          = fs_table,
        },
-       { .ctl_name = 0 },
+       { },
 };
 
 static int __init dquot_init(void)
index c5bc67c..7bb5092 100644 (file)
@@ -55,170 +55,140 @@ xfs_stats_clear_proc_handler(
 
 static ctl_table xfs_table[] = {
        {
-               .ctl_name       = XFS_SGID_INHERIT,
                .procname       = "irix_sgid_inherit",
                .data           = &xfs_params.sgid_inherit.val,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &xfs_params.sgid_inherit.min,
                .extra2         = &xfs_params.sgid_inherit.max
        },
        {
-               .ctl_name       = XFS_SYMLINK_MODE,
                .procname       = "irix_symlink_mode",
                .data           = &xfs_params.symlink_mode.val,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &xfs_params.symlink_mode.min,
                .extra2         = &xfs_params.symlink_mode.max
        },
        {
-               .ctl_name       = XFS_PANIC_MASK,
                .procname       = "panic_mask",
                .data           = &xfs_params.panic_mask.val,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &xfs_params.panic_mask.min,
                .extra2         = &xfs_params.panic_mask.max
        },
 
        {
-               .ctl_name       = XFS_ERRLEVEL,
                .procname       = "error_level",
                .data           = &xfs_params.error_level.val,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &xfs_params.error_level.min,
                .extra2         = &xfs_params.error_level.max
        },
        {
-               .ctl_name       = XFS_SYNCD_TIMER,
                .procname       = "xfssyncd_centisecs",
                .data           = &xfs_params.syncd_timer.val,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &xfs_params.syncd_timer.min,
                .extra2         = &xfs_params.syncd_timer.max
        },
        {
-               .ctl_name       = XFS_INHERIT_SYNC,
                .procname       = "inherit_sync",
                .data           = &xfs_params.inherit_sync.val,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &xfs_params.inherit_sync.min,
                .extra2         = &xfs_params.inherit_sync.max
        },
        {
-               .ctl_name       = XFS_INHERIT_NODUMP,
                .procname       = "inherit_nodump",
                .data           = &xfs_params.inherit_nodump.val,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &xfs_params.inherit_nodump.min,
                .extra2         = &xfs_params.inherit_nodump.max
        },
        {
-               .ctl_name       = XFS_INHERIT_NOATIME,
                .procname       = "inherit_noatime",
                .data           = &xfs_params.inherit_noatim.val,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &xfs_params.inherit_noatim.min,
                .extra2         = &xfs_params.inherit_noatim.max
        },
        {
-               .ctl_name       = XFS_BUF_TIMER,
                .procname       = "xfsbufd_centisecs",
                .data           = &xfs_params.xfs_buf_timer.val,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &xfs_params.xfs_buf_timer.min,
                .extra2         = &xfs_params.xfs_buf_timer.max
        },
        {
-               .ctl_name       = XFS_BUF_AGE,
                .procname       = "age_buffer_centisecs",
                .data           = &xfs_params.xfs_buf_age.val,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &xfs_params.xfs_buf_age.min,
                .extra2         = &xfs_params.xfs_buf_age.max
        },
        {
-               .ctl_name       = XFS_INHERIT_NOSYM,
                .procname       = "inherit_nosymlinks",
                .data           = &xfs_params.inherit_nosym.val,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &xfs_params.inherit_nosym.min,
                .extra2         = &xfs_params.inherit_nosym.max
        },
        {
-               .ctl_name       = XFS_ROTORSTEP,
                .procname       = "rotorstep",
                .data           = &xfs_params.rotorstep.val,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &xfs_params.rotorstep.min,
                .extra2         = &xfs_params.rotorstep.max
        },
        {
-               .ctl_name       = XFS_INHERIT_NODFRG,
                .procname       = "inherit_nodefrag",
                .data           = &xfs_params.inherit_nodfrg.val,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &xfs_params.inherit_nodfrg.min,
                .extra2         = &xfs_params.inherit_nodfrg.max
        },
        {
-               .ctl_name       = XFS_FILESTREAM_TIMER,
                .procname       = "filestream_centisecs",
                .data           = &xfs_params.fstrm_timer.val,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &xfs_params.fstrm_timer.min,
                .extra2         = &xfs_params.fstrm_timer.max,
        },
        /* please keep this the last entry */
 #ifdef CONFIG_PROC_FS
        {
-               .ctl_name       = XFS_STATS_CLEAR,
                .procname       = "stats_clear",
                .data           = &xfs_params.stats_clear.val,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &xfs_stats_clear_proc_handler,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = xfs_stats_clear_proc_handler,
                .extra1         = &xfs_params.stats_clear.min,
                .extra2         = &xfs_params.stats_clear.max
        },
@@ -229,7 +199,6 @@ static ctl_table xfs_table[] = {
 
 static ctl_table xfs_dir_table[] = {
        {
-               .ctl_name       = FS_XFS,
                .procname       = "xfs",
                .mode           = 0555,
                .child          = xfs_table
@@ -239,7 +208,6 @@ static ctl_table xfs_dir_table[] = {
 
 static ctl_table xfs_root_table[] = {
        {
-               .ctl_name       = CTL_FS,
                .procname       = "fs",
                .mode           = 0555,
                .child          = xfs_dir_table
index 1e4743e..c83a86a 100644 (file)
@@ -15,9 +15,6 @@
  **  The kernel will then return -ENOTDIR to any application using
  **  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 {
 
 /* 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
 {
        CTL_KERN=1,             /* General kernel info and control */
@@ -972,10 +963,6 @@ extern int sysctl_perm(struct ctl_table_root *root,
 
 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,
                          void __user *buffer, size_t *lenp, loff_t *ppos);
 
@@ -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,
                                      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
- * with an initialised array of struct ctl_table's.  An entry with zero
- * ctl_name and NULL procname terminates the table.  table->de will be
+ * with an initialised array of struct ctl_table's.  An entry with 
+ * NULL procname terminates the table.  table->de will be
  * set up by the registration and need not be initialised in advance.
  *
  * sysctl names can be mirrored automatically under /proc/sys.  The
@@ -1023,24 +999,11 @@ extern ctl_handler sysctl_ms_jiffies;
  * under /proc; non-leaf nodes will be represented by directories.  A
  * 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
  * the sysctl table.  The data and maxlen fields of the ctl_table
  * struct enable minimal validation of the values being written to be
  * 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
  * mirrored under /proc/sys (non-terminals are handled by a built-in
  * directory handler).  Several default handlers are available to
@@ -1050,7 +1013,6 @@ extern ctl_handler sysctl_ms_jiffies;
 /* A sysctl table is an array of struct ctl_table: */
 struct ctl_table 
 {
-       int ctl_name;                   /* Binary ID */
        const char *procname;           /* Text ID for /proc/sys, or zero */
        void *data;
        int maxlen;
@@ -1058,7 +1020,6 @@ struct ctl_table
        struct ctl_table *child;
        struct ctl_table *parent;       /* Automatically set */
        proc_handler *proc_handler;     /* Callback for text formatting */
-       ctl_handler *strategy;          /* Callback function for all r/w */
        void *extra1;
        void *extra2;
 };
@@ -1092,7 +1053,6 @@ struct ctl_table_header
 /* struct ctl_path describes where in the hierarchy a table is added */
 struct ctl_path {
        const char *procname;
-       int ctl_name;
 };
 
 void register_sysctl_root(struct ctl_table_root *root);
index cee4682..3f781a4 100644 (file)
@@ -75,7 +75,6 @@ struct dn_dev_parms {
        unsigned long t3;         /* Default value of t3                */
        int priority;             /* Priority to be a router            */
        char *name;               /* Name for sysctl                    */
-       int ctl_name;             /* Index for sysctl                   */
        int  (*up)(struct net_device *);
        void (*down)(struct net_device *);
        void (*timer3)(struct net_device *, struct dn_ifaddr *ifa);
index 3817fda..da99fdd 100644 (file)
@@ -264,8 +264,7 @@ extern int                  neigh_sysctl_register(struct net_device *dev,
                                                      struct neigh_parms *p,
                                                      int p_id, int pdev_id,
                                                      char *p_name,
-                                                     proc_handler *proc_handler,
-                                                     ctl_handler *strategy);
+                                                     proc_handler *proc_handler);
 extern void                    neigh_sysctl_unregister(struct neigh_parms *p);
 
 static inline void __neigh_parms_put(struct neigh_parms *parms)
index 9ee7782..3889924 100644 (file)
@@ -763,6 +763,7 @@ config UID16
 
 config SYSCTL_SYSCALL
        bool "Sysctl syscall support" if EMBEDDED
+       depends on PROC_SYSCTL
        default y
        select SYSCTL
        ---help---
index 7d37047..56410fa 100644 (file)
@@ -129,136 +129,60 @@ static int proc_ipcauto_dointvec_minmax(ctl_table *table, int write,
 #define proc_ipcauto_dointvec_minmax NULL
 #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 one = 1;
 
 static struct ctl_table ipc_kern_table[] = {
        {
-               .ctl_name       = KERN_SHMMAX,
                .procname       = "shmmax",
                .data           = &init_ipc_ns.shm_ctlmax,
                .maxlen         = sizeof (init_ipc_ns.shm_ctlmax),
                .mode           = 0644,
                .proc_handler   = proc_ipc_doulongvec_minmax,
-               .strategy       = sysctl_ipc_data,
        },
        {
-               .ctl_name       = KERN_SHMALL,
                .procname       = "shmall",
                .data           = &init_ipc_ns.shm_ctlall,
                .maxlen         = sizeof (init_ipc_ns.shm_ctlall),
                .mode           = 0644,
                .proc_handler   = proc_ipc_doulongvec_minmax,
-               .strategy       = sysctl_ipc_data,
        },
        {
-               .ctl_name       = KERN_SHMMNI,
                .procname       = "shmmni",
                .data           = &init_ipc_ns.shm_ctlmni,
                .maxlen         = sizeof (init_ipc_ns.shm_ctlmni),
                .mode           = 0644,
                .proc_handler   = proc_ipc_dointvec,
-               .strategy       = sysctl_ipc_data,
        },
        {
-               .ctl_name       = KERN_MSGMAX,
                .procname       = "msgmax",
                .data           = &init_ipc_ns.msg_ctlmax,
                .maxlen         = sizeof (init_ipc_ns.msg_ctlmax),
                .mode           = 0644,
                .proc_handler   = proc_ipc_dointvec,
-               .strategy       = sysctl_ipc_data,
        },
        {
-               .ctl_name       = KERN_MSGMNI,
                .procname       = "msgmni",
                .data           = &init_ipc_ns.msg_ctlmni,
                .maxlen         = sizeof (init_ipc_ns.msg_ctlmni),
                .mode           = 0644,
                .proc_handler   = proc_ipc_callback_dointvec,
-               .strategy       = sysctl_ipc_registered_data,
        },
        {
-               .ctl_name       = KERN_MSGMNB,
                .procname       =  "msgmnb",
                .data           = &init_ipc_ns.msg_ctlmnb,
                .maxlen         = sizeof (init_ipc_ns.msg_ctlmnb),
                .mode           = 0644,
                .proc_handler   = proc_ipc_dointvec,
-               .strategy       = sysctl_ipc_data,
        },
        {
-               .ctl_name       = KERN_SEM,
                .procname       = "sem",
                .data           = &init_ipc_ns.sem_ctls,
                .maxlen         = 4*sizeof (int),
                .mode           = 0644,
                .proc_handler   = proc_ipc_dointvec,
-               .strategy       = sysctl_ipc_data,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "auto_msgmni",
                .data           = &init_ipc_ns.auto_msgmni,
                .maxlen         = sizeof(int),
@@ -272,7 +196,6 @@ static struct ctl_table ipc_kern_table[] = {
 
 static struct ctl_table ipc_root_table[] = {
        {
-               .ctl_name       = CTL_KERN,
                .procname       = "kernel",
                .mode           = 0555,
                .child          = ipc_kern_table,
index 8a05871..0c09366 100644 (file)
@@ -88,7 +88,7 @@ static ctl_table mq_sysctls[] = {
                .extra1         = &msg_maxsize_limit_min,
                .extra2         = &msg_maxsize_limit_max,
        },
-       { .ctl_name = 0 }
+       {}
 };
 
 static ctl_table mq_sysctl_dir[] = {
@@ -97,17 +97,16 @@ static ctl_table mq_sysctl_dir[] = {
                .mode           = 0555,
                .child          = mq_sysctls,
        },
-       { .ctl_name = 0 }
+       {}
 };
 
 static ctl_table mq_sysctl_root[] = {
        {
-               .ctl_name       = CTL_FS,
                .procname       = "fs",
                .mode           = 0555,
                .child          = mq_sysctl_dir,
        },
-       { .ctl_name = 0 }
+       {}
 };
 
 struct ctl_table_header *mq_register_sysctl_table(void)
index 982c50e..9943202 100644 (file)
@@ -4,7 +4,7 @@
 
 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 \
-           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 \
            rcupdate.o extable.o params.o posix-timers.o \
            kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \
index aa31244..e7f2cfa 100644 (file)
@@ -7444,17 +7444,16 @@ static struct ctl_table sd_ctl_dir[] = {
                .procname       = "sched_domain",
                .mode           = 0555,
        },
-       {0, },
+       {}
 };
 
 static struct ctl_table sd_ctl_root[] = {
        {
-               .ctl_name       = CTL_KERN,
                .procname       = "kernel",
                .mode           = 0555,
                .child          = sd_ctl_dir,
        },
-       {0, },
+       {}
 };
 
 static struct ctl_table *sd_alloc_ctl_entry(int n)
index 00889bd..7494bbf 100644 (file)
@@ -49,7 +49,6 @@ static const int slow_work_max_vslow = 99;
 
 ctl_table slow_work_sysctls[] = {
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "min-threads",
                .data           = &slow_work_min_threads,
                .maxlen         = sizeof(unsigned),
@@ -59,7 +58,6 @@ ctl_table slow_work_sysctls[] = {
                .extra2         = &slow_work_max_threads,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "max-threads",
                .data           = &slow_work_max_threads,
                .maxlen         = sizeof(unsigned),
@@ -69,16 +67,15 @@ ctl_table slow_work_sysctls[] = {
                .extra2         = (void *) &slow_work_max_max_threads,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "vslow-percentage",
                .data           = &vslow_work_proportion,
                .maxlen         = sizeof(unsigned),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = (void *) &slow_work_min_vslow,
                .extra2         = (void *) &slow_work_max_vslow,
        },
-       { .ctl_name = 0 }
+       {}
 };
 #endif
 
index e06d0b8..de5bf14 100644 (file)
@@ -139,7 +139,6 @@ cond_syscall(sys_pciconfig_read);
 cond_syscall(sys_pciconfig_write);
 cond_syscall(sys_pciconfig_iobase);
 cond_syscall(sys32_ipc);
-cond_syscall(sys32_sysctl);
 cond_syscall(ppc_rtas);
 cond_syscall(sys_spu_run);
 cond_syscall(sys_spu_create);
index 4dbf93a..9327a26 100644 (file)
@@ -27,7 +27,6 @@
 #include <linux/security.h>
 #include <linux/ctype.h>
 #include <linux/kmemcheck.h>
-#include <linux/smp_lock.h>
 #include <linux/fs.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
@@ -61,7 +60,6 @@
 #include <asm/io.h>
 #endif
 
-static int deprecated_sysctl_warning(struct __sysctl_args *args);
 
 #if defined(CONFIG_SYSCTL)
 
@@ -210,31 +208,26 @@ extern int lock_stat;
 
 static struct ctl_table root_table[] = {
        {
-               .ctl_name       = CTL_KERN,
                .procname       = "kernel",
                .mode           = 0555,
                .child          = kern_table,
        },
        {
-               .ctl_name       = CTL_VM,
                .procname       = "vm",
                .mode           = 0555,
                .child          = vm_table,
        },
        {
-               .ctl_name       = CTL_FS,
                .procname       = "fs",
                .mode           = 0555,
                .child          = fs_table,
        },
        {
-               .ctl_name       = CTL_DEBUG,
                .procname       = "debug",
                .mode           = 0555,
                .child          = debug_table,
        },
        {
-               .ctl_name       = CTL_DEV,
                .procname       = "dev",
                .mode           = 0555,
                .child          = dev_table,
@@ -243,7 +236,7 @@ static struct ctl_table root_table[] = {
  * NOTE: do not add new entries to this table unless you have read
  * Documentation/sysctl/ctl_unnumbered.txt
  */
-       { .ctl_name = 0 }
+       { }
 };
 
 #ifdef CONFIG_SCHED_DEBUG
@@ -255,192 +248,166 @@ static int max_wakeup_granularity_ns = NSEC_PER_SEC;    /* 1 second */
 
 static struct ctl_table kern_table[] = {
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "sched_child_runs_first",
                .data           = &sysctl_sched_child_runs_first,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #ifdef CONFIG_SCHED_DEBUG
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "sched_min_granularity_ns",
                .data           = &sysctl_sched_min_granularity,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = &sched_nr_latency_handler,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = sched_nr_latency_handler,
                .extra1         = &min_sched_granularity_ns,
                .extra2         = &max_sched_granularity_ns,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "sched_latency_ns",
                .data           = &sysctl_sched_latency,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = &sched_nr_latency_handler,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = sched_nr_latency_handler,
                .extra1         = &min_sched_granularity_ns,
                .extra2         = &max_sched_granularity_ns,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "sched_wakeup_granularity_ns",
                .data           = &sysctl_sched_wakeup_granularity,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &min_wakeup_granularity_ns,
                .extra2         = &max_wakeup_granularity_ns,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "sched_shares_ratelimit",
                .data           = &sysctl_sched_shares_ratelimit,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "sched_shares_thresh",
                .data           = &sysctl_sched_shares_thresh,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &zero,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "sched_features",
                .data           = &sysctl_sched_features,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "sched_migration_cost",
                .data           = &sysctl_sched_migration_cost,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "sched_nr_migrate",
                .data           = &sysctl_sched_nr_migrate,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "sched_time_avg",
                .data           = &sysctl_sched_time_avg,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "timer_migration",
                .data           = &sysctl_timer_migration,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &zero,
                .extra2         = &one,
        },
 #endif
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "sched_rt_period_us",
                .data           = &sysctl_sched_rt_period,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = &sched_rt_handler,
+               .proc_handler   = sched_rt_handler,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "sched_rt_runtime_us",
                .data           = &sysctl_sched_rt_runtime,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &sched_rt_handler,
+               .proc_handler   = sched_rt_handler,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "sched_compat_yield",
                .data           = &sysctl_sched_compat_yield,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #ifdef CONFIG_PROVE_LOCKING
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "prove_locking",
                .data           = &prove_locking,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #endif
 #ifdef CONFIG_LOCK_STAT
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "lock_stat",
                .data           = &lock_stat,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #endif
        {
-               .ctl_name       = KERN_PANIC,
                .procname       = "panic",
                .data           = &panic_timeout,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = KERN_CORE_USES_PID,
                .procname       = "core_uses_pid",
                .data           = &core_uses_pid,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = KERN_CORE_PATTERN,
                .procname       = "core_pattern",
                .data           = core_pattern,
                .maxlen         = CORENAME_MAX_SIZE,
                .mode           = 0644,
-               .proc_handler   = &proc_dostring,
-               .strategy       = &sysctl_string,
+               .proc_handler   = proc_dostring,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "core_pipe_limit",
                .data           = &core_pipe_limit,
                .maxlen         = sizeof(unsigned int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #ifdef CONFIG_PROC_SYSCTL
        {
                .procname       = "tainted",
                .maxlen         = sizeof(long),
                .mode           = 0644,
-               .proc_handler   = &proc_taint,
+               .proc_handler   = proc_taint,
        },
 #endif
 #ifdef CONFIG_LATENCYTOP
@@ -449,181 +416,160 @@ static struct ctl_table kern_table[] = {
                .data           = &latencytop_enabled,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #endif
 #ifdef CONFIG_BLK_DEV_INITRD
        {
-               .ctl_name       = KERN_REALROOTDEV,
                .procname       = "real-root-dev",
                .data           = &real_root_dev,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #endif
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "print-fatal-signals",
                .data           = &print_fatal_signals,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #ifdef CONFIG_SPARC
        {
-               .ctl_name       = KERN_SPARC_REBOOT,
                .procname       = "reboot-cmd",
                .data           = reboot_command,
                .maxlen         = 256,
                .mode           = 0644,
-               .proc_handler   = &proc_dostring,
-               .strategy       = &sysctl_string,
+               .proc_handler   = proc_dostring,
        },
        {
-               .ctl_name       = KERN_SPARC_STOP_A,
                .procname       = "stop-a",
                .data           = &stop_a_enabled,
                .maxlen         = sizeof (int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = KERN_SPARC_SCONS_PWROFF,
                .procname       = "scons-poweroff",
                .data           = &scons_pwroff,
                .maxlen         = sizeof (int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #endif
 #ifdef CONFIG_SPARC64
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "tsb-ratio",
                .data           = &sysctl_tsb_ratio,
                .maxlen         = sizeof (int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #endif
 #ifdef __hppa__
        {
-               .ctl_name       = KERN_HPPA_PWRSW,
                .procname       = "soft-power",
                .data           = &pwrsw_enabled,
                .maxlen         = sizeof (int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = KERN_HPPA_UNALIGNED,
                .procname       = "unaligned-trap",
                .data           = &unaligned_enabled,
                .maxlen         = sizeof (int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #endif
        {
-               .ctl_name       = KERN_CTLALTDEL,
                .procname       = "ctrl-alt-del",
                .data           = &C_A_D,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #ifdef CONFIG_FUNCTION_TRACER
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "ftrace_enabled",
                .data           = &ftrace_enabled,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &ftrace_enable_sysctl,
+               .proc_handler   = ftrace_enable_sysctl,
        },
 #endif
 #ifdef CONFIG_STACK_TRACER
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "stack_tracer_enabled",
                .data           = &stack_tracer_enabled,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &stack_trace_sysctl,
+               .proc_handler   = stack_trace_sysctl,
        },
 #endif
 #ifdef CONFIG_TRACING
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "ftrace_dump_on_oops",
                .data           = &ftrace_dump_on_oops,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #endif
 #ifdef CONFIG_MODULES
        {
-               .ctl_name       = KERN_MODPROBE,
                .procname       = "modprobe",
                .data           = &modprobe_path,
                .maxlen         = KMOD_PATH_LEN,
                .mode           = 0644,
-               .proc_handler   = &proc_dostring,
-               .strategy       = &sysctl_string,
+               .proc_handler   = proc_dostring,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "modules_disabled",
                .data           = &modules_disabled,
                .maxlen         = sizeof(int),
                .mode           = 0644,
                /* only handle a transition from default "0" to "1" */
-               .proc_handler   = &proc_dointvec_minmax,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &one,
                .extra2         = &one,
        },
 #endif
 #if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET)
        {
-               .ctl_name       = KERN_HOTPLUG,
                .procname       = "hotplug",
                .data           = &uevent_helper,
                .maxlen         = UEVENT_HELPER_PATH_LEN,
                .mode           = 0644,
-               .proc_handler   = &proc_dostring,
-               .strategy       = &sysctl_string,
+               .proc_handler   = proc_dostring,
        },
 #endif
 #ifdef CONFIG_CHR_DEV_SG
        {
-               .ctl_name       = KERN_SG_BIG_BUFF,
                .procname       = "sg-big-buff",
                .data           = &sg_big_buff,
                .maxlen         = sizeof (int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #endif
 #ifdef CONFIG_BSD_PROCESS_ACCT
        {
-               .ctl_name       = KERN_ACCT,
                .procname       = "acct",
                .data           = &acct_parm,
                .maxlen         = 3*sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #endif
 #ifdef CONFIG_MAGIC_SYSRQ
        {
-               .ctl_name       = KERN_SYSRQ,
                .procname       = "sysrq",
                .data           = &__sysrq_enabled,
                .maxlen         = sizeof (int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #endif
 #ifdef CONFIG_PROC_SYSCTL
@@ -632,215 +578,188 @@ static struct ctl_table kern_table[] = {
                .data           = NULL,
                .maxlen         = sizeof (int),
                .mode           = 0600,
-               .proc_handler   = &proc_do_cad_pid,
+               .proc_handler   = proc_do_cad_pid,
        },
 #endif
        {
-               .ctl_name       = KERN_MAX_THREADS,
                .procname       = "threads-max",
                .data           = &max_threads,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = KERN_RANDOM,
                .procname       = "random",
                .mode           = 0555,
                .child          = random_table,
        },
        {
-               .ctl_name       = KERN_OVERFLOWUID,
                .procname       = "overflowuid",
                .data           = &overflowuid,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &minolduid,
                .extra2         = &maxolduid,
        },
        {
-               .ctl_name       = KERN_OVERFLOWGID,
                .procname       = "overflowgid",
                .data           = &overflowgid,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &minolduid,
                .extra2         = &maxolduid,
        },
 #ifdef CONFIG_S390
 #ifdef CONFIG_MATHEMU
        {
-               .ctl_name       = KERN_IEEE_EMULATION_WARNINGS,
                .procname       = "ieee_emulation_warnings",
                .data           = &sysctl_ieee_emulation_warnings,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #endif
        {
-               .ctl_name       = KERN_S390_USER_DEBUG_LOGGING,
                .procname       = "userprocess_debug",
                .data           = &sysctl_userprocess_debug,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #endif
        {
-               .ctl_name       = KERN_PIDMAX,
                .procname       = "pid_max",
                .data           = &pid_max,
                .maxlen         = sizeof (int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &pid_max_min,
                .extra2         = &pid_max_max,
        },
        {
-               .ctl_name       = KERN_PANIC_ON_OOPS,
                .procname       = "panic_on_oops",
                .data           = &panic_on_oops,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #if defined CONFIG_PRINTK
        {
-               .ctl_name       = KERN_PRINTK,
                .procname       = "printk",
                .data           = &console_loglevel,
                .maxlen         = 4*sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = KERN_PRINTK_RATELIMIT,
                .procname       = "printk_ratelimit",
                .data           = &printk_ratelimit_state.interval,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_jiffies,
-               .strategy       = &sysctl_jiffies,
+               .proc_handler   = proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = KERN_PRINTK_RATELIMIT_BURST,
                .procname       = "printk_ratelimit_burst",
                .data           = &printk_ratelimit_state.burst,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "printk_delay",
                .data           = &printk_delay_msec,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &zero,
                .extra2         = &ten_thousand,
        },
 #endif
        {
-               .ctl_name       = KERN_NGROUPS_MAX,
                .procname       = "ngroups_max",
                .data           = &ngroups_max,
                .maxlen         = sizeof (int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86)
        {
-               .ctl_name       = KERN_UNKNOWN_NMI_PANIC,
                .procname       = "unknown_nmi_panic",
                .data           = &unknown_nmi_panic,
                .maxlen         = sizeof (int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
                .procname       = "nmi_watchdog",
                .data           = &nmi_watchdog_enabled,
                .maxlen         = sizeof (int),
                .mode           = 0644,
-               .proc_handler   = &proc_nmi_enabled,
+               .proc_handler   = proc_nmi_enabled,
        },
 #endif
 #if defined(CONFIG_X86)
        {
-               .ctl_name       = KERN_PANIC_ON_NMI,
                .procname       = "panic_on_unrecovered_nmi",
                .data           = &panic_on_unrecovered_nmi,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "panic_on_io_nmi",
                .data           = &panic_on_io_nmi,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = KERN_BOOTLOADER_TYPE,
                .procname       = "bootloader_type",
                .data           = &bootloader_type,
                .maxlen         = sizeof (int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "bootloader_version",
                .data           = &bootloader_version,
                .maxlen         = sizeof (int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "kstack_depth_to_print",
                .data           = &kstack_depth_to_print,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "io_delay_type",
                .data           = &io_delay_type,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #endif
 #if defined(CONFIG_MMU)
        {
-               .ctl_name       = KERN_RANDOMIZE,
                .procname       = "randomize_va_space",
                .data           = &randomize_va_space,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #endif
 #if defined(CONFIG_S390) && defined(CONFIG_SMP)
        {
-               .ctl_name       = KERN_SPIN_RETRY,
                .procname       = "spin_retry",
                .data           = &spin_retry,
                .maxlen         = sizeof (int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #endif
 #if    defined(CONFIG_ACPI_SLEEP) && defined(CONFIG_X86)
@@ -849,123 +768,104 @@ static struct ctl_table kern_table[] = {
                .data           = &acpi_realmode_flags,
                .maxlen         = sizeof (unsigned long),
                .mode           = 0644,
-               .proc_handler   = &proc_doulongvec_minmax,
+               .proc_handler   = proc_doulongvec_minmax,
        },
 #endif
 #ifdef CONFIG_IA64
        {
-               .ctl_name       = KERN_IA64_UNALIGNED,
                .procname       = "ignore-unaligned-usertrap",
                .data           = &no_unaligned_warning,
                .maxlen         = sizeof (int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "unaligned-dump-stack",
                .data           = &unaligned_dump_stack,
                .maxlen         = sizeof (int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #endif
 #ifdef CONFIG_DETECT_SOFTLOCKUP
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "softlockup_panic",
                .data           = &softlockup_panic,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &zero,
                .extra2         = &one,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "softlockup_thresh",
                .data           = &softlockup_thresh,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dosoftlockup_thresh,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dosoftlockup_thresh,
                .extra1         = &neg_one,
                .extra2         = &sixty,
        },
 #endif
 #ifdef CONFIG_DETECT_HUNG_TASK
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "hung_task_panic",
                .data           = &sysctl_hung_task_panic,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &zero,
                .extra2         = &one,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "hung_task_check_count",
                .data           = &sysctl_hung_task_check_count,
                .maxlen         = sizeof(unsigned long),
                .mode           = 0644,
-               .proc_handler   = &proc_doulongvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_doulongvec_minmax,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "hung_task_timeout_secs",
                .data           = &sysctl_hung_task_timeout_secs,
                .maxlen         = sizeof(unsigned long),
                .mode           = 0644,
-               .proc_handler   = &proc_dohung_task_timeout_secs,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dohung_task_timeout_secs,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "hung_task_warnings",
                .data           = &sysctl_hung_task_warnings,
                .maxlen         = sizeof(unsigned long),
                .mode           = 0644,
-               .proc_handler   = &proc_doulongvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_doulongvec_minmax,
        },
 #endif
 #ifdef CONFIG_COMPAT
        {
-               .ctl_name       = KERN_COMPAT_LOG,
                .procname       = "compat-log",
                .data           = &compat_log,
                .maxlen         = sizeof (int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #endif
 #ifdef CONFIG_RT_MUTEXES
        {
-               .ctl_name       = KERN_MAX_LOCK_DEPTH,
                .procname       = "max_lock_depth",
                .data           = &max_lock_depth,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #endif
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "poweroff_cmd",
                .data           = &poweroff_cmd,
                .maxlen         = POWEROFF_CMD_PATH_LEN,
                .mode           = 0644,
-               .proc_handler   = &proc_dostring,
-               .strategy       = &sysctl_string,
+               .proc_handler   = proc_dostring,
        },
 #ifdef CONFIG_KEYS
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "keys",
                .mode           = 0555,
                .child          = key_sysctls,
@@ -973,17 +873,15 @@ static struct ctl_table kern_table[] = {
 #endif
 #ifdef CONFIG_RCU_TORTURE_TEST
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "rcutorture_runnable",
                .data           = &rcutorture_runnable,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #endif
 #ifdef CONFIG_SLOW_WORK
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "slow-work",
                .mode           = 0555,
                .child          = slow_work_sysctls,
@@ -991,146 +889,127 @@ static struct ctl_table kern_table[] = {
 #endif
 #ifdef CONFIG_PERF_EVENTS
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "perf_event_paranoid",
                .data           = &sysctl_perf_event_paranoid,
                .maxlen         = sizeof(sysctl_perf_event_paranoid),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "perf_event_mlock_kb",
                .data           = &sysctl_perf_event_mlock,
                .maxlen         = sizeof(sysctl_perf_event_mlock),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "perf_event_max_sample_rate",
                .data           = &sysctl_perf_event_sample_rate,
                .maxlen         = sizeof(sysctl_perf_event_sample_rate),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #endif
 #ifdef CONFIG_KMEMCHECK
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "kmemcheck",
                .data           = &kmemcheck_enabled,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #endif
 #ifdef CONFIG_BLOCK
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "blk_iopoll",
                .data           = &blk_iopoll_enabled,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #endif
 /*
  * NOTE: do not add new entries to this table unless you have read
  * Documentation/sysctl/ctl_unnumbered.txt
  */
-       { .ctl_name = 0 }
+       { }
 };
 
 static struct ctl_table vm_table[] = {
        {
-               .ctl_name       = VM_OVERCOMMIT_MEMORY,
                .procname       = "overcommit_memory",
                .data           = &sysctl_overcommit_memory,
                .maxlen         = sizeof(sysctl_overcommit_memory),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = VM_PANIC_ON_OOM,
                .procname       = "panic_on_oom",
                .data           = &sysctl_panic_on_oom,
                .maxlen         = sizeof(sysctl_panic_on_oom),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "oom_kill_allocating_task",
                .data           = &sysctl_oom_kill_allocating_task,
                .maxlen         = sizeof(sysctl_oom_kill_allocating_task),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "oom_dump_tasks",
                .data           = &sysctl_oom_dump_tasks,
                .maxlen         = sizeof(sysctl_oom_dump_tasks),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = VM_OVERCOMMIT_RATIO,
                .procname       = "overcommit_ratio",
                .data           = &sysctl_overcommit_ratio,
                .maxlen         = sizeof(sysctl_overcommit_ratio),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = VM_PAGE_CLUSTER,
                .procname       = "page-cluster", 
                .data           = &page_cluster,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = VM_DIRTY_BACKGROUND,
                .procname       = "dirty_background_ratio",
                .data           = &dirty_background_ratio,
                .maxlen         = sizeof(dirty_background_ratio),
                .mode           = 0644,
-               .proc_handler   = &dirty_background_ratio_handler,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = dirty_background_ratio_handler,
                .extra1         = &zero,
                .extra2         = &one_hundred,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "dirty_background_bytes",
                .data           = &dirty_background_bytes,
                .maxlen         = sizeof(dirty_background_bytes),
                .mode           = 0644,
-               .proc_handler   = &dirty_background_bytes_handler,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = dirty_background_bytes_handler,
                .extra1         = &one_ul,
        },
        {
-               .ctl_name       = VM_DIRTY_RATIO,
                .procname       = "dirty_ratio",
                .data           = &vm_dirty_ratio,
                .maxlen         = sizeof(vm_dirty_ratio),
                .mode           = 0644,
-               .proc_handler   = &dirty_ratio_handler,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = dirty_ratio_handler,
                .extra1         = &zero,
                .extra2         = &one_hundred,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "dirty_bytes",
                .data           = &vm_dirty_bytes,
                .maxlen         = sizeof(vm_dirty_bytes),
                .mode           = 0644,
-               .proc_handler   = &dirty_bytes_handler,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = dirty_bytes_handler,
                .extra1         = &dirty_bytes_min,
        },
        {
@@ -1138,31 +1017,28 @@ static struct ctl_table vm_table[] = {
                .data           = &dirty_writeback_interval,
                .maxlen         = sizeof(dirty_writeback_interval),
                .mode           = 0644,
-               .proc_handler   = &dirty_writeback_centisecs_handler,
+               .proc_handler   = dirty_writeback_centisecs_handler,
        },
        {
                .procname       = "dirty_expire_centisecs",
                .data           = &dirty_expire_interval,
                .maxlen         = sizeof(dirty_expire_interval),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = VM_NR_PDFLUSH_THREADS,
                .procname       = "nr_pdflush_threads",
                .data           = &nr_pdflush_threads,
                .maxlen         = sizeof nr_pdflush_threads,
                .mode           = 0444 /* read-only*/,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = VM_SWAPPINESS,
                .procname       = "swappiness",
                .data           = &vm_swappiness,
                .maxlen         = sizeof(vm_swappiness),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &zero,
                .extra2         = &one_hundred,
        },
@@ -1172,255 +1048,213 @@ static struct ctl_table vm_table[] = {
                .data           = NULL,
                .maxlen         = sizeof(unsigned long),
                .mode           = 0644,
-               .proc_handler   = &hugetlb_sysctl_handler,
+               .proc_handler   = hugetlb_sysctl_handler,
                .extra1         = (void *)&hugetlb_zero,
                .extra2         = (void *)&hugetlb_infinity,
         },
         {
-               .ctl_name       = VM_HUGETLB_GROUP,
                .procname       = "hugetlb_shm_group",
                .data           = &sysctl_hugetlb_shm_group,
                .maxlen         = sizeof(gid_t),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
         },
         {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "hugepages_treat_as_movable",
                .data           = &hugepages_treat_as_movable,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &hugetlb_treat_movable_handler,
+               .proc_handler   = hugetlb_treat_movable_handler,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "nr_overcommit_hugepages",
                .data           = NULL,
                .maxlen         = sizeof(unsigned long),
                .mode           = 0644,
-               .proc_handler   = &hugetlb_overcommit_handler,
+               .proc_handler   = hugetlb_overcommit_handler,
                .extra1         = (void *)&hugetlb_zero,
                .extra2         = (void *)&hugetlb_infinity,
        },
 #endif
        {
-               .ctl_name       = VM_LOWMEM_RESERVE_RATIO,
                .procname       = "lowmem_reserve_ratio",
                .data           = &sysctl_lowmem_reserve_ratio,
                .maxlen         = sizeof(sysctl_lowmem_reserve_ratio),
                .mode           = 0644,
-               .proc_handler   = &lowmem_reserve_ratio_sysctl_handler,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = lowmem_reserve_ratio_sysctl_handler,
        },
        {
-               .ctl_name       = VM_DROP_PAGECACHE,
                .procname       = "drop_caches",
                .data           = &sysctl_drop_caches,
                .maxlen         = sizeof(int),
                .mode           = 0644,
                .proc_handler   = drop_caches_sysctl_handler,
-               .strategy       = &sysctl_intvec,
        },
        {
-               .ctl_name       = VM_MIN_FREE_KBYTES,
                .procname       = "min_free_kbytes",
                .data           = &min_free_kbytes,
                .maxlen         = sizeof(min_free_kbytes),
                .mode           = 0644,
-               .proc_handler   = &min_free_kbytes_sysctl_handler,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = min_free_kbytes_sysctl_handler,
                .extra1         = &zero,
        },
        {
-               .ctl_name       = VM_PERCPU_PAGELIST_FRACTION,
                .procname       = "percpu_pagelist_fraction",
                .data           = &percpu_pagelist_fraction,
                .maxlen         = sizeof(percpu_pagelist_fraction),
                .mode           = 0644,
-               .proc_handler   = &percpu_pagelist_fraction_sysctl_handler,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = percpu_pagelist_fraction_sysctl_handler,
                .extra1         = &min_percpu_pagelist_fract,
        },
 #ifdef CONFIG_MMU
        {
-               .ctl_name       = VM_MAX_MAP_COUNT,
                .procname       = "max_map_count",
                .data           = &sysctl_max_map_count,
                .maxlen         = sizeof(sysctl_max_map_count),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec
+               .proc_handler   = proc_dointvec
        },
 #else
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "nr_trim_pages",
                .data           = &sysctl_nr_trim_pages,
                .maxlen         = sizeof(sysctl_nr_trim_pages),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &zero,
        },
 #endif
        {
-               .ctl_name       = VM_LAPTOP_MODE,
                .procname       = "laptop_mode",
                .data           = &laptop_mode,
                .maxlen         = sizeof(laptop_mode),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_jiffies,
-               .strategy       = &sysctl_jiffies,
+               .proc_handler   = proc_dointvec_jiffies,
        },
        {
-               .ctl_name       = VM_BLOCK_DUMP,
                .procname       = "block_dump",
                .data           = &block_dump,
                .maxlen         = sizeof(block_dump),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec,
                .extra1         = &zero,
        },
        {
-               .ctl_name       = VM_VFS_CACHE_PRESSURE,
                .procname       = "vfs_cache_pressure",
                .data           = &sysctl_vfs_cache_pressure,
                .maxlen         = sizeof(sysctl_vfs_cache_pressure),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec,
                .extra1         = &zero,
        },
 #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT
        {
-               .ctl_name       = VM_LEGACY_VA_LAYOUT,
                .procname       = "legacy_va_layout",
                .data           = &sysctl_legacy_va_layout,
                .maxlen         = sizeof(sysctl_legacy_va_layout),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec,
                .extra1         = &zero,
        },
 #endif
 #ifdef CONFIG_NUMA
        {
-               .ctl_name       = VM_ZONE_RECLAIM_MODE,
                .procname       = "zone_reclaim_mode",
                .data           = &zone_reclaim_mode,
                .maxlen         = sizeof(zone_reclaim_mode),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec,
                .extra1         = &zero,
        },
        {
-               .ctl_name       = VM_MIN_UNMAPPED,
                .procname       = "min_unmapped_ratio",
                .data           = &sysctl_min_unmapped_ratio,
                .maxlen         = sizeof(sysctl_min_unmapped_ratio),
                .mode           = 0644,
-               .proc_handler   = &sysctl_min_unmapped_ratio_sysctl_handler,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = sysctl_min_unmapped_ratio_sysctl_handler,
                .extra1         = &zero,
                .extra2         = &one_hundred,
        },
        {
-               .ctl_name       = VM_MIN_SLAB,
                .procname       = "min_slab_ratio",
                .data           = &sysctl_min_slab_ratio,
                .maxlen         = sizeof(sysctl_min_slab_ratio),
                .mode           = 0644,
-               .proc_handler   = &sysctl_min_slab_ratio_sysctl_handler,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = sysctl_min_slab_ratio_sysctl_handler,
                .extra1         = &zero,
                .extra2         = &one_hundred,
        },
 #endif
 #ifdef CONFIG_SMP
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "stat_interval",
                .data           = &sysctl_stat_interval,
                .maxlen         = sizeof(sysctl_stat_interval),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_jiffies,
-               .strategy       = &sysctl_jiffies,
+               .proc_handler   = proc_dointvec_jiffies,
        },
 #endif
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "mmap_min_addr",
                .data           = &dac_mmap_min_addr,
                .maxlen         = sizeof(unsigned long),
                .mode           = 0644,
-               .proc_handler   = &mmap_min_addr_handler,
+               .proc_handler   = mmap_min_addr_handler,
        },
 #ifdef CONFIG_NUMA
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "numa_zonelist_order",
                .data           = &numa_zonelist_order,
                .maxlen         = NUMA_ZONELIST_ORDER_LEN,
                .mode           = 0644,
-               .proc_handler   = &numa_zonelist_order_handler,
-               .strategy       = &sysctl_string,
+               .proc_handler   = numa_zonelist_order_handler,
        },
 #endif
 #if (defined(CONFIG_X86_32) && !defined(CONFIG_UML))|| \
    (defined(CONFIG_SUPERH) && defined(CONFIG_VSYSCALL))
        {
-               .ctl_name       = VM_VDSO_ENABLED,
                .procname       = "vdso_enabled",
                .data           = &vdso_enabled,
                .maxlen         = sizeof(vdso_enabled),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec,
                .extra1         = &zero,
        },
 #endif
 #ifdef CONFIG_HIGHMEM
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "highmem_is_dirtyable",
                .data           = &vm_highmem_is_dirtyable,
                .maxlen         = sizeof(vm_highmem_is_dirtyable),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &zero,
                .extra2         = &one,
        },
 #endif
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "scan_unevictable_pages",
                .data           = &scan_unevictable_pages,
                .maxlen         = sizeof(scan_unevictable_pages),
                .mode           = 0644,
-               .proc_handler   = &scan_unevictable_handler,
+               .proc_handler   = scan_unevictable_handler,
        },
 #ifdef CONFIG_MEMORY_FAILURE
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "memory_failure_early_kill",
                .data           = &sysctl_memory_failure_early_kill,
                .maxlen         = sizeof(sysctl_memory_failure_early_kill),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &zero,
                .extra2         = &one,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "memory_failure_recovery",
                .data           = &sysctl_memory_failure_recovery,
                .maxlen         = sizeof(sysctl_memory_failure_recovery),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &zero,
                .extra2         = &one,
        },
@@ -1430,116 +1264,104 @@ static struct ctl_table vm_table[] = {
  * NOTE: do not add new entries to this table unless you have read
  * Documentation/sysctl/ctl_unnumbered.txt
  */
-       { .ctl_name = 0 }
+       { }
 };
 
 #if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE)
 static struct ctl_table binfmt_misc_table[] = {
-       { .ctl_name = 0 }
+       { }
 };
 #endif
 
 static struct ctl_table fs_table[] = {
        {
-               .ctl_name       = FS_NRINODE,
                .procname       = "inode-nr",
                .data           = &inodes_stat,
                .maxlen         = 2*sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = FS_STATINODE,
                .procname       = "inode-state",
                .data           = &inodes_stat,
                .maxlen         = 7*sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
                .procname       = "file-nr",
                .data           = &files_stat,
                .maxlen         = 3*sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_nr_files,
+               .proc_handler   = proc_nr_files,
        },
        {
-               .ctl_name       = FS_MAXFILE,
                .procname       = "file-max",
                .data           = &files_stat.max_files,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "nr_open",
                .data           = &sysctl_nr_open,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &sysctl_nr_open_min,
                .extra2         = &sysctl_nr_open_max,
        },
        {
-               .ctl_name       = FS_DENTRY,
                .procname       = "dentry-state",
                .data           = &dentry_stat,
                .maxlen         = 6*sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = FS_OVERFLOWUID,
                .procname       = "overflowuid",
                .data           = &fs_overflowuid,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &minolduid,
                .extra2         = &maxolduid,
        },
        {
-               .ctl_name       = FS_OVERFLOWGID,
                .procname       = "overflowgid",
                .data           = &fs_overflowgid,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &minolduid,
                .extra2         = &maxolduid,
        },
 #ifdef CONFIG_FILE_LOCKING
        {
-               .ctl_name       = FS_LEASES,
                .procname       = "leases-enable",
                .data           = &leases_enable,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #endif
 #ifdef CONFIG_DNOTIFY
        {
-               .ctl_name       = FS_DIR_NOTIFY,
                .procname       = "dir-notify-enable",
                .data           = &dir_notify_enable,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #endif
 #ifdef CONFIG_MMU
 #ifdef CONFIG_FILE_LOCKING
        {
-               .ctl_name       = FS_LEASE_TIME,
                .procname       = "lease-break-time",
                .data           = &lease_break_time,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
 #endif
 #ifdef CONFIG_AIO
@@ -1548,19 +1370,18 @@ static struct ctl_table fs_table[] = {
                .data           = &aio_nr,
                .maxlen         = sizeof(aio_nr),
                .mode           = 0444,
-               .proc_handler   = &proc_doulongvec_minmax,
+               .proc_handler   = proc_doulongvec_minmax,
        },
        {
                .procname       = "aio-max-nr",
                .data           = &aio_max_nr,
                .maxlen         = sizeof(aio_max_nr),
                .mode           = 0644,
-               .proc_handler   = &proc_doulongvec_minmax,
+               .proc_handler   = proc_doulongvec_minmax,
        },
 #endif /* CONFIG_AIO */
 #ifdef CONFIG_INOTIFY_USER
        {
-               .ctl_name       = FS_INOTIFY,
                .procname       = "inotify",
                .mode           = 0555,
                .child          = inotify_table,
@@ -1575,19 +1396,16 @@ static struct ctl_table fs_table[] = {
 #endif
 #endif
        {
-               .ctl_name       = KERN_SETUID_DUMPABLE,
                .procname       = "suid_dumpable",
                .data           = &suid_dumpable,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
-               .strategy       = &sysctl_intvec,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &zero,
                .extra2         = &two,
        },
 #if defined(CONFIG_BINFMT_MISC) || defined(CONFIG_BINFMT_MISC_MODULE)
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "binfmt_misc",
                .mode           = 0555,
                .child          = binfmt_misc_table,
@@ -1597,13 +1415,12 @@ static struct ctl_table fs_table[] = {
  * NOTE: do not add new entries to this table unless you have read
  * Documentation/sysctl/ctl_unnumbered.txt
  */
-       { .ctl_name = 0 }
+       { }
 };
 
 static struct ctl_table debug_table[] = {
 #if defined(CONFIG_X86) || defined(CONFIG_PPC)
        {
-               .ctl_name       = CTL_UNNUMBERED,
                .procname       = "exception-trace",
                .data           = &show_unhandled_signals,
                .maxlen         = sizeof(int),
@@ -1611,11 +1428,11 @@ static struct ctl_table debug_table[] = {
                .proc_handler   = proc_dointvec
        },
 #endif
-       { .ctl_name = 0 }
+       { }
 };
 
 static struct ctl_table dev_table[] = {
-       { .ctl_name = 0 }
+       { }
 };
 
 static DEFINE_SPINLOCK(sysctl_lock);
@@ -1769,122 +1586,6 @@ void register_sysctl_root(struct ctl_table_root *root)
        spin_unlock(&sysctl_lock);
 }
 
-#ifdef CONFIG_SYSCTL_SYSCALL
-/* Perform the actual read/write of a sysctl table entry. */
-static int do_sysctl_strategy(struct ctl_table_root *root,
-                       struct ctl_table *table,
-                       void __user *oldval, size_t __user *oldlenp,
-                       void __user *newval, size_t newlen)
-{
-       int op = 0, rc;
-
-       if (oldval)
-               op |= MAY_READ;
-       if (newval)
-               op |= MAY_WRITE;
-       if (sysctl_perm(root, table, op))
-               return -EPERM;
-
-       if (table->strategy) {
-               rc = table->strategy(table, oldval, oldlenp, newval, newlen);
-               if (rc < 0)
-                       return rc;
-               if (rc > 0)
-                       return 0;
-       }
-
-       /* If there is no strategy routine, or if the strategy returns
-        * zero, proceed with automatic r/w */
-       if (table->data && table->maxlen) {
-               rc = sysctl_data(table, oldval, oldlenp, newval, newlen);
-               if (rc < 0)
-                       return rc;
-       }
-       return 0;
-}
-
-static int parse_table(int __user *name, int nlen,
-                      void __user *oldval, size_t __user *oldlenp,
-                      void __user *newval, size_t newlen,
-                      struct ctl_table_root *root,
-                      struct ctl_table *table)
-{
-       int n;
-repeat:
-       if (!nlen)
-               return -ENOTDIR;
-       if (get_user(n, name))
-               return -EFAULT;
-       for ( ; table->ctl_name || table->procname; table++) {
-               if (!table->ctl_name)
-                       continue;
-               if (n == table->ctl_name) {
-                       int error;
-                       if (table->child) {
-                               if (sysctl_perm(root, table, MAY_EXEC))
-                                       return -EPERM;
-                               name++;
-                               nlen--;
-                               table = table->child;
-                               goto repeat;
-                       }
-                       error = do_sysctl_strategy(root, table,
-                                                  oldval, oldlenp,
-                                                  newval, newlen);
-                       return error;
-               }
-       }
-       return -ENOTDIR;
-}
-
-int do_sysctl(int __user *name, int nlen, void __user *oldval, size_t __user *oldlenp,
-              void __user *newval, size_t newlen)
-{
-       struct ctl_table_header *head;
-       int error = -ENOTDIR;
-
-       if (nlen <= 0 || nlen >= CTL_MAXNAME)
-               return -ENOTDIR;
-       if (oldval) {
-               int old_len;
-               if (!oldlenp || get_user(old_len, oldlenp))
-                       return -EFAULT;
-       }
-
-       for (head = sysctl_head_next(NULL); head;
-                       head = sysctl_head_next(head)) {
-               error = parse_table(name, nlen, oldval, oldlenp, 
-                                       newval, newlen,
-                                       head->root, head->ctl_table);
-               if (error != -ENOTDIR) {
-                       sysctl_head_finish(head);
-                       break;
-               }
-       }
-       return error;
-}
-
-SYSCALL_DEFINE1(sysctl, struct __sysctl_args __user *, args)
-{
-       struct __sysctl_args tmp;
-       int error;
-
-       if (copy_from_user(&tmp, args, sizeof(tmp)))
-               return -EFAULT;
-
-       error = deprecated_sysctl_warning(&tmp);
-       if (error)
-               goto out;
-
-       lock_kernel();
-       error = do_sysctl(tmp.name, tmp.nlen, tmp.oldval, tmp.oldlenp,
-                         tmp.newval, tmp.newlen);
-       unlock_kernel();
-out:
-       return error;
-}
-#endif /* CONFIG_SYSCTL_SYSCALL */
-
 /*
  * sysctl_perm does NOT grant the superuser all rights automatically, because
  * some sysctl variables are readonly even to root.
@@ -1920,7 +1621,7 @@ int sysctl_perm(struct ctl_table_root *root, struct ctl_table *table, int op)
 
 static void sysctl_set_parent(struct ctl_table *parent, struct ctl_table *table)
 {
-       for (; table->ctl_name || table->procname; table++) {
+       for (; table->procname; table++) {
                table->parent = parent;
                if (table->child)
                        sysctl_set_parent(table, table->child);
@@ -1952,11 +1653,11 @@ static struct ctl_table *is_branch_in(struct ctl_table *branch,
                return NULL;
 
        /* ... and nothing else */
-       if (branch[1].procname || branch[1].ctl_name)
+       if (branch[1].procname)
                return NULL;
 
        /* table should contain subdirectory with the same name */
-       for (p = table; p->procname || p->ctl_name; p++) {
+       for (p = table; p->procname; p++) {
                if (!p->child)
                        continue;
                if (p->procname && strcmp(p->procname, s) == 0)
@@ -2001,9 +1702,6 @@ static void try_attach(struct ctl_table_header *p, struct ctl_table_header *q)
  *
  * The members of the &struct ctl_table structure are used as follows:
  *
- * ctl_name - This is the numeric sysctl value used by sysctl(2). The number
- *            must be unique within that level of sysctl
- *
  * procname - the name of the sysctl file under /proc/sys. Set to %NULL to not
  *            enter a sysctl file
  *
@@ -2018,8 +1716,6 @@ static void try_attach(struct ctl_table_header *p, struct ctl_table_header *q)
  *
  * proc_handler - the text handler routine (described below)
  *
- * strategy - the strategy routine (described below)
- *
  * de - for internal use by the sysctl routines
  *
  * extra1, extra2 - extra pointers usable by the proc handler routines
@@ -2032,19 +1728,6 @@ static void try_attach(struct ctl_table_header *p, struct ctl_table_header *q)
  * struct enable minimal validation of the values being written to be
  * 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
  * mirrored under /proc/sys (non-terminals are handled by a built-in
  * directory handler).  Several default handlers are available to
@@ -2071,13 +1754,13 @@ struct ctl_table_header *__register_sysctl_paths(
        struct ctl_table_set *set;
 
        /* Count the path components */
-       for (npath = 0; path[npath].ctl_name || path[npath].procname; ++npath)
+       for (npath = 0; path[npath].procname; ++npath)
                ;
 
        /*
         * For each path component, allocate a 2-element ctl_table array.
         * The first array element will be filled with the sysctl entry
-        * for this, the second will be the sentinel (ctl_name == 0).
+        * for this, the second will be the sentinel (procname == 0).
         *
         * We allocate everything in one go so that we don't have to
         * worry about freeing additional memory in unregister_sysctl_table.
@@ -2094,7 +1777,6 @@ struct ctl_table_header *__register_sysctl_paths(
        for (n = 0; n < npath; ++n, ++path) {
                /* Copy the procname */
                new->procname = path->procname;
-               new->ctl_name = path->ctl_name;
                new->mode     = 0555;
 
                *prevp = new;
@@ -2956,286 +2638,6 @@ int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,
 
 #endif /* CONFIG_PROC_FS */
 
-
-#ifdef CONFIG_SYSCTL_SYSCALL
-/*
- * General sysctl support routines 
- */
-
-/* The generic sysctl data routine (used if no strategy routine supplied) */
-int sysctl_data(struct ctl_table *table,
-               void __user *oldval, size_t __user *oldlenp,
-               void __user *newval, size_t newlen)
-{
-       size_t len;
-
-       /* Get out of I don't have a variable */
-       if (!table->data || !table->maxlen)
-               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, table->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(table->data, newval, newlen))
-                       return -EFAULT;
-       }
-       return 1;
-}
-
-/* The generic string strategy routine: */
-int sysctl_string(struct ctl_table *table,
-                 void __user *oldval, size_t __user *oldlenp,
-                 void __user *newval, size_t newlen)
-{
-       if (!table->data || !table->maxlen) 
-               return -ENOTDIR;
-       
-       if (oldval && oldlenp) {
-               size_t bufsize;
-               if (get_user(bufsize, oldlenp))
-                       return -EFAULT;
-               if (bufsize) {
-                       size_t len = strlen(table->data), copied;
-
-                       /* This shouldn't trigger for a well-formed sysctl */
-                       if (len > table->maxlen)
-                               len = table->maxlen;
-
-                       /* Copy up to a max of bufsize-1 bytes of the string */
-                       copied = (len >= bufsize) ? bufsize - 1 : len;
-
-                       if (copy_to_user(oldval, table->data, copied) ||
-                           put_user(0, (char __user *)(oldval + copied)))
-                               return -EFAULT;
-                       if (put_user(len, oldlenp))
-                               return -EFAULT;
-               }
-       }
-       if (newval && newlen) {
-               size_t len = newlen;
-               if (len > table->maxlen)
-                       len = table->maxlen;
-               if(copy_from_user(table->data, newval, len))
-                       return -EFAULT;
-               if (len == table->maxlen)
-                       len--;
-               ((char *) table->data)[len] = 0;
-       }
-       return 1;
-}
-
-/*
- * This function makes sure that all of the integers in the vector
- * are between the minimum and maximum values given in the arrays
- * table->extra1 and table->extra2, respectively.
- */
-int sysctl_intvec(struct ctl_table *table,
-               void __user *oldval, size_t __user *oldlenp,
-               void __user *newval, size_t newlen)
-{
-
-       if (newval && newlen) {
-               int __user *vec = (int __user *) newval;
-               int *min = (int *) table->extra1;
-               int *max = (int *) table->extra2;
-               size_t length;
-               int i;
-
-               if (newlen % sizeof(int) != 0)
-                       return -EINVAL;
-
-               if (!table->extra1 && !table->extra2)
-                       return 0;
-
-               if (newlen > table->maxlen)
-                       newlen = table->maxlen;
-               length = newlen / sizeof(int);
-
-               for (i = 0; i < length; i++) {
-                       int value;
-                       if (get_user(value, vec + i))
-                               return -EFAULT;
-                       if (min && value < min[i])
-                               return -EINVAL;
-                       if (max && value > max[i])
-                               return -EINVAL;
-               }
-       }
-       return 0;
-}
-
-/* Strategy function to convert jiffies to seconds */ 
-int sysctl_jiffies(struct ctl_table *table,
-               void __user *oldval, size_t __user *oldlenp,
-               void __user *newval, size_t newlen)
-{
-       if (oldval && oldlenp) {
-               size_t olen;
-
-               if (get_user(olen, oldlenp))
-                       return -EFAULT;
-               if (olen) {
-                       int val;
-
-                       if (olen < sizeof(int))
-                               return -EINVAL;
-
-                       val = *(int *)(table->data) / HZ;
-                       if (put_user(val, (int __user *)oldval))
-                               return -EFAULT;
-                       if (put_user(sizeof(int), oldlenp))
-                               return -EFAULT;
-               }
-       }
-       if (newval && newlen) { 
-               int new;
-               if (newlen != sizeof(int))
-                       return -EINVAL; 
-               if (get_user(new, (int __user *)newval))
-                       return -EFAULT;
-               *(int *)(table->data) = new*HZ; 
-       }
-       return 1;
-}
-
-/* Strategy function to convert jiffies to seconds */ 
-int sysctl_ms_jiffies(struct ctl_table *table,
-               void __user *oldval, size_t __user *oldlenp,
-               void __user *newval, size_t newlen)
-{
-       if (oldval && oldlenp) {
-               size_t olen;
-
-               if (get_user(olen, oldlenp))
-                       return -EFAULT;
-               if (olen) {
-                       int val;
-
-                       if (olen < sizeof(int))
-                               return -EINVAL;
-
-                       val = jiffies_to_msecs(*(int *)(table->data));
-                       if (put_user(val, (int __user *)oldval))
-                               return -EFAULT;
-                       if (put_user(sizeof(int), oldlenp))
-                               return -EFAULT;
-               }
-       }
-       if (newval && newlen) { 
-               int new;
-               if (newlen != sizeof(int))
-                       return -EINVAL; 
-               if (get_user(new, (int __user *)newval))
-                       return -EFAULT;
-               *(int *)(table->data) = msecs_to_jiffies(new);
-       }
-       return 1;
-}
-
-
-
-#else /* CONFIG_SYSCTL_SYSCALL */
-
-
-SYSCALL_DEFINE1(sysctl, struct __sysctl_args __user *, args)
-{
-       struct __sysctl_args tmp;
-       int error;
-
-       if (copy_from_user(&tmp, args, sizeof(tmp)))
-               return -EFAULT;
-
-       error = deprecated_sysctl_warning(&tmp);
-
-       /* If no error reading the parameters then just -ENOSYS ... */
-       if (!error)
-               error = -ENOSYS;
-
-       return error;
-}
-
-int sysctl_data(struct ctl_table *table,
-                 void __user *oldval, size_t __user *oldlenp,
-                 void __user *newval, size_t newlen)
-{
-       return -ENOSYS;
-}
-
-int sysctl_string(struct ctl_table *table,
-                 void __user *oldval, size_t __user *oldlenp,
-                 void __user *newval, size_t newlen)
-{
-       return -ENOSYS;
-}
-
-int sysctl_intvec(struct ctl_table *table,
-               void __user *oldval, size_t __user *oldlenp,
-               void __user *newval, size_t newlen)
-{
-       return -ENOSYS;
-}
-
-int sysctl_jiffies(struct ctl_table *table,
-               void __user *oldval, size_t __user *oldlenp,
-               void __user *newval, size_t newlen)
-{
-       return -ENOSYS;
-}
-
-int sysctl_ms_jiffies(struct ctl_table *table,
-               void __user *oldval, size_t __user *oldlenp,
-               void __user *newval, size_t newlen)
-{
-       return -ENOSYS;
-}
-
-#endif /* CONFIG_SYSCTL_SYSCALL */
-
-static int deprecated_sysctl_warning(struct __sysctl_args *args)
-{
-       static int msg_count;
-       int name[CTL_MAXNAME];
-       int i;
-
-       /* Check args->nlen. */
-       if (args->nlen < 0 || args->nlen > CTL_MAXNAME)
-               return -ENOTDIR;
-
-       /* Read in the sysctl name for better debug message logging */
-       for (i = 0; i < args->nlen; i++)
-               if (get_user(name[i], args->name + i))
-                       return -EFAULT;
-
-       /* Ignore accesses to kernel.version */
-       if ((args->nlen == 2) && (name[0] == CTL_KERN) && (name[1] == KERN_VERSION))
-               return 0;
-
-       if (msg_count < 5) {
-               msg_count++;
-               printk(KERN_INFO
-                       "warning: process `%s' used the deprecated sysctl "
-                       "system call with ", current->comm);
-               for (i = 0; i < args->nlen; i++)
-                       printk("%d.", name[i]);
-               printk("\n");
-       }
-       return 0;
-}
-
 /*
  * No sense putting this after each symbol definition, twice,
  * exception granted :-)
@@ -3250,9 +2652,4 @@ EXPORT_SYMBOL(proc_doulongvec_minmax);
 EXPORT_SYMBOL(proc_doulongvec_ms_jiffies_minmax);
 EXPORT_SYMBOL(register_sysctl_table);
 EXPORT_SYMBOL(register_sysctl_paths);
-EXPORT_SYMBOL(sysctl_intvec);
-EXPORT_SYMBOL(sysctl_jiffies);
-EXPORT_SYMBOL(sysctl_ms_jiffies);
-EXPORT_SYMBOL(sysctl_string);
-EXPORT_SYMBOL(sysctl_data);
 EXPORT_SYMBOL(unregister_sysctl_table);
diff --git a/kernel/sysctl_binary.c b/kernel/sysctl_binary.c
new file mode 100644 (file)
index 0000000..b75dbf4
--- /dev/null
@@ -0,0 +1,1507 @@
+#include <linux/stat.h>
+#include <linux/sysctl.h>
+#include "../fs/xfs/linux-2.6/xfs_sysctl.h"
+#include <linux/sunrpc/debug.h>
+#include <linux/string.h>
+#include <net/ip_vs.h>
+#include <linux/syscalls.h>
+#include <linux/namei.h>
+#include <linux/mount.h>
+#include <linux/fs.h>
+#include <linux/nsproxy.h>
+#include <linux/pid_namespace.h>
+#include <linux/file.h>
+#include <linux/ctype.h>
+#include <linux/netdevice.h>
+
+#ifdef CONFIG_SYSCTL_SYSCALL
+
+struct bin_table;
+typedef ssize_t bin_convert_t(struct file *file,
+       void __user *oldval, size_t oldlen, void __user *newval, size_t newlen);
+
+static bin_convert_t bin_dir;
+static bin_convert_t bin_string;
+static bin_convert_t bin_intvec;
+static bin_convert_t bin_ulongvec;
+static bin_convert_t bin_uuid;
+static bin_convert_t bin_dn_node_address;
+
+#define CTL_DIR   bin_dir
+#define CTL_STR   bin_string
+#define CTL_INT   bin_intvec