rht_for_each_entry(9)
π rht_for_each_entry(9)
okay so bestie, welcome to the Kernel API Manual β¨ β this is a kernel page, section 9, and it's literally all about looping over a hash chain like a boss π
β¨ NAME β¨
rht_for_each_entry β iterate over hash chain of given type π¦
literally just vibes through a chain of entries of whatever type you want, no cap π
β¨ SYNOPSIS β¨
rht_for_each_entry (tpos , pos , tbl , hash , member );
periodt. that's the whole signature, copy it exactly, don't be cute with it π
β¨ ARGUMENTS β¨
tposβ the type * to use as a loop cursor π«Ά she's the main character of your loop, the pointer that holds whatever struct type you're iterating asposβ thestruct rhash_headto use as a loop cursor πΈ the lowkey structural one that actually walks the chaintblβ thestruct bucket_tableπͺ£ yeah the bucket table, that's her, that's the whole table you're digging throughhashβ the hash value / bucket index π₯ which bucket you're in, iykykmemberβ name of thestruct rhash_headwithin the hashable struct π like the field name inside your struct that's the rhash_head, so the macro knows how to get from one to the other
π SEE ALSO π
bestie there are SO many siblings, it's giving huge family energy π the kernel file lives at ./include/linux/rhashtable.h and here's the whole crew:
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_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(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)
π quick reminder babe: all those numbers in parentheses are section 9 refs β read them, don't @ me
and that's the page!! π source lives in ./include/linux, dated October 2026, filed under rht_for_each_entry(9) β mwah π go iterate something gorgeous, bestie π
π¦ 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