rht_for_each_entry_from(9)
β¨ rht_for_each_entry_from(9) β¨
okay so bestie, welcome to rht_for_each_entry_from β it's a kernel macro from the rht_for_each_entry_from(9) corner of the Kernel API Manual and honestly it's giving "walk the hash chain, but start from a specific head" energy. π
πΈ NAME πΈ
rht_for_each_entry_from β iterate over hash chain from given head π¦
like literally, you point at a head and it loops you through the entries from there. no cap.
β¨ SYNOPSIS β¨
rht_for_each_entry_from (tpos , pos , head , tbl , hash , member );
yes that's the whole vibe. six args. she's a little wordy but she works. π
π ARGUMENTS π
tposβ the type * to use as a loop cursor. that's your main character pointer, the one you actually use inside the loop. πposβ thestruct rhash_headto use as a loop cursor. the lowkey plumbing cursor, also along for the ride. π«Άheadβ thestruct rhash_headto start from. this is the whole point of the macro β you begin here, not at the top of the chain. πtblβ thestruct bucket_table. your bucket table, iykyk. πͺ£hashβ the hash value / bucket index. which bucket we're poking around in. π’memberβ name of thestruct rhash_headwithin the hashable struct. like tell her which field is the embedded head so she can do the pointer math. π§
ngl, this is a macro, so all the usual "don't do weird stuff inside the loop body" energy applies. π«£
π¦ SEE ALSO π¦
the whole friend group shows up here, and we're listing every single one because they all ate:
- Kernel file
./include/linux/rhashtable.h 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(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)
like, the entire rhashtable extended universe. π
and that's the page, bestie!! π one last thing β this one comes to you from ./include/linux, dated October 2026, so jot that down in your notes app. mwah. πβ¨π¦πΈ
π¦ 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