file system change notifications

O'Connor, Daniel darius at dons.net.au
Fri Mar 13 01:26:24 UTC 2015


> On 13 Mar 2015, at 01:08, Mateusz Guzik <mjguzik at gmail.com> wrote:
>> I seem to recall reading a long time ago that DragonFly pins directories
>> in the cache, or something like that.
>> 
> 
> Just refing is quite insufficient and may not work at all.
> 
> Due to hardlinks files can have more than one name.
> 
> So preferably we would stop tossing vnodes around and create an
> intermediate object which would keep name component and a pointer to an
> inode. And that's what we would keep in struct file.
> 
> Then a namecache would just be a hash of such objects.
> 
> That's quite a lot of work though and unfortunately is likely too
> complicated for gsoc.

I did some testing and neither Linux inotify or OS X FSEvents handle hard links so I think it's somewhat out of scope.

i.e. if you create /tmp/a and /tmp/b and have 2 separate processes watching /tmp/a and /tmp/b then do..
1) echo foo >/tmp/a/foo
2) ln /tmp/a/foo /tmp/b/foo
3) echo bar >/tmp/b/foo

Step 1 shows a notification for /tmp/a/foo
Step 2 shows a notification for /tmp/b/foo (and /tmp/a in OS X)
Step 3 shows a notification for /tmp/b/foo (even though /tmp/a has changed too)

--
Daniel O'Connor
"The nice thing about standards is that there
are so many of them to choose from."
 -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C



More information about the freebsd-hackers mailing list