From: Eric W. Biederman Date: Fri, 30 Nov 2007 12:52:10 +0000 (+1100) Subject: sysctl: Remember the ctl_table we passed to register_sysctl_paths X-Git-Tag: v2.6.25-rc1~1162^2~1318 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=23eb06de7d2d333a0f7ebba2da663e00c9c9483e;p=linux-2.6-omap-h63xx.git sysctl: Remember the ctl_table we passed to register_sysctl_paths By doing this we allow users of register_sysctl_paths that build and dynamically allocate their ctl_table to be simpler. This allows them to just remember the ctl_table_header returned from register_sysctl_paths from which they can now find the ctl_table array they need to free. Signed-off-by: Eric W. Biederman Cc: Serge Hallyn Cc: Daniel Lezcano Cc: Cedric Le Goater Cc: Pavel Emelyanov Signed-off-by: Andrew Morton Signed-off-by: Herbert Xu Signed-off-by: David S. Miller --- diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 3b6e2c9fbb2..77de3bfd874 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -1057,6 +1057,7 @@ struct ctl_table_header struct list_head ctl_entry; int used; struct completion *unregistering; + struct ctl_table *ctl_table_arg; }; /* struct ctl_path describes where in the hierarchy a table is added */ diff --git a/kernel/sysctl.c b/kernel/sysctl.c index f580542333e..89b7d95ecf5 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -1669,6 +1669,7 @@ struct ctl_table_header *register_sysctl_paths(const struct ctl_path *path, new += 2; } *prevp = table; + header->ctl_table_arg = table; INIT_LIST_HEAD(&header->ctl_entry); header->used = 0;