Dentry
A dentry is an in-memory Linux VFS object that associates a pathname component and parent with an inode or records the absence of an associated inode.
Identity: Dentries live in RAM, not on disk. Several dentries can refer to one inode, as with hard links; the cache object is distinct from a filesystem's stored directory record. [1]
Lookup: A positive dentry has an associated inode. A negative dentry has no associated inode and can cache a name's absence; a cache miss supplies no existence answer. Resolving that miss needs further lookup. Network and clustered filesystems can require revalidation of cached information. [2]
Concurrency: A referenced negative dentry can become positive while its parent is unlocked. Cached absence therefore does not reserve a pathname or make a later create conditional on the earlier lookup. [3]
Relations
- related
- Inode, Path resolution, Hard link, NFS lookup cache, Atomic rename
Limitations
- A cached name-to-inode association does not establish crash durability.
Citations
- Linux v6.16: VFS dcache and inode objects
- Linux v6.16: pathname lookup, cache absence and revalidation
- Linux v6.16: unlocked lookup helpers and changing negative dentries
Sources & caveats
- Source review scoped to Linux v6.16 documentation and implementation at commit 038d61fd642278bab63ee8ef722c50d10ab01e8f. No native kernel experiment or cache-performance measurement.
- See the namespace analysis for the separate creation and persistence contracts: https://hesela.com/analyses/atomic-rename-directory-durability/#dentry-cache