aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/proc_sysctl.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2012-01-23 00:10:21 -0500
committerEric W. Biederman <ebiederm@xmission.com>2012-01-24 19:37:55 -0500
commitbd295b56cfae85f2dd6c2b03951480c91e6d08f3 (patch)
tree7f8667dbf6c297897b6427d228885d565e263c66 /fs/proc/proc_sysctl.c
parent97324cd804b7b9fb6044e114329335db79810425 (diff)
sysctl: Remove the unnecessary sysctl_set parent concept.
In sysctl_net register the two networking roots in the proper order. In register_sysctl walk the sysctl sets in the reverse order of the sysctl roots. Remove parent from ctl_table_set and setup_sysctl_set as it is no longer needed. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'fs/proc/proc_sysctl.c')
-rw-r--r--fs/proc/proc_sysctl.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c
index 9d8223cd365..86d32a318e2 100644
--- a/fs/proc/proc_sysctl.c
+++ b/fs/proc/proc_sysctl.c
@@ -995,13 +995,20 @@ struct ctl_table_header *__register_sysctl_paths(
995 header->attached_by = header->ctl_table; 995 header->attached_by = header->ctl_table;
996 header->attached_to = root_table; 996 header->attached_to = root_table;
997 header->parent = &root_table_header; 997 header->parent = &root_table_header;
998 for (set = header->set; set; set = set->parent) { 998 set = header->set;
999 root = header->root;
1000 for (;;) {
999 struct ctl_table_header *p; 1001 struct ctl_table_header *p;
1000 list_for_each_entry(p, &set->list, ctl_entry) { 1002 list_for_each_entry(p, &set->list, ctl_entry) {
1001 if (p->unregistering) 1003 if (p->unregistering)
1002 continue; 1004 continue;
1003 try_attach(p, header); 1005 try_attach(p, header);
1004 } 1006 }
1007 if (root == &sysctl_table_root)
1008 break;
1009 root = list_entry(root->root_list.prev,
1010 struct ctl_table_root, root_list);
1011 set = lookup_header_set(root, namespaces);
1005 } 1012 }
1006 header->parent->count++; 1013 header->parent->count++;
1007 list_add_tail(&header->ctl_entry, &header->set->list); 1014 list_add_tail(&header->ctl_entry, &header->set->list);
@@ -1072,11 +1079,9 @@ void unregister_sysctl_table(struct ctl_table_header * header)
1072EXPORT_SYMBOL(unregister_sysctl_table); 1079EXPORT_SYMBOL(unregister_sysctl_table);
1073 1080
1074void setup_sysctl_set(struct ctl_table_set *p, 1081void setup_sysctl_set(struct ctl_table_set *p,
1075 struct ctl_table_set *parent,
1076 int (*is_seen)(struct ctl_table_set *)) 1082 int (*is_seen)(struct ctl_table_set *))
1077{ 1083{
1078 INIT_LIST_HEAD(&p->list); 1084 INIT_LIST_HEAD(&p->list);
1079 p->parent = parent ? parent : &sysctl_table_root.default_set;
1080 p->is_seen = is_seen; 1085 p->is_seen = is_seen;
1081} 1086}
1082 1087