[CRIU] Re: [PATCH 10/10] files: Use sys_kcmp to find file descriptor duplicates

Cyrill Gorcunov gorcunov at openvz.org
Mon Feb 27 02:37:49 EST 2012


On Mon, Feb 27, 2012 at 11:26:58AM +0400, Pavel Emelyanov wrote:
> > +void fd_id_entry_init(void)
> > +{
> > +       /* Has nothing to do yet */
> > +}
> > +
> > +void fd_id_entry_fini(void)
> > +{
> > +       /* Clear fd_id_entries */
> > +       fd_id_entries_salt = 1;
> > +}
> 
> These two are useless. Plz, remove.

Sure.

> 
> Double walk -- plz, remove.

OK

> > +struct fd_id_entry *fd_id_entry_collect(u64 id, pid_t pid, int fd)
> > +{
> > +       pr_debug("collect-fd:\tid %16lx pid %6d fd %4d\n", id, pid, fd);
> > +       return lookup_alloc(id, pid, fd, true);
> 
> Plz remove always true argument.
> 
> > +}
> > +#define GEN_FD_ID(dev, ino, pos)       \
> > +       ((u64)(dev) ^ (u64)(ino) ^ (u64)(pos))
> 
> u32 is enough for this, no?

I would not shrink it. Look, at moment u32 is enough but it's unknown
will it be enough always. Do we really win something in shrinking it
here?

> > +       u64     id;
> > +       u64     salt;
> 
> Plz, make an ID in image entry be a single field.
> 

Ah, I see, OK I'll join salt and id together in u64.

	Cyrill


More information about the CRIU mailing list