rht_for_each_from(9)
π rht_for_each_from(9) β the Kernel API Manual, bestie edition
okay so picture this: you're deep in the Linux kernel, you've got a hash chain, and you don't wanna start from the top like a rookie. You wanna start from a specific head. That's literally this macro. It's the rht_for_each_from girlies' moment and she ate. β¨
No cap, this is a loop macro β you give it a cursor, a starting point, a bucket table and a hash value, and it walks the chain for you. Group-chat energy: "we're iterating, we're iterating, we're done." π¦
β¨ SYNOPSIS β¨
rht_for_each_from (pos , head , tbl , hash );
π ARGUMENTS π
posβ thestruct rhash_headyou're using as your loop cursor. She's the main character of the loop, the one that moves. πheadβ thestruct rhash_headto start from. Like, you're not starting at the beginning bestie, you're starting here. πtblβ thestruct bucket_table. The whole vibe container, iykyk. πͺ£hashβ the hash value / bucket index. That's your little map coordinate in the table. π₯
π SEE ALSO π
okay this is the part where we tag everyone in the group chat, and there are so many of you, and I love that for us. Go read these when you're done here:
- the 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(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(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)
lowkey important: that SEE ALSO list is long for a reason β it's the whole rhashtable friend group. Don't skip them, they're iconic. π
π sign-off time: this absolute banger lives in ./include/linux, and it's dated October 2026. Manual page name is rht_for_each_from(9), part of the Kernel API Manual. slay, go iterate something. ππ«ΆπΈ
π¦ 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