for_each_zone_zonelist(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… for_each_zone_zonelist β€” kernel API manual, but make it make sense

okay so bestie, welcome to the for_each_zone_zonelist(9) page πŸŽ€ this is the little macro that walks you through every valid zone in a zonelist that sits at or below a zone index you pick. iconic behavior honestly.


✨ NAME ✨

for_each_zone_zonelist β€” the helper macro that iterates over the valid zones in a zonelist at or below a given zone index. she's a tour guide for your zonelist, no cap 🌸


✨ SYNOPSIS ✨

for_each_zone_zonelist (zone , z , zlist , highidx );

lowkey the whole thing is one line. the way that macro just Gets It done πŸ’…


🫢 ARGUMENTS 🫢

  • zone β€” the current zone in the iterator. this is your main character, the one you're actually looking at right now ✨
  • z β€” the current pointer within zonelist->zones that's being iterated. she's the one doing the pointing, respect her πŸ™ˆ
  • zlist β€” the zonelist being iterated. the whole vibe container, the guest list fr fr πŸŽ€
  • highidx β€” the zone index of the highest zone to return. basically the ceiling β€” anything above this does NOT get an invite to the party 🚫

πŸ”₯ DESCRIPTION πŸ”₯

so what does she actually do? this iterator iterates through all zones at or below a given zone index. that's it, that's the whole flex. every zone that makes the cut (i.e. sits at or below that highidx you handed over) gets visited, in order, no drama, no skipped steps 🌈

like… not to be dramatic but it's giving "organized little loop that could" and honestly? obsessed πŸ’–


🌟 SEE ALSO 🌟

go read these next, bestie, they're all in the same friend group:

iykyk, that's the whole crew right there πŸ‘‘


reminder queen: this is a macro, so the "arguments" are text-substituted at compile time. treat the names right and she'll treat you right 🧚

and that's the page! πŸ¦‹ brought to you from ./include/linux, dated October 2026 β€” mwah, go iterate something beautiful, bestie πŸ’œπŸ“

πŸ“¦ where this page comes from