d_add(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– d_add(9) β€” add dentry to hash queues πŸ’–

okay bestie, welcome to the Kernel API Manual, section d_add(9). this one's short and sweet β€” a little two-ingredient recipe for putting a dentry where the kernel can find it later. no cap, it's like the "file it in the right drawer" function of the dcache. πŸ—‚οΈβœ¨


🌸 NAME 🌸

d_add β€” add dentry to hash queues. that's it, that's the whole vibe. it hashes the dentry and blesses it with an inode. slay.


✨ SYNOPSIS ✨

void d_add (struct dentry *entry , struct inode *inode );

return type void, meaning it gives you nothing back and honestly? iconic. it just does the thing and leaves. πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • entry β€” the dentry you're adding, bestie. this is the dentry to add. she's the main character here. πŸ‘‘
  • inode β€” the inode to attach to this dentry. they're getting linked up, it's giving soulmate energy fr fr. 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

so what does it actually do? two things, and honestly they're both kind of a big deal:

  • it adds the entry to the hash queues, so future lookups can actually find her instead of wandering around lost 😭
  • it initializes inode β€” your inode argument gets attached to the dentry

and the little lore drop you need to know: the entry was actually filled in earlier during d_alloc. so by the time you get here, the dentry's already been built β€” you're not creating anything, you're just filing her. lowkey efficient. ⭐

not me emphasizing this: the filling-in already happened in d_alloc. d_add doesn't build the dentry, it just hashes it and hooks up the inode. don't come for me if you skip the d_alloc step, i warned you πŸ™ˆ

🌈 SEE ALSO 🌈

the whole friend group, in order, no one gets left out πŸ’œ:


and that's the page!! πŸŽ€ this lil gem comes to you from source ./fs, dated October 2026 β€” so yeah, mark your calendar bestie, future vibes only. go forth and hash those dentries, i'm literally obsessed with you πŸ’–βœ¨πŸ¦‹πŸŒΈπŸ«Ά

πŸ“¦ where this page comes from