Commit 97324cd8 authored by Eric W. Biederman's avatar Eric W. Biederman

sysctl: Implement retire_sysctl_set

This adds a small helper retire_sysctl_set to remove the intimate knowledge about
the how a sysctl_set is implemented from net/sysct_net.c
Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
parent a15e2098
...@@ -1080,6 +1080,10 @@ void setup_sysctl_set(struct ctl_table_set *p, ...@@ -1080,6 +1080,10 @@ void setup_sysctl_set(struct ctl_table_set *p,
p->is_seen = is_seen; p->is_seen = is_seen;
} }
void retire_sysctl_set(struct ctl_table_set *set)
{
WARN_ON(!list_empty(&set->list));
}
int __init proc_sys_init(void) int __init proc_sys_init(void)
{ {
......
...@@ -1072,6 +1072,7 @@ void proc_sys_poll_notify(struct ctl_table_poll *poll); ...@@ -1072,6 +1072,7 @@ void proc_sys_poll_notify(struct ctl_table_poll *poll);
extern void setup_sysctl_set(struct ctl_table_set *p, extern void setup_sysctl_set(struct ctl_table_set *p,
struct ctl_table_set *parent, struct ctl_table_set *parent,
int (*is_seen)(struct ctl_table_set *)); int (*is_seen)(struct ctl_table_set *));
extern void retire_sysctl_set(struct ctl_table_set *set);
void register_sysctl_root(struct ctl_table_root *root); void register_sysctl_root(struct ctl_table_root *root);
struct ctl_table_header *__register_sysctl_paths( struct ctl_table_header *__register_sysctl_paths(
......
...@@ -82,7 +82,7 @@ static int __net_init sysctl_net_init(struct net *net) ...@@ -82,7 +82,7 @@ static int __net_init sysctl_net_init(struct net *net)
static void __net_exit sysctl_net_exit(struct net *net) static void __net_exit sysctl_net_exit(struct net *net)
{ {
WARN_ON(!list_empty(&net->sysctls.list)); retire_sysctl_set(&net->sysctls);
} }
static struct pernet_operations sysctl_pernet_ops = { static struct pernet_operations sysctl_pernet_ops = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment