rht_for_each_entry_safe(9)
β¨ NAME β¨
Okay so welcome to the rht_for_each_entry_safe(9) page in the Kernel API Manual, bestie. This one is your safe-iteration bestie for a hash chain of a given type: rht_for_each_entry_safe β safely iterate over hash chain of given type. That's literally the whole name, and it ate. π
π SYNOPSIS π
rht_for_each_entry_safe (tpos , pos , next , tbl , hash , member );
π ARGUMENTS π
tposβ thetype *to use as a loop cursor. Main character cursor energy. β¨posβ thestruct rhash_headto use as a loop cursor.nextβ thestruct rhash_headto use as next in loop cursor.tblβ thestruct bucket_table. The table in question, no cap. πͺ£hashβ the hash value / bucket index.memberβ name of thestruct rhash_headwithin the hashable struct.
π DESCRIPTION π
This hash chain list-traversal primitive is the one where the looped code is allowed to remove the loop cursor from the list. That's the safety bit, periodt β the code inside your loop can take the current cursor out of the list, and that's the whole point. π¦π₯
π SEE ALSO π
The whole linked-list-rhashtable squad, go off π:
- 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_from(9)rht_for_each_entry(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)
xoxo, source/version vibes: ./include/linux; date: October 2026; page: rht_for_each_entry_safe(9) β byeee π
β¨
π¦ 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