rht_for_each_entry(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 as
  • pos β€” the struct rhash_head to use as a loop cursor 🌸 the lowkey structural one that actually walks the chain
  • tbl β€” the struct bucket_table πŸͺ£ yeah the bucket table, that's her, that's the whole table you're digging through
  • hash β€” the hash value / bucket index πŸ”₯ which bucket you're in, iykyk
  • member β€” name of the struct rhash_head within 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:


πŸ’€ 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