[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: Eric W. Biederman <[email protected]>
Acked-by: Ralf Baechle <[email protected]>
Acked-by: Martin Schwidefsky <[email protected]>
Cc: Russell King <[email protected]>
Cc: David Howells <[email protected]>
Cc: "Luck, Tony" <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Martin Schwidefsky <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: Jens Axboe <[email protected]>
Cc: Corey Minyard <[email protected]>
Cc: Neil Brown <[email protected]>
Cc: "John W. Linville" <[email protected]>
Cc: James Bottomley <[email protected]>
Cc: Jan Kara <[email protected]>
Cc: Trond Myklebust <[email protected]>
Cc: Mark Fasheh <[email protected]>
Cc: David Chinner <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Patrick McHardy <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
Eric W. Biederman 2007-02-14 00:34:09 -08:00 • committed by Linus Torvalds
commit 0b4d414714
68 changed files with 75 additions and 80 deletions

View file

@ -73,7 +73,7 @@ static struct ctl_table_header *atalk_table_header;
void atalk_register_sysctl(void)
{
atalk_table_header = register_sysctl_table(atalk_root_table, 0);
atalk_table_header = register_sysctl_table(atalk_root_table);
}
void atalk_unregister_sysctl(void)

View file

@ -245,7 +245,7 @@ void ax25_register_sysctl(void)
ax25_dir_table[0].child = ax25_table;
ax25_table_header = register_sysctl_table(ax25_root_table, 0);
ax25_table_header = register_sysctl_table(ax25_root_table);
}
void ax25_unregister_sysctl(void)

View file

