d_add_ci(9)
β¨ d_add_ci β¨
okay bestie, welcome to the Kernel API Manual β today's main character is d_add_ci(9) and honestly? she's lowkey iconic for keeping your dcache from getting messy π
πΈ NAME πΈ
d_add_ci β lookup or allocate new dentry with case-exact name
like, she finds the right one or makes a fresh one, and either way it's the exact case. no cap. π
π¦ SYNOPSIS π¦
struct dentry * d_add_ci (struct dentry *dentry , struct inode *inode ,
struct qstr *name );
β¨ ARGUMENTS β¨
dentryβ the negative dentry that was passed to the parent's lookup func π«Ά (you know the one, she came in through the parent, remember her)inodeβ the inode case-insensitive lookup has found π (found her! slay)nameβ the case-exact name to be associated with the returned dentry π (spelling matters, bestie)
π DESCRIPTION π
okay so the whole point here is to avoid filling the dcache with case-insensitive names to the same inode. only the actual correct case is stored in the dcache for case-insensitive filesystems. it's giving "one true spelling per inode" energy and we're obsessed β¨
so when you get a case-insensitive lookup match and the case-exact dentry already exists in the dcache? you just use it and return it. easy. slay. π
but if no entry exists with the exact case name? then you allocate a new dentry with the exact case, and return the spliced entry. periodt. π¦
ngl this is all about keeping the dcache pristine β no duplicate-case chaos allowed in this house π
π SEE ALSO π
- Kernel file
./fs/dcache.c d_drop(9)dentry_kill(9)__move_to_shrink_list(9)d_find_any_alias(9)d_find_alias(9)prune_dcache_sb(9)shrink_dcache_sb(9)enum d_walk_ret(9)d_walk(9)path_has_submounts(9)shrink_dcache_tree(9)d_invalidate(9)__d_alloc(9)d_alloc(9)d_alloc_pseudo(9)d_instantiate(9)d_obtain_alias(9)d_obtain_root(9)d_same_name(9)__d_lookup_rcu(9)d_lookup(9)__d_lookup(9)d_hash_and_lookup(9)d_delete(9)d_rehash(9)d_add(9)d_ancestor(9)d_splice_alias(9)is_subdir(9)
like, she's got a whole friend group and they all slay in their own way πβ¨
the manual is givingKernel API Manualenergy, last updated back inOctober 2026, and she lives in the./fsdirectory like the queen she is π β iykyk π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms