hash_for_each_safe(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

okay bestie, meet hash_for_each_safe β€” the one that helps you iterate over a hashtable safe against removal of hash entry. πŸ’… this is the hash_for_each_safe(9) page from the Kernel API Manual, and it's giving β€œremoval-safe loop, no cap.” 🫢

πŸŽ€ SYNOPSIS πŸŽ€

here's the exact spell, copy it character for character:

hash_for_each_safe (name , bkt , tmp , obj , member );

πŸ’… ARGUMENTS πŸ’…

  • name β€” the hashtable to iterate. slay, that's your table. ✨
  • bkt β€” an integer to use as bucket loop cursor. it keeps the bucket loop moving, iykyk. πŸ”₯
  • tmp β€” a struct used for temporary storage. literally the temp bestie holding space. πŸŽ€
  • obj β€” the type * to use as a loop cursor for each entry. main character loop cursor energy. πŸ‘‘
  • member β€” the name of the hlist_node within the struct. yes, that exact member. πŸ’–

πŸ¦‹ SEE ALSO πŸ¦‹

the kernel file is ./tools/include/linux/hashtable.h, and the whole friend group is right here:


mwah πŸ’‹ this little icon comes from ./tools/include/linux, dated October 2026, and it's literally hash_for_each_safe(9). periodt. πŸŒˆπŸ’–

πŸ“¦ where this page comes from