rhashtable_lookup(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ rhashtable_lookup β€” search hash table ✨

okay so real talk, this one's from the Kernel API Manual and it's basically the "where's my thing" function of the rhashtable world πŸ’…

🌸 SYNOPSIS 🌸

void * rhashtable_lookup (struct rhashtable *ht , const void *key ,
const struct rhashtable_params params );

like, yes, that's the whole vibe πŸŽ€

πŸ’– ARGUMENTS πŸ’–

  • ht β€” the hash table you're rummaging through, bestie πŸ”
  • key β€” the pointer to the key you're hunting for, fr fr
  • params β€” the hash table parameters, aka the settings that tell it how to behave πŸ’«

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea β˜• β€” rhashtable_lookup computes the hash value for the key, then walks the bucket chain looking for an entry with an identical key. The first matching entry gets returned. That's it. That's the whole plot 🎬

⚠️ not me forgetting the important part β€” this must only be called under the RCU read lock. Like, that's not optional, that's not a suggestion, that's the rule. periodt πŸ’€

And what does it actually hand back? Returns the first entry on which the compare function returned true. Simple as that, no cap ✨


🧚 SEE ALSO 🧚

okay so here's the whole friend group 😭 β€” the Kernel file ./include/linux/rhashtable.h plus a truly iconic roster:


and that's the page, bestie 🫢 this one lives under ./include/linux, dated October 2026, and it's the rhashtable_lookup(9) manual page β€” go forth and look things up responsibly under that RCU read lock πŸ’œ

πŸ“¦ where this page comes from