This is the mail archive of the
libc-help@sourceware.org
mailing list for the glibc project.
Re: Question about inotify calls.
On 8/15/2011 12:24 PM, Stef Bon wrote:
> Hi,
>
> I'm working on several FUSE filesystems, and looking for how to make
> inotify work on FUSE filesystems, and network
> fs's like cifs and nfs.
>
> I've tried a lot till I found out a wrapper for the inotify calls are
> the way to do it.
>
> To explain:
>
> inotify (and successors like fanotify) are onlt working for local
> filesystems where the VFS is the only "user". This is the case
> with a harddrive, and not with a FUSE filesystem or networkfilesystem.
> I've been thinking that making inotify work for these
> "outside of VFS filesystems" lies in the kernel. But then I came to
> the idea that a wrapper does the job.
>
> If the wrapper detects the target fs support native inotify, the
> normal syscall is done, like inotify_init, inotify_add_watch, rm-watch
> etc.
>
> If the target fs is FUSE or a networkfs, it has to connect to that fs
> via a socket in userspace.
>
> Is this possible, I'm want to know what you think.
It is certainly possible.
However, you must *not* slow down the fast path.
Whatever you do, the implementation must be clever enough to avoid
slowing down those syscalls for the common case.
Do you have a patch you can share?
Cheers,
Carlos.