I think everyone agrees that dnotify is a POS that needs replacement,I want something like this, so I am willing to spend some time implementing it.
however coming up with a good new API and implementation seems to be
hard (or at least uninteresting to kernel developers).
I for sure would welcome a sane file change notification API, i.e. oneAbout recursive notification:
that doesn't require the use of signals. However, I don't really care
about recursive monitors, and I'm actually unsure if you really want the
DN_EXTENDED functionallity in the kernel. It seems like a great way to
make the kernel use a lot of unswappable memory, unless you limit the
event queues, and if you do that you need to stat all files in userspace
anyway so you can correctly handle queue overflows.
I think the most important properties for a good dnotify replacement is:Agreed.
* Don't use signals or any other global resource that makes it
impossible to use the API in a library thats supposed to be used by all
sorts of applications.
* Get sane semantics. i.e. if a hardlink changes notify a file change inThis would require large changes, and I think figuring out all aliases to a path might as well be done in userspace. You don't gain much by putting this in the kernel, and it requires a lot of complexity.
all directories the file is in. (This is hard though, it needs backlinks
from the inodes to the directories, at least for the directories with a
monitor, something i guess we don't have today.)
* Some way to get an event when the last open fd to the file is closedShould be no problem to add this with the current approach. But it is not that bad if you are getting hundreds of write events for a single file. They are just 32 bytes, so you can just throw them away in the userspace if you are not interested in them.
after a file change. This means you won't get hundreds of write events
for a single file change. (Of course, you won't catch writes to e.g.
logs which aren't closed, so this has to be optional. But for a desktop,
this is often what you want.)