VFS event hooks in Linux

Richard Gooch rgooch at atnf.csiro.au
Tue Jun 29 00:46:18 GMT 1999


  Hi, all. Some of you may have seen the recent discussions on
linux-kernel about VFS event hooks. The idea is to have the kernel
send some kind of event when an inode is written (for a directory this
means you get to see when a leaf node is created or removed).

I've implemented such a scheme based on poll(2), which was Linus'
preferred method.

Following on from some private discussions, it's been brought to my
attention that Samba would benefit from VFS event hooks. Could someone
please explain what level of support is useful?

The poll(2)-based scheme I implemented requires an open file on each
inode that you want to watch. This is fine for simple applications
like a file browser, where you can easily keep the directory open.

It may not be appropriate for Samba, if you want to be notified when
*any* file in the exported volume has changed, as it would require a
ridiculous number of open files. So I'd like to establish just what
the requirements for Samba are.

An alternative scheme I'd devised would allow you to keep just a
single open file per filesystem, which is used to receive events when
any inode in that FS is written to. An event queue would be
maintained, to which the inode number would be written.

Is this scheme an improvement? If it is, then please give me your
arguments and I'll raise them with Linus.

				Regards,

					Richard....


More information about the samba-technical mailing list