[CRIU] [PATCH 08/18] fsnotify: Add try_open_handle helper

Cyrill Gorcunov gorcunov at openvz.org
Mon Jan 14 04:35:29 EST 2013


On Mon, Jan 14, 2013 at 01:29:00PM +0400, Pavel Emelyanov wrote:
> On 01/11/2013 08:58 PM, Cyrill Gorcunov wrote:
> > 
> > The helper chooses which path to get, if remapped name present
> > (a ghost file) we use it, otherwise we try to open file handle.
> > 
> > The reason for separate helper is that both inotify and fanotify
> > will use it, so we should try to eliminate code duplication.
> > 
> > -static int restore_one_fsnotify(int inotify_fd, struct fsnotify_wd_info *info)
> > +static char *try_open_handle(const char *who, struct fsnotify_wd_info *info, char *buf, size_t size, int *target)
> 
> This routine is not intended to open anything, we expect it to
> provide us a path we can feed into sys_inotify_add_watch. Thus
> some better name is better.

Well, I tried to reflect the fact that we retrieving the path to a target
via /proc/self/fd/* place. Would try_selfopen_handle sound better? The
"open" in name points that we *do* open a target path.

	Cyrill


More information about the CRIU mailing list