[CRIU] [PATCH 3/7] namespace: Add parse_ns_proc helper

Cyrill Gorcunov gorcunov at openvz.org
Thu May 9 14:53:47 EDT 2013


On Thu, May 09, 2013 at 09:53:46PM +0400, Pavel Emelyanov wrote:
> > +
> > +#define NS_PROC_ENTRY(_index, _name)			\
> > +	[_index] = {					\
> > +		.name		= _name,		\
> > +		.name_len	= sizeof(_name) - 1,	\
> 
> _index unused here. I see it in next patch and this makes me think that
> the series is badly splitted.
> 

Hmm? [_index] is the _index reference

> >  
> > +static struct ns_proc_entry ns_proc_entries[PROC_NS_MAX] = {
> > +	NS_PROC_ENTRY(PROC_NS_NET,	"net"),
> > +	NS_PROC_ENTRY(PROC_NS_UTS,	"uts"),
> > +	NS_PROC_ENTRY(PROC_NS_IPC,	"ipc"),
> > +	NS_PROC_ENTRY(PROC_NS_PID,	"pid"),
> > +	NS_PROC_ENTRY(PROC_NS_USER,	"user"),
> > +	NS_PROC_ENTRY(PROC_NS_MNT,	"mnt"),
> 
> We already have int <-> char * mapping for namespaces, no need in another int-s.

Where? If you mean ns_desc structure -- I would rather clean it up later
and use ns_proc_entries as reference instead.

	Cyrill


More information about the CRIU mailing list