diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2007-02-14 03:34:09 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-14 11:09:59 -0500 |
commit | 0b4d414714f0d2f922d39424b0c5c82ad900a381 (patch) | |
tree | 5079ec59a5622c9cacfe0fce484ba2c4626c406f /kernel | |
parent | ae836810263509ff7a3c2c021754ce6f66b3fab6 (diff) |
[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 <ebiederm@xmission.com>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Acked-by: Martin 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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sysctl.c | 9 | ||||
-rw-r--r-- | kernel/utsname_sysctl.c | 2 |
2 files changed, 3 insertions, 8 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c index cb46d0156840..6ccb6cc19e28 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c | |||
@@ -1244,7 +1244,6 @@ int do_sysctl_strategy (ctl_table *table, | |||
1244 | /** | 1244 | /** |
1245 | * register_sysctl_table - register a sysctl hierarchy | 1245 | * register_sysctl_table - register a sysctl hierarchy |
1246 | * @table: the top-level table structure | 1246 | * @table: the top-level table structure |
1247 | * @insert_at_head: whether the entry should be inserted in front or at the end | ||
1248 | * | 1247 | * |
1249 | * Register a sysctl table hierarchy. @table should be a filled in ctl_table | 1248 | * Register a sysctl table hierarchy. @table should be a filled in ctl_table |
1250 | * array. An entry with a ctl_name of 0 terminates the table. | 1249 | * array. An entry with a ctl_name of 0 terminates the table. |
@@ -1310,8 +1309,7 @@ int do_sysctl_strategy (ctl_table *table, | |||
1310 | * This routine returns %NULL on a failure to register, and a pointer | 1309 | * This routine returns %NULL on a failure to register, and a pointer |
1311 | * to the table header on success. | 1310 | * to the table header on success. |
1312 | */ | 1311 | */ |
1313 | struct ctl_table_header *register_sysctl_table(ctl_table * table, | 1312 | struct ctl_table_header *register_sysctl_table(ctl_table * table) |
1314 | int insert_at_head) | ||
1315 | { | 1313 | { |
1316 | struct ctl_table_header *tmp; | 1314 | struct ctl_table_header *tmp; |
1317 | tmp = kmalloc(sizeof(struct ctl_table_header), GFP_KERNEL); | 1315 | tmp = kmalloc(sizeof(struct ctl_table_header), GFP_KERNEL); |
@@ -1322,10 +1320,7 @@ struct ctl_table_header *register_sysctl_table(ctl_table * table, | |||
1322 | tmp->used = 0; | 1320 | tmp->used = 0; |
1323 | tmp->unregistering = NULL; | 1321 | tmp->unregistering = NULL; |
1324 | spin_lock(&sysctl_lock); | 1322 | spin_lock(&sysctl_lock); |
1325 | if (insert_at_head) | 1323 | list_add_tail(&tmp->ctl_entry, &root_table_header.ctl_entry); |
1326 | list_add(&tmp->ctl_entry, &root_table_header.ctl_entry); | ||
1327 | else | ||
1328 | list_add_tail(&tmp->ctl_entry, &root_table_header.ctl_entry); | ||
1329 | spin_unlock(&sysctl_lock); | 1324 | spin_unlock(&sysctl_lock); |
1330 | #ifdef CONFIG_PROC_SYSCTL | 1325 | #ifdef CONFIG_PROC_SYSCTL |
1331 | register_proc_table(table, proc_sys_root, tmp); | 1326 | register_proc_table(table, proc_sys_root, tmp); |
diff --git a/kernel/utsname_sysctl.c b/kernel/utsname_sysctl.c index 324aa1341b5f..f22b9dbd2a9c 100644 --- a/kernel/utsname_sysctl.c +++ b/kernel/utsname_sysctl.c | |||
@@ -139,7 +139,7 @@ static struct ctl_table uts_root_table[] = { | |||
139 | 139 | ||
140 | static int __init utsname_sysctl_init(void) | 140 | static int __init utsname_sysctl_init(void) |
141 | { | 141 | { |
142 | register_sysctl_table(uts_root_table, 0); | 142 | register_sysctl_table(uts_root_table); |
143 | return 0; | 143 | return 0; |
144 | } | 144 | } |
145 | 145 | ||