Re: [PATCH 21/29] sysctl: Add a root pointer to ctl_table_set

From: Lucian Adrian Grijincu
Date: Sun Jan 29 2012 - 12:20:50 EST


On Fri, Jan 27, 2012 at 6:51 AM, Eric W. Biederman
<ebiederm@xxxxxxxxxxxx> wrote:
> Add a ctl_table_root pointer to ctl_table set so it is easy to

"ctl_table set" -> "ctl_table_set"

> go from a ctl_table_set to a ctl_table_root.
>
> Signed-off-by: Eric W. Biederman <ebiederm@xxxxxxxxxxxx>
> ---
> Âfs/proc/proc_sysctl.c Â| Â Â3 +++
> Âinclude/linux/sysctl.h | Â Â3 +++
> Ânet/sysctl_net.c    |  Â5 ++---
> Â3 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c
> index d9c3ae6..65c13dd 100644
> --- a/fs/proc/proc_sysctl.c
> +++ b/fs/proc/proc_sysctl.c
> @@ -45,6 +45,7 @@ static struct ctl_table_header root_table_header = {
> Â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);
> @@ -1348,9 +1349,11 @@ void unregister_sysctl_table(struct ctl_table_header * header)
> Â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;
> Â}
>
> diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
> index e40b8f6..e73ba33 100644
> --- a/include/linux/sysctl.h
> +++ b/include/linux/sysctl.h
> @@ -1047,6 +1047,7 @@ struct ctl_table_header
>
> Âstruct ctl_table_set {
> Â Â Â Âstruct list_head list;
> + Â Â Â struct ctl_table_root *root;
> Â Â Â Âint (*is_seen)(struct ctl_table_set *);
> Â};
>
> @@ -1069,6 +1070,7 @@ struct ctl_path {
> Â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);
>
> @@ -1103,6 +1105,7 @@ static inline void unregister_sysctl_table(struct ctl_table_header * table)
> Â}
>
> Âstatic inline void setup_sysctl_set(struct ctl_table_set *p,
> + Â Â Â struct ctl_table_root *root,
> Â Â Â Âint (*is_seen)(struct ctl_table_set *))
> Â{
> Â}
> diff --git a/net/sysctl_net.c b/net/sysctl_net.c
> index 07c6b87..e998c64 100644
> --- a/net/sysctl_net.c
> +++ b/net/sysctl_net.c
> @@ -74,8 +74,7 @@ static struct ctl_table_root net_sysctl_ro_root = {
>
> Â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;
> Â}
>
> @@ -95,7 +94,7 @@ static __init int net_sysctl_init(void)
> Â Â Â Â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:
> --
> 1.7.2.5
>



--
Â.
..: Lucian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/