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

Pavel Emelyanov xemul at parallels.com
Thu May 9 15:16:37 EDT 2013


On 05/09/2013 10:53 PM, Cyrill Gorcunov wrote:
> 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.

OK, clean them up, but don't introduce yet another set of integers for
namespace description.

> 	Cyrill
> .
> 




More information about the CRIU mailing list