Re: [RFC,PATCH] dnotify: enhance or replace?

John McCutchan
2004-03-24T19:47:04Z

One of the big requirements for a dnotify replacement is this

* Some way to not have an open file descriptor for each directory you
are monitoring. This causes so many problems when unmounting, and this
is really the most noticable problem for the user.

I wanted to get some possible ideas from kernel hackers about how this
could be done. Inode numbers are not unique, but is there any way to get
a unique identifier on a file without using an open file? I have come
up with a few ideas.. I don't think they are very good, but here is
goes,

- When user passes fd to kernel to watch, the kernel takes over this
fd, making it invalid in user space ( I know this is a terrible hack)
then when a volume is unmounted, the kernel can walk the list of
open fd's using for notifacation and close them, before attempting to
unmount.

- The user passes a path to the kernel, the kernel does some work so
that it can track anything to do with that path, and again when
an unmount is called the kernel cleans up anything used for
notification.

Both of these ideas are similar, does anyone have a better idea?

John