list_for_eac...safe_reverse(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

ok so bestie, list_for_each_entry_safe_reverse β€” this is from the Kernel API Manual btw β€” it's the macro that walks your list backwards and does not freak out if something gets deleted mid-walk. safe against removal, backwards, iconic behaviour only.


✨ SYNOPSIS ✨

list_for_each_entry_safe_reverse (pos , n , head , member );

πŸŽ€ ARGUMENTS πŸŽ€

  • pos β€” the *type ** you use as the loop cursor. it's your little main character pointer, out here living its best life pointing at each entry as you go πŸ’…
  • n β€” another *type ** but this one's just temporary storage. the understudy. the backup dancer. it hangs onto the next thing so you don't lose your place 🫢
  • head β€” the head of your list. like, the literal starting node of the whole situation 🌸
  • member β€” the name of the list_head inside the struct. yes bestie, you gotta tell it where the list-ness lives πŸ¦‹

πŸ”₯ DESCRIPTION πŸ”₯

so basically: you iterate backwards over a list of the given type, and the whole thing is safe against removal of a list entry. like you can literally be out here deleting stuff as you go and it won't betray you. no cap. that's the whole vibe ✨


πŸ’œ SEE ALSO πŸ’œ

the kernel file lives at ./tools/include/linux/list.h β€” and here's the whole friend group, they all say hi πŸ‘‹


ok that's the whole page, mwah πŸ’‹ this one's coming at you from ./tools/include/linux and it's dated October 2026, page list_for_eac...safe_reverse(9) β€” yes the title is literally truncated with dots in the header, and we love her for that πŸ’€βœ¨ bye bestie, go reverse some lists responsibly πŸ§šβ€β™€οΈπŸ’–

πŸ“¦ where this page comes from