rhashtable_lookup(9)
β¨ 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 frparamsβ 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:
struct bucket_table(9)rht_grow_above_75(9)rht_shrink_below_30(9)rht_grow_above_100(9)rht_grow_above_max(9)rht_for_each_from(9)rht_for_each(9)rht_for_each_entry_from(9)rht_for_each_entry(9)rht_for_each_entry_safe(9)rht_for_each_rcu_from(9)rht_for_each_rcu(9)rht_for_each_entry_rcu_from(9)rht_for_each_entry_rcu(9)rhl_for_each_rcu(9)rhl_for_each_entry_rcu(9)rhashtable_lookup_fast(9)rhltable_lookup(9)rhashtable_insert_fast(9)rhltable_insert_key(9)rhltable_insert(9)rhashtable_lookup_insert_fast(9)rhashtable_lookup_get_insert_fast(9)rhashtable_lookup_insert_key(9)rhashtable_lookup_get_insert_key(9)rhashtable_remove_fast(9)rhltable_remove(9)rhashtable_replace_fast(9)rhltable_walk_enter(9)rhltable_free_and_destroy(9)
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
- 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