[CRIU] [PATCH 10/17] fsnotify: Add fanotify restore
Cyrill Gorcunov
gorcunov at openvz.org
Mon Dec 24 08:47:31 EST 2012
On Mon, Dec 24, 2012 at 05:23:46PM +0400, Pavel Emelyanov wrote:
> On 12/11/2012 01:34 AM, Cyrill Gorcunov wrote:
> >
> > The idea is the same as for inotify -- just open
> > notification descriptor and hook paths on.
> >
> > Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> > ---
> > fsnotify.c | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
> > 1 file changed, 89 insertions(+), 2 deletions(-)
> >
>
>
> > +static int open_fanotify_fd(struct fsnotify_file_info *info)
> > +{
> > + unsigned int faflags = info->ife->faglob->faflags;
> > + struct fsnotify_wd_info *wd_info;
> > + int ret = -1;
> > +
> > + if (info->ife->flags & O_CLOEXEC)
> > + faflags |= FAN_CLOEXEC;
> > + if (info->ife->flags & O_NONBLOCK)
> > + faflags |= FAN_NONBLOCK;
> > +
> > + ret = sys_fanotify_init(faflags, info->ife->faglob->evflags);
>
> faglob is optional, thus can be NULL.
>
No, at this moment it can;t be nil.
static int verify_file_info(struct fsnotify_file_info *info)
{
FsnotifyFileEntry *ife = info->ife;
/*
* Old image, setup default type.
*/
if (unlikely(!ife->has_type)) {
ife->has_type = true;
ife->type = FSNOTIFY_TYPE__INOTIFY;
}
if (ife->type == FSNOTIFY_TYPE__FANOTIFY) {
if (!ife->faglob) {
pr_err("Corrupted fanotify global parameters\n");
return -1;
}
}
return 0;
}
Cyrill
More information about the CRIU
mailing list