d_drop(9)
π 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_deletewill try to mark the dentry negative if possible, giving a successful _negative_ lookup πd_dropwill 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_droprequiresdentry->d_lock___d_dropdoesn't mark dentry as "unhashed" βdentry->d_hash.pprevwill beLIST_POISON2, notNULL. so if you're out here checking forNULLto 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:
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_add_ci(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)
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
- 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