[CRIU] [PATCH 1/6] files: Add ability to use read link in dump_one_reg_file

Cyrill Gorcunov gorcunov at openvz.org
Tue May 14 16:51:15 EDT 2013


On Wed, May 15, 2013 at 12:41:45AM +0400, Pavel Emelyanov wrote:
> >  
> > -	len = read_fd_link(lfd, path, sizeof(rpath) - 1);
> > -	if (len < 0) {
> > -		pr_err("Can't read link\n");
> > -		return len;
> > +	if (!p->link) {
> > +		if (fill_fdlink(lfd, p, &_link))
> 
> Make fill_fdlink assign p->link = &link and thus if would look like

I tried to escape this, but sure, will update.

> > --- a/include/files.h
> > +++ b/include/files.h
> > @@ -17,6 +17,11 @@ struct cr_fdset;
> >  struct rst_info;
> >  struct parasite_ctl;
> >  
> > +struct fd_link {
> > +	char		name[PATH_MAX + 1];
> 
> Is it nice to put 2 more PAGE_SIZE things on stack?

It's fine to have it declared this way, this is not the argument
which is used in deeply nested functions, so we're safe here and
code is easier to read I believe, no?


	Cyrill


More information about the CRIU mailing list