Commit 0b4d4147 authored by Eric W. Biederman's avatar Eric W. Biederman Committed by Linus Torvalds
Browse files

[PATCH] sysctl: remove insert_at_head from register_sysctl



The semantic effect of insert_at_head is that it would allow new registered
sysctl entries to override existing sysctl entries of the same name.  Which is
pain for caching and the proc interface never implemented.

I have done an audit and discovered that none of the current users of
register_sysctl care as (excpet for directories) they do not register
duplicate sysctl entries.

So this patch simply removes the support for overriding existing entries in
the sys_sysctl interface since no one uses it or cares and it makes future
enhancments harder.

Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
Acked-by: default avatarRalf Baechle <ralf@linux-mips.org>
Acked-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: David Howells <dhowells@redhat.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Andi Kleen <ak@muc.de>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Corey Minyard <minyard@acm.org>
Cc: Neil Brown <neilb@suse.de>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Cc: Jan Kara <jack@ucw.cz>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: Mark Fasheh <mark.fasheh@oracle.com>
Cc: David Chinner <dgc@sgi.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Patrick McHardy <kaber@trash.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ae836810
......@@ -70,5 +70,5 @@ register_isa_ports(unsigned int membase, unsigned int portbase, unsigned int por
isa_membase = membase;
isa_portbase = portbase;
isa_portshift = portshift;
isa_sysctl_header = register_sysctl_table(ctl_bus, 0);
isa_sysctl_header = register_sysctl_table(ctl_bus);
}
......@@ -455,7 +455,7 @@ static struct ctl_table pm_dir_table[] =
*/
static int __init pm_init(void)
{
register_sysctl_table(pm_dir_table, 0);
register_sysctl_table(pm_dir_table);
return 0;
}
......
......@@ -216,7 +216,7 @@ static struct ctl_table frv_dir_table[] =
*/
static int __init frv_sysctl_init(void)
{
register_sysctl_table(frv_dir_table, 0);
register_sysctl_table(frv_dir_table);
return 0;
}
......
......@@ -222,7 +222,7 @@ machine_crash_setup(void)
if((ret = register_die_notifier(&kdump_init_notifier_nb)) != 0)
return ret;
#ifdef CONFIG_SYSCTL
register_sysctl_table(sys_table, 0);
register_sysctl_table(sys_table);
#endif
return 0;
}
......
......@@ -6726,7 +6726,7 @@ pfm_init(void)
/*
* create /proc/sys/kernel/perfmon (for debugging purposes)
*/
pfm_sysctl_header = register_sysctl_table(pfm_sysctl_root, 0);
pfm_sysctl_header = register_sysctl_table(pfm_sysctl_root);
/*
* initialize all our spinlocks
......
......@@ -1241,7 +1241,7 @@ xpc_init(void)
snprintf(xpc_part->bus_id, BUS_ID_SIZE, "part");
snprintf(xpc_chan->bus_id, BUS_ID_SIZE, "chan");
xpc_sysctl = register_sysctl_table(xpc_sys_dir, 0);
xpc_sysctl = register_sysctl_table(xpc_sys_dir);
/*
* The first few fields of each entry of xpc_partitions[] need to
......
......@@ -461,7 +461,7 @@ static struct ctl_table pm_dir_table[] = {
*/
static int __init pm_init(void)
{
register_sysctl_table(pm_dir_table, 0);
register_sysctl_table(pm_dir_table);
return 0;
}
......
......@@ -432,7 +432,7 @@ static int __init lasat_register_sysctl(void)
struct ctl_table_header *lasat_table_header;
lasat_table_header =
register_sysctl_table(lasat_root_table, 0);
register_sysctl_table(lasat_root_table);
return 0;
}
......
......@@ -125,7 +125,7 @@ static ctl_table powersave_nap_sysctl_root[] = {
static int __init
register_powersave_nap_sysctl(void)
{
register_sysctl_table(powersave_nap_sysctl_root, 0);
register_sysctl_table(powersave_nap_sysctl_root);
return 0;
}
......
......@@ -457,7 +457,7 @@ static ctl_table htab_sysctl_root[] = {
static int __init
register_ppc_htab_sysctl(void)
{
register_sysctl_table(htab_sysctl_root, 0);
register_sysctl_table(htab_sysctl_root);
return 0;
}
......
......@@ -506,7 +506,7 @@ int appldata_register_ops(struct appldata_ops *ops)
ops->ctl_table[3].ctl_name = 0;
ops->sysctl_header = register_sysctl_table(ops->ctl_table,0);
ops->sysctl_header = register_sysctl_table(ops->ctl_table);
P_INFO("%s-ops registered!\n", ops->name);
return 0;
......@@ -606,7 +606,7 @@ static int __init appldata_init(void)
/* Register cpu hotplug notifier */
register_hotcpu_notifier(&appldata_nb);
appldata_sysctl_header = register_sysctl_table(appldata_dir_table, 0);
appldata_sysctl_header = register_sysctl_table(appldata_dir_table);
#ifdef MODULE
appldata_dir_table[0].de->owner = THIS_MODULE;
appldata_table[0].de->owner = THIS_MODULE;
......
......@@ -1053,7 +1053,7 @@ __init debug_init(void)
{
int rc = 0;
s390dbf_sysctl_header = register_sysctl_table(s390dbf_dir_table, 0);
s390dbf_sysctl_header = register_sysctl_table(s390dbf_dir_table);
down(&debug_lock);
debug_debugfs_root_entry = debugfs_create_dir(DEBUG_DIR_ROOT,NULL);
printk(KERN_INFO "debug: Initialization complete\n");
......
......@@ -418,7 +418,7 @@ cmm_init (void)
int rc = -ENOMEM;
#ifdef CONFIG_CMM_PROC
cmm_sysctl_header = register_sysctl_table(cmm_dir_table, 0);
cmm_sysctl_header = register_sysctl_table(cmm_dir_table);
if (!cmm_sysctl_header)
goto out;
#endif
......
......@@ -960,7 +960,7 @@ static ctl_table sh64_root[] = {
static struct ctl_table_header *sysctl_header;
static int __init init_sysctl(void)
{
sysctl_header = register_sysctl_table(sh64_root, 0);
sysctl_header = register_sysctl_table(sh64_root);
return 0;
}
......
......@@ -367,7 +367,7 @@ static ctl_table abi_root_table2[] = {
static __init int ia32_binfmt_init(void)
{
register_sysctl_table(abi_root_table2, 0);
register_sysctl_table(abi_root_table2);
return 0;
}
__initcall(ia32_binfmt_init);
......
......@@ -301,7 +301,7 @@ static int __init vsyscall_init(void)
BUG_ON((unsigned long) &vgetcpu != VSYSCALL_ADDR(__NR_vgetcpu));
map_vsyscall();
#ifdef CONFIG_SYSCTL
register_sysctl_table(kernel_root_table2, 0);
register_sysctl_table(kernel_root_table2);
#endif
on_each_cpu(cpu_vsyscall_init, NULL, 0, 1);
hotcpu_notifier(cpu_vsyscall_notifier, 0);
......
......@@ -734,7 +734,7 @@ static ctl_table debug_root_table2[] = {
static __init int x8664_sysctl_init(void)
{
register_sysctl_table(debug_root_table2, 0);
register_sysctl_table(debug_root_table2);
return 0;
}
__initcall(x8664_sysctl_init);
......
......@@ -3553,7 +3553,7 @@ static void cdrom_sysctl_register(void)
if (initialized == 1)
return;
cdrom_sysctl_header = register_sysctl_table(cdrom_root_table, 0);
cdrom_sysctl_header = register_sysctl_table(cdrom_root_table);
/* set the defaults */
cdrom_sysctl_settings.autoclose = autoclose;
......
......@@ -1018,7 +1018,7 @@ static int __init hpet_init(void)
if (result < 0)
return -ENODEV;
sysctl_header = register_sysctl_table(dev_root, 0);
sysctl_header = register_sysctl_table(dev_root);
result = acpi_bus_register_driver(&hpet_acpi_driver);
if (result < 0) {
......
......@@ -686,7 +686,7 @@ static int ipmi_poweroff_init (void)
printk(KERN_INFO PFX "Power cycle is enabled.\n");
#ifdef CONFIG_PROC_FS
ipmi_table_header = register_sysctl_table(ipmi_root_table, 0);
ipmi_table_header = register_sysctl_table(ipmi_root_table);
if (!ipmi_table_header) {
printk(KERN_ERR PFX "Unable to register powercycle sysctl\n");
rv = -ENOMEM;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment