__d_lookup(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… __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