[CRIU] Re: [RFC] sockets, unix: Use general machnism for checkpoint/restore

Pavel Emelyanov xemul at parallels.com
Sat May 12 08:07:09 EDT 2012


On 05/11/2012 08:20 PM, Cyrill Gorcunov wrote:
> Pavel, tell me please how the attached patch looks for you.
> If it's ok I'll continue with other socket types.
> 
> 	Cyrill

> -static struct unix_sk_info *find_unix_sk(int id)
> +static int find_unix_sk_cb(struct file_desc *d, void *p)
>  {
> -	struct file_desc *d;
> +	struct unix_sk_info *ui = container_of(d, struct unix_sk_info, d);
> +	return ui->ue.ino == (u32)(long)p;
> +}
>  
> -	d = find_file_desc_raw(FDINFO_UNIXSK, id);
> +static struct unix_sk_info *find_unix_sk(int ino)
> +{
> +	struct file_desc *d;
> +	d = find_file_desc_slow_by(FDINFO_UNIXSK, (void *)(long)ino, find_unix_sk_cb);
>  	if (d)
>  		return container_of(d, struct unix_sk_info, d);
>  	return NULL;

Better store unix sockets in a private list rather than crashing the file desc
hash like this...

Otherwise looks ok.


More information about the CRIU mailing list