mirror of
https://github.com/hanzoai/visor.git
synced 2026-09-24 17:04:14 +00:00
Mirrors fsimpl/gofer's caching model: each dentry holds one ref on its parent; childMap is a weak map. refs == 0 means cache-eligible; refs == -1 means destroyed. Cached children still hold their parent's ref, so a parent only enters the cache after all its children are gone. Per-dentry cachingMu serializes caching state; fs.cacheMu is held only for LRU list mutations. Eviction re-checks under parent.dirMu, severs from childMap, then destroys, cascading checkCaching up the tree. Cache limit is 1000. Co-authored-by: Ayush Ranjan <[email protected]>