d_drop(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… d_drop(9) β€” the Kernel API Manual, bestie edition

okay so this is d_drop from the kernel API manual, and honestly? she's a little icon of unhashing. let's get into it 🫢


✨ NAME ✨

d_drop β€” drop a dentry. that's it, that's the whole name. short, sweet, devastating πŸ’…


🌸 SYNOPSIS 🌸

void d_drop (struct dentry *dentry );

literally just call her with a dentry and she does the thing. no return value, no drama, void queen πŸ‘‘


πŸŽ€ ARGUMENTS πŸŽ€

  • dentry β€” the dentry you're dropping. this is the main character of the whole operation, so like... know which one you're passing in, bestie πŸ™ˆ

πŸ¦‹ DESCRIPTION πŸ¦‹

so what does d_drop actually do? she unhashes the entry from the parent dentry hashes, so that it won't be found through a VFS lookup any more. bye bye, searchability ✨

and ngl, this is different from deleting the dentry β€” don't get it twisted:

  • d_delete will try to mark the dentry negative if possible, giving a successful _negative_ lookup 😭
  • d_drop will just make the cache lookup fail πŸ’€

two very different vibes, okay? one is "yes she's here but she's negative," the other is "she's not in the cache at all, good luck finding her."

d_drop is used mainly for stuff that wants to invalidate a dentry for some reason β€” think NFS timeouts or autofs deletes. like when things get stale and you gotta let the cache know πŸ“

k now the important caveats, pay attention πŸ”₯ __d_drop requires dentry->d_lock ___d_drop doesn't mark dentry as "unhashed" β€” dentry->d_hash.pprev will be LIST_POISON2, not NULL. so if you're out here checking for NULL to figure out hashed-ness, that check will NOT slay the way you think it will πŸ’€

🌈 SEE ALSO 🌈

Kernel file ./fs/dcache.c β€” and here's the whole friend group, no cap, every single one:


and that's the page, bestie! go forth and unhash responsibly πŸ’œ

sign-off time πŸŽ€ β€” this one lives under ./fs, dated <italic>October 2026</italic>, and it's filed as d_drop(9). mwah, ily, see u in the next manpage ✨

πŸ“¦ where this page comes from