[Devel] Re: [RFC PATCH 3/4] namespace containers: add nsproxy to nscont struct

Paul Menage menage at google.com
Mon Feb 12 15:27:47 PST 2007


On 2/12/07, Serge E. Hallyn <serue at us.ibm.com> wrote:
> --- a/kernel/container.c
> +++ b/kernel/container.c
> @@ -1581,6 +1581,14 @@ static void get_unused_name(char *buf) {
>         sprintf(buf, "node%d", atomic_inc_return(&namecnt));
>  }
>
> +/* XXX need to create include/linux/ns_container.h and move this there */
> +#ifdef CONFIG_CONTAINER_NS
> +void ns_set_nsproxy_from_task(struct container *cont, struct task_struct *tsk);
> +#else
> +static inline void
> +ns_set_nsproxy_from_task(struct container *cont, struct task_struct *tsk) { }
> +#endif
> +

Can't this just go in include/linux/nsproxy.h ?

>
> +       /* mark the auto-created container with the new namespace list */
> +       ns_set_nsproxy_from_task(child, tsk);
> +

This should be in ns_container_clone() or some (possibly new)
subsystem callback, rather than embedded in the generic containers
code.

Paul




More information about the Devel mailing list