@ -957,7 +957,7 @@ int __init br_netfilter_init(void)
if (ret < 0)
return ret;
#ifdef CONFIG_SYSCTL
brnf_sysctl_header = register_sysctl_table(brnf_net_table, 0);
brnf_sysctl_header = register_sysctl_table(brnf_net_table);
if (brnf_sysctl_header == NULL) {
printk(KERN_WARNING
"br_netfilter: can't register to sysctl.\n");

View file

@ -2707,7 +2707,7 @@ int neigh_sysctl_register(struct net_device *dev, struct neigh_parms *p,
t->neigh_proto_dir[0].child = t->neigh_neigh_dir;
t->neigh_root_dir[0].child = t->neigh_proto_dir;
t->sysctl_header = register_sysctl_table(t->neigh_root_dir, 0);
t->sysctl_header = register_sysctl_table(t->neigh_root_dir);
if (!t->sysctl_header) {
err = -ENOBUFS;
goto free_procname;

View file

@ -127,7 +127,7 @@ static struct ctl_table_header *dccp_table_header;
int __init dccp_sysctl_init(void)
{
dccp_table_header = register_sysctl_table(dccp_root_table, 0);
dccp_table_header = register_sysctl_table(dccp_root_table);
return dccp_table_header != NULL ? 0 : -ENOMEM;
}

View file

@ -282,7 +282,7 @@ static void dn_dev_sysctl_register(struct net_device *dev, struct dn_dev_parms *
t->dn_dev_root_dir[0].de = NULL;
t->dn_dev_vars[0].extra1 = (void *)dev;
t->sysctl_header = register_sysctl_table(t->dn_dev_root_dir, 0);
t->sysctl_header = register_sysctl_table(t->dn_dev_root_dir);
if (t->sysctl_header == NULL)
kfree(t);
else

View file

@ -491,7 +491,7 @@ static ctl_table dn_root_table[] = {
void dn_register_sysctl(void)
{
dn_table_header = register_sysctl_table(dn_root_table, 0);
dn_table_header = register_sysctl_table(dn_root_table);
}
void dn_unregister_sysctl(void)

View file

@ -1606,7 +1606,7 @@ static void devinet_sysctl_register(struct in_device *in_dev,
t->devinet_root_dir[0].child = t->devinet_proto_dir;
t->devinet_root_dir[0].de = NULL;
t->sysctl_header = register_sysctl_table(t->devinet_root_dir, 0);
t->sysctl_header = register_sysctl_table(t->devinet_root_dir);
if (!t->sysctl_header)
goto free_procname;
@ -1640,7 +1640,7 @@ void __init devinet_init(void)
rtnetlink_links[PF_INET] = inet_rtnetlink_table;
#ifdef CONFIG_SYSCTL
devinet_sysctl.sysctl_header =
register_sysctl_table(devinet_sysctl.devinet_root_dir, 0);
register_sysctl_table(devinet_sysctl.devinet_root_dir);
devinet_sysctl_register(NULL, &ipv4_devconf_dflt);
#endif
}

View file

@ -2359,7 +2359,7 @@ int ip_vs_control_init(void)
proc_net_fops_create("ip_vs", 0, &ip_vs_info_fops);
proc_net_fops_create("ip_vs_stats",0, &ip_vs_stats_fops);
sysctl_header = register_sysctl_table(vs_root_table, 0);
sysctl_header = register_sysctl_table(vs_root_table);
/* Initialize ip_vs_svc_table, ip_vs_svc_fwm_table, ip_vs_rtable */
for(idx = 0; idx < IP_VS_SVC_TAB_SIZE; idx++) {

View file

@ -583,7 +583,7 @@ static struct ip_vs_scheduler ip_vs_lblc_scheduler =
static int __init ip_vs_lblc_init(void)
{
INIT_LIST_HEAD(&ip_vs_lblc_scheduler.n_list);
sysctl_header = register_sysctl_table(lblc_root_table, 0);
sysctl_header = register_sysctl_table(lblc_root_table);
return register_ip_vs_scheduler(&ip_vs_lblc_scheduler);
}

View file

@ -841,7 +841,7 @@ static struct ip_vs_scheduler ip_vs_lblcr_scheduler =
static int __init ip_vs_lblcr_init(void)
{
INIT_LIST_HEAD(&ip_vs_lblcr_scheduler.n_list);
sysctl_header = register_sysctl_table(lblcr_root_table, 0);
sysctl_header = register_sysctl_table(lblcr_root_table);
#ifdef CONFIG_IP_VS_LBLCR_DEBUG
proc_net_create("ip_vs_lblcr", 0, ip_vs_lblcr_getinfo);
#endif

View file

@ -622,7 +622,7 @@ static int __init ip_conntrack_proto_sctp_init(void)
}
#ifdef CONFIG_SYSCTL
ip_ct_sysctl_header = register_sysctl_table(ip_ct_net_table, 0);
ip_ct_sysctl_header = register_sysctl_table(ip_ct_net_table);
if (ip_ct_sysctl_header == NULL) {
ret = -ENOMEM;
printk("ip_conntrack_proto_sctp: can't register to sysctl.\n");

View file

@ -848,7 +848,7 @@ static int __init ip_conntrack_standalone_init(void)
goto cleanup_proc_stat;
}
#ifdef CONFIG_SYSCTL
ip_ct_sysctl_header = register_sysctl_table(ip_ct_net_table, 0);
ip_ct_sysctl_header = register_sysctl_table(ip_ct_net_table);
if (ip_ct_sysctl_header == NULL) {
printk("ip_conntrack: can't register to sysctl.\n");
ret = -ENOMEM;

View file

@ -693,7 +693,7 @@ static int __init ip_queue_init(void)
}
register_netdevice_notifier(&ipq_dev_notifier);
ipq_sysctl_header = register_sysctl_table(ipq_root_table, 0);
ipq_sysctl_header = register_sysctl_table(ipq_root_table);
status = nf_register_queue_handler(PF_INET, &nfqh);
if (status < 0) {

View file

@ -4029,7 +4029,7 @@ static void addrconf_sysctl_register(struct inet6_dev *idev, struct ipv6_devconf
t->addrconf_root_dir[0].child = t->addrconf_proto_dir;
t->addrconf_root_dir[0].de = NULL;
t->sysctl_header = register_sysctl_table(t->addrconf_root_dir, 0);
t->sysctl_header = register_sysctl_table(t->addrconf_root_dir);
if (t->sysctl_header == NULL)
goto free_procname;
else
@ -4114,7 +4114,7 @@ int __init addrconf_init(void)
rtnetlink_links[PF_INET6] = inet6_rtnetlink_table;
#ifdef CONFIG_SYSCTL
addrconf_sysctl.sysctl_header =
register_sysctl_table(addrconf_sysctl.addrconf_root_dir, 0);
register_sysctl_table(addrconf_sysctl.addrconf_root_dir);
addrconf_sysctl_register(NULL, &ipv6_devconf_dflt);
#endif

View file

@ -683,7 +683,7 @@ static int __init ip6_queue_init(void)
}
register_netdevice_notifier(&ipq_dev_notifier);
ipq_sysctl_header = register_sysctl_table(ipq_root_table, 0);
ipq_sysctl_header = register_sysctl_table(ipq_root_table);
status = nf_register_queue_handler(PF_INET6, &nfqh);
if (status < 0) {

View file

@ -107,7 +107,7 @@ static ctl_table ipv6_root_table[] = {
void ipv6_sysctl_register(void)
{
ipv6_sysctl_header = register_sysctl_table(ipv6_root_table, 0);
ipv6_sysctl_header = register_sysctl_table(ipv6_root_table);
}
void ipv6_sysctl_unregister(void)

View file

@ -52,7 +52,7 @@ static struct ctl_table_header *ipx_table_header;
void ipx_register_sysctl(void)
{
ipx_table_header = register_sysctl_table(ipx_root_table, 0);
ipx_table_header = register_sysctl_table(ipx_root_table);
}
void ipx_unregister_sysctl(void)

View file

@ -274,7 +274,7 @@ static struct ctl_table_header *irda_table_header;
*/
int __init irda_sysctl_register(void)
{
irda_table_header = register_sysctl_table(irda_root_table, 0);
irda_table_header = register_sysctl_table(irda_root_table);
if (!irda_table_header)
return -ENOMEM;

View file

@ -116,7 +116,7 @@ static struct ctl_table_header *llc_table_header;
int __init llc_sysctl_init(void)
{
llc_table_header = register_sysctl_table(llc_root_table, 0);
llc_table_header = register_sysctl_table(llc_root_table);
return llc_table_header ? 0 : -ENOMEM;
}

View file

@ -445,7 +445,7 @@ static int __init nf_conntrack_standalone_init(void)
proc_stat->owner = THIS_MODULE;
#endif
#ifdef CONFIG_SYSCTL
nf_ct_sysctl_header = register_sysctl_table(nf_ct_net_table, 0);
nf_ct_sysctl_header = register_sysctl_table(nf_ct_net_table);
if (nf_ct_sysctl_header == NULL) {
printk("nf_conntrack: can't register to sysctl.\n");
ret = -ENOMEM;

View file

@ -56,7 +56,7 @@ nf_register_sysctl_table(struct ctl_table *path, struct ctl_table *table)
path = path_dup(path, table);
if (path == NULL)
return NULL;
header = register_sysctl_table(path, 0);
header = register_sysctl_table(path);
if (header == NULL)
path_free(path, table);
return header;

View file

@ -192,7 +192,7 @@ static ctl_table nr_root_table[] = {
void __init nr_register_sysctl(void)
{
nr_table_header = register_sysctl_table(nr_root_table, 0);
nr_table_header = register_sysctl_table(nr_root_table);
}
void nr_unregister_sysctl(void)

View file

@ -160,7 +160,7 @@ static ctl_table rose_root_table[] = {
void __init rose_register_sysctl(void)
{
rose_table_header = register_sysctl_table(rose_root_table, 0);
rose_table_header = register_sysctl_table(rose_root_table);
}
void rose_unregister_sysctl(void)

View file

@ -97,7 +97,7 @@ static ctl_table rxrpc_dir_sysctl_table[] = {
int rxrpc_sysctl_init(void)
{
#ifdef CONFIG_SYSCTL
rxrpc_sysctl = register_sysctl_table(rxrpc_dir_sysctl_table, 0);
rxrpc_sysctl = register_sysctl_table(rxrpc_dir_sysctl_table);
if (!rxrpc_sysctl)
return -ENOMEM;
#endif /* CONFIG_SYSCTL */

View file

@ -254,7 +254,7 @@ static struct ctl_table_header * sctp_sysctl_header;
/* Sysctl registration. */
void sctp_sysctl_register(void)
{
sctp_sysctl_header = register_sysctl_table(sctp_root_table, 0);
sctp_sysctl_header = register_sysctl_table(sctp_root_table);
}
/* Sysctl deregistration. */

View file

@ -36,7 +36,7 @@ void
rpc_register_sysctl(void)
{
if (!sunrpc_table_header)
sunrpc_table_header = register_sysctl_table(sunrpc_table, 0);
sunrpc_table_header = register_sysctl_table(sunrpc_table);
}
void

View file

@ -1636,7 +1636,7 @@ int init_socket_xprt(void)
{
#ifdef RPC_DEBUG
if (!sunrpc_table_header)
sunrpc_table_header = register_sysctl_table(sunrpc_table, 0);
sunrpc_table_header = register_sysctl_table(sunrpc_table);
#endif
return 0;

View file

@ -50,7 +50,7 @@ static struct ctl_table_header * unix_sysctl_header;
void unix_sysctl_register(void)
{
unix_sysctl_header = register_sysctl_table(unix_root_table, 0);
unix_sysctl_header = register_sysctl_table(unix_root_table);
}
void unix_sysctl_unregister(void)

View file

@ -106,7 +106,7 @@ static struct ctl_table x25_root_table[] = {
void __init x25_register_sysctl(void)
{
x25_table_header = register_sysctl_table(x25_root_table, 0);
x25_table_header = register_sysctl_table(x25_root_table);
}
void x25_unregister_sysctl(void)