__d_lookup_rcu(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 __d_lookup_rcu(9) β€” Kernel API Manual 🌸

okay so this is the manual for __d_lookup_rcu(9), and it’s giving lowkey legendary dentry-detective energy πŸ•΅οΈβ€β™€οΈπŸ’… buckle up bestie.


πŸ’– NAME πŸ’–

__d_lookup_rcu β€” search for a dentry (racy, store-free)


✨ SYNOPSIS ✨

struct dentry * __d_lookup_rcu (const struct dentry *parent , const
       struct qstr *name , unsigned *seqp );

πŸŽ€ ARGUMENTS πŸŽ€

  • parent β€” parent dentry πŸ‘‘
  • name β€” qstr of name we wish to find πŸ”Ž
  • seqp β€” returns d_seq value at the point where the dentry was found ✨

πŸ¦‹ RETURN πŸ¦‹

dentry, or NULL 😭 that’s the whole vibe check.


🌈 DESCRIPTION 🌈

__d_lookup_rcu is the dcache lookup function for rcu-walk name resolution (store-free path walking) design described in Documentation/filesystems/path-lookup.txt. πŸ“šβœ¨

This is not to be used outside core vfs. πŸ™…β€β™€οΈ no cap.

__d_lookup_rcu must only be used in rcu-walk mode, ie. with vfsmount lock held, and rcu_read_lock held. The returned dentry must not be stored into without taking d_lock and checking d_seq sequence count against seq returned here. πŸ”’

Alternatively, __d_lookup_rcu may be called again to look up the child of the returned dentry, so long as its parent's seqlock is checked after the child is looked up. Thus, an interlocking stepping of sequence lock checks is formed, giving integrity down the path walk. πŸ§šβ€β™€οΈ

NOTE! The caller has to check the resulting dentry against the sequence number we've returned before using any of the resulting dentry state! πŸ’€βš οΈ

🌟 SEE ALSO 🌟

Kernel file ./fs/dcache.c is the home base 🏠 β€” go hang with these:


okurrr that’s the page πŸ’…βœ¨ source/version is ./fs, it’s dated October 2026, and it’s all about __d_lookup_rcu(9) β€” periodt 🫢🌈

πŸ“¦ where this page comes from