static struct ctl_table_root sysctl_table_root = {
.root_list = LIST_HEAD_INIT(sysctl_table_root.root_list),
.default_set.list = LIST_HEAD_INIT(root_table_header.ctl_entry),
+ .default_set.root = &sysctl_table_root,
};
static DEFINE_SPINLOCK(sysctl_lock);
EXPORT_SYMBOL(unregister_sysctl_table);
void setup_sysctl_set(struct ctl_table_set *p,
+ struct ctl_table_root *root,
int (*is_seen)(struct ctl_table_set *))
{
INIT_LIST_HEAD(&p->list);
+ p->root = root;
p->is_seen = is_seen;
}
struct ctl_table_set {
struct list_head list;
+ struct ctl_table_root *root;
int (*is_seen)(struct ctl_table_set *);
};
void proc_sys_poll_notify(struct ctl_table_poll *poll);
extern void setup_sysctl_set(struct ctl_table_set *p,
+ struct ctl_table_root *root,
int (*is_seen)(struct ctl_table_set *));
extern void retire_sysctl_set(struct ctl_table_set *set);
}
static inline void setup_sysctl_set(struct ctl_table_set *p,
+ struct ctl_table_root *root,
int (*is_seen)(struct ctl_table_set *))
{
}
static int __net_init sysctl_net_init(struct net *net)
{
- setup_sysctl_set(&net->sysctls,
- is_seen);
+ setup_sysctl_set(&net->sysctls, &net_sysctl_root, is_seen);
return 0;
}
ret = register_pernet_subsys(&sysctl_pernet_ops);
if (ret)
goto out;
- setup_sysctl_set(&net_sysctl_ro_root.default_set, NULL);
+ setup_sysctl_set(&net_sysctl_ro_root.default_set, &net_sysctl_ro_root, NULL);
register_sysctl_root(&net_sysctl_ro_root);
register_sysctl_root(&net_sysctl_root);
out: