[Development] Notifyfs: a fsevent monitor.

Stef Bon stefbon at gmail.com
Thu May 17 19:37:55 CEST 2012


Hi,

I’ve been working on a filesystem event watcher for some time now. As
user of KDE I contacted first the developers of kDirWatch. They send
me to developers of Qt, because the KDirWatch is being deprecated, as
the same is done already in Qt.

Then contacted Thiago Macieira for suggestions about howto test
notifyfs (that’s the name of it) as backend of QFileSystemWatcher. He
suggested me posting a message here, since QFileSystemWatcher is
“flawed by design” (his words) and a replacement is required.

So here I present notifyfs. Here a copy from the project website:

Notifyfs is a FUSE overlay fs, which tries to stay uptodate with the
underlying filesystems.

It monitors:

a. mounts via watching /proc/self/mountinfo

it can forward added and removed mounts via messages to connected clients.

(it handles mounts which are managed by autofs different, here a
unmount is treated as set to “sleep”, instead of remove, cause it can
get back (“wakeup”) any moment)

b. filesystem changes via the default backend, on linux that is inotify

c. filesystem changes on filesystems like cifs, nfs, FUSE based fs’s
and other network filesystems by forwarding the watch to the
filesystem. With inotify the target fs is not aware a watch has been
set. By forwarding the watch to the target fs, (which should be
connected to notifyfs somehow) this fs can setup a backend specific
watch.

Connecting notifyfs with a fs in userspace (FUSE!) is easy, with cifs
this is difficult, but not impossible. I guess this is possible with
netlink.

I’m experimenting with making notifyfs connect to a notifyfs process
on another host, and test it with networkfilesystems like sshfs. This
is just an experiment, this is not the way I want it to work:
filesystems themselves should setup a watch on their backend, and
forward any gsevent back to notifyfs.

Futher:

- notifyfs uses the inotify format for describing a fsevent, and
setting a watch.

- notifyfs tries to minimize the number of events send to clients

- notifyfs can send very detailed information, but also basic signals
to the client. I’ve read that the implementation of KDE (kdirwatch)
and QT internally the status created, deleted and dirty is used. It’s
very possible to make notifyfs only send that information.

- notifyfs sends with every fsevent the id the client uses to identify
the watch.

Recently I;ve had contact with a developer of cifs (CIFS on Linux) and
aggreed that it’s possible and worth trying to make this work for
cifs. It’s possible for cifs to set a watch on the backend using
“SMB2_CHANGE_NOTIFY” request. Futher I’m waiting for the notify
request to become available in libsmbclient, to test with another FUSE
filesystem fusesmb.

Projectpage:

http://code.google.com/p/notifyfs/

My intention is to make notifyfs gui toolkit independant, and
currently only for Linux.

Are you interested? I've understood the fsevent monitor for qt needs
redesign. If I know what the requirements are for this new fsevent
monitor, I would like to know what these requirements are.

Stef Bon



More information about the Development mailing list