Jakob,
Linux 2.6 has an API to monitor directory changes right? We could have our own directory list hash in RAM.
Linux 2.4 has that too, but 2.6 has a proposed new interface with tries to generalise the idea.
The original interface (dnotify) is used by Samba already, and is rather similar to the ChangeNotify mechanism that NT has. That's isn't an accident, as it was developed by Stephen Rothwell and Mathew Wilcox with some input and testing from me specifically to help Samba implement ChangeNotify properly :-)
The new interface (inotify) is a bit more general, and may supplant dnotify, but doesn't change things all that much from our point of view if I understand it correctly.
Unfortunately it doesn't really help with case-insensitivity, as it is a non-blocking async interface, so the listeners get told way too late. Plus you have to have every directory open that you want to monitor, which would get silly.
There has been a proposal (from Linus and Ingo if I remember correctly) for a different cache coherence interface from the kernel that might allow us to maintain a better cache in userspace with reasonable coherence, but it isn't coded yet.
Personally I think that keeping a full alternative dcache in userspace isn't the right approach. I think we could bear the hit of something that keeps O(number_of_directories) memory, but not O(number_of_files). The lack of a sensible way to auto-shrink the user space dcache in low memory situations is just one of the many problems of a full userspace dcache.
Cheers, Tridge