Re: File change notification (enhanced dnotify)

From: Horst von Brand
Date: Mon Mar 22 2004 - 10:01:41 EST


=?ISO-8859-1?Q?R=FCdiger_Klaehn?= <rudi@xxxxxxxxxxxxx> said:
> Horst von Brand wrote:
> > =?ISO-8859-1?Q?R=FCdiger_Klaehn?= <rudi@xxxxxxxxxxxxx> said:
> >>I am working on a mechanism to let programs watch for file system
> >>changes in large directory trees or on the whole system. Since my last
> >>post in january I have been trying various approaches.

> > How do you propose to handle the fact that there are changes to _files_,
> > which happen to be pointed to by entries in directories? There is no
> > "change in the directory tree" in Unix...

> Of course it is files that change. But as you say each file is pointed
> to by one or more dentry, so I use the dentry hierarchy to propagate the
> information about the change. Just like the old dnotify.

dentries just keep the path travelled by hard links to get to the file in
memory for fast future access. So if you have, say:

dir1 dir2
| |
. .
. .
. .
\ /
somefile

and you referenced somefile by the path through dir1, if you monitor dir2
you won't notice the change. There is no on-disk data to trace back through
all the directories that reference the file, and reading all of the
filesystem's metadata to find this out is ludicrous (ever seen fsck(8)
taking an hour or so to make much the same?).
--
Dr. Horst H. von Brand User #22616 counter.li.org
Departamento de Informatica Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria +56 32 654239
Casilla 110-V, Valparaiso, Chile Fax: +56 32 797513
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/