[CRIU] [PATCH 01/16] proc_parse: parse fdinfo to get pos and flags

Andrew Vagin avagin at parallels.com
Wed Apr 9 04:24:28 PDT 2014


On Wed, Apr 09, 2014 at 02:59:57PM +0400, Cyrill Gorcunov wrote:
> On Wed, Apr 09, 2014 at 03:34:53AM +0400, Andrey Vagin wrote:
> > +++ b/proc_parse.c
> > @@ -1020,7 +1020,27 @@ static int parse_fdinfo_pid_s(char *pid, int fd, int type,
> >  	while (fgets(str, sizeof(str), f)) {
> >  		union fdinfo_entries entry;
> >  
> > -		if (fdinfo_field(str, "pos") || fdinfo_field(str, "counter"))
> > +		if (fdinfo_field(str, "pos") ||
> > +		    fdinfo_field(str, "flags")) {
> 			...
> > +			continue;
> > +		}
> > +
> > +		if (type == FD_TYPES__UND)
> >  			continue;
> 
> Why have you removed fdinfo_field(str, "counter") here?

Currently parse_fdinfo_pid_s is called for each file, so this extra
check probaly will slow down this function.


More information about the CRIU mailing list