__d_lookup(9)
π
__d_lookup β the kernel API manual, bestie edition π¦
okay so welcome to the __d_lookup(9) page, straight out of the Kernel API Manual β this is the one about hunting down a dentry in a slightly unhinged, racy way π
β¨ NAME β¨
__d_lookup β search for a dentry (racy) π
β¨ SYNOPSIS β¨
struct dentry * __d_lookup (const struct dentry *parent , const struct
qstr *name );
like yes bestie, that's the whole signature, she's not complicated π
β¨ ARGUMENTS β¨
parentβ the parent dentry π (the one who birthed it, iconically)nameβ the qstr of the name we wish to find πΈ
β¨ RETURN β¨
a dentry, or NULL β that's it, that's the whole vibe check π«Ά
β¨ DESCRIPTION β¨
okay so __d_lookup is like d_lookup, but β and this is the messy part π β it may (rarely) return a false-negative result due to unrelated rename activity. not her fault, she's just built different.
she's slightly faster because she avoids the rename_lock read seqlock β‘ (skipping the lock is lowkey the whole appeal), but she must be used carefully, eg. with a following d_lookup in the case of failure. so like, she's the first-date version of the lookup β if it doesn't work out, you need the more committed one after π
__d_lookup callers must be commented. no cap, this is a hard requirement, write the comment bestie, future-you will thank you π
β¨ SEE ALSO β¨
Kernel file ./fs/dcache.c β and the whole dcache friend group, periodt:
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_add_ci(9), d_same_name(9), __d_lookup_rcu(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)
slay, that's the whole page π
β¨ ngl this one lives in ./fs and the version is October 2026 β so mark your calendar bestie, she's dated π bye, ily, go comment your callers π
π¦ 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