Reliable full path resolution for opened files and directories is becoming expectation from more and more software. Unlike Linux, VFS in FreeBSD is inode-centric and thus full path resolution is hard. Namecache in FreeBSD tends to reclaim intermediate directory vnodes and purges all entries from cache on removing or renaming single entry in directory, making full path resolution even harder. I propose to develop a directory cache that would make reliable full path resolution possible.
- 3 weeks. Use dircache from pefs (my last year SoC project) as a base. Add dircache support to tmpfs. Dirhash is too tightly coupled with UFS, UFS is too complex to debug. I think all name handling in tmpfs could be delegated to dircache (if it's feasible for testing/experimenting).
- 2 weeks. Change pefs to use dircache. Pefs already uses internal dircache, transition shouldn't be troublesome. In my opinion it should be the best way to come up with clean and useful dircache API: use it for different types of consumers.
- 1 week. Add/test support for mixed weak/hard entries in directory: two entries with same inode number, emulate snapshot dirs in tmpfs, etc.
- 3 weeks. Add weak-only implementation (using current cache API). At this point it should be possible to replace current cache, without any visible changes.
- 2 week. Add namespace support. Namespace is to decide what parent to choose if there are several parents for entry. Namespace is stored with every open file/cwd record processes has opened.
- 1 week. Final testing.