[CRIU] [PATCH 08/18] fsnotify: Add try_open_handle helper
Pavel Emelyanov
xemul at parallels.com
Mon Jan 14 04:41:37 EST 2013
On 01/14/2013 01:35 PM, Cyrill Gorcunov wrote:
> 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.
Opening anything inside is a side effect. Name is fsnotify_get_path_to_watch.
> Cyrill
> .
>
More information about the CRIU
mailing list