d_add_ci(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 🌈

like, she's got a whole friend group and they all slay in their own way πŸ’–βœ¨


the manual is giving Kernel API Manual energy, last updated back in October 2026, and she lives in the ./fs directory like the queen she is πŸ‘‘ β€” iykyk πŸ’…
πŸ“¦ where this page comes from