From 0b4d414714f0d2f922d39424b0c5c82ad900a381 Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Wed, 14 Feb 2007 00:34:09 -0800 Subject: [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 Acked-by: Ralf Baechle Acked-by: Martin Schwidefsky Cc: Russell King Cc: David Howells Cc: "Luck, Tony" Cc: Ralf Baechle Cc: Paul Mackerras Cc: Martin Schwidefsky Cc: Andi Kleen Cc: Jens Axboe Cc: Corey Minyard Cc: Neil Brown Cc: "John W. Linville" Cc: James Bottomley Cc: Jan Kara Cc: Trond Myklebust Cc: Mark Fasheh Cc: David Chinner Cc: "David S. Miller" Cc: Patrick McHardy Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- kernel/sysctl.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'kernel/sysctl.c') diff --git a/kernel/sysctl.c b/kernel/sysctl.c index cb46d015684..6ccb6cc19e2 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -1244,7 +1244,6 @@ int do_sysctl_strategy (ctl_table *table, /** * register_sysctl_table - register a sysctl hierarchy * @table: the top-level table structure - * @insert_at_head: whether the entry should be inserted in front or at the end * * Register a sysctl table hierarchy. @table should be a filled in ctl_table * array. An entry with a ctl_name of 0 terminates the table. @@ -1310,8 +1309,7 @@ int do_sysctl_strategy (ctl_table *table, * This routine returns %NULL on a failure to register, and a pointer * to the table header on success. */ -struct ctl_table_header *register_sysctl_table(ctl_table * table, - int insert_at_head) +struct ctl_table_header *register_sysctl_table(ctl_table * table) { struct ctl_table_header *tmp; tmp = kmalloc(sizeof(struct ctl_table_header), GFP_KERNEL); @@ -1322,10 +1320,7 @@ struct ctl_table_header *register_sysctl_table(ctl_table * table, tmp->used = 0; tmp->unregistering = NULL; spin_lock(&sysctl_lock); - if (insert_at_head) - list_add(&tmp->ctl_entry, &root_table_header.ctl_entry); - else - list_add_tail(&tmp->ctl_entry, &root_table_header.ctl_entry); + list_add_tail(&tmp->ctl_entry, &root_table_header.ctl_entry); spin_unlock(&sysctl_lock); #ifdef CONFIG_PROC_SYSCTL register_proc_table(table, proc_sys_root, tmp); -- cgit v1.2.3