[CRIU] Re: [PATCH 8/8] sockets: Restore in-flight unix stream sockets

Pavel Emelyanov xemul at openvz.org
Fri Jan 27 13:10:47 EST 2012


On 01/27/2012 10:08 PM, Cyrill Gorcunov wrote:
> On Fri, Jan 27, 2012 at 09:57:01PM +0400, Pavel Emelyanov wrote:
>> On 01/27/2012 09:38 PM, Cyrill Gorcunov wrote:
>>> On Fri, Jan 27, 2012 at 08:15:15PM +0400, Cyrill Gorcunov wrote:
>>>  
>>>> я могу имя поменять на usk_listeners, но сути это сильно не изменит.
>>>> Подумаю...
>>>>
>>>
>>> Something like below I guess? Two hashes -- one for sockets at dump
>>> time and one to use at restore time as sockets names keeper.
>>
>> Close to perfect! Some comments inside.
>>
> ...
>>> 	Cyrill
>>>  
>>>  struct inet_sk_desc {
>>> @@ -75,6 +88,7 @@ struct inet_sk_desc {
>>>  		(elem)->next = (head)[(key) % SK_HASH_SIZE];		\
>>>  		(head)[(key) % SK_HASH_SIZE] = (elem);			\
>>>  	} while (0)
>>> +
>>
>> Garbage.
>>
> 
> I'll fix all nits. Pavel, but how to be with "sockets: Add SK_HASH_LINK helper"?
> That's from where above snippet came from (I simply did git diff 'cause the
> patch is not stable yet). As I said we can't use function helper here otherwise
> we will need some generic type instead and embed it into all hash users.
> 
> Can we live with macro version
> 
> +#define SK_HASH_LINK(head, key, elem)					\
> +	do {								\
> +		(elem)->next = (head)[(key) % SK_HASH_SIZE];		\
> +		(head)[(key) % SK_HASH_SIZE] = (elem);			\
> +	} while (0)
> 
> ?

OK. 

> 	Cyrill




More information about the CRIU mailing list