for_each_sgtable_page(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« for_each_sgtable_page(9) πŸ’«

okay bestie, welcome to the Kernel API Manual page for for_each_sgtable_page β€” yes that's a lot of underscores, no we're not gonna shorten it, it's iconic and it commits πŸ’…


✨ NAME ✨

for_each_sgtable_page β€” the little macro that iterates over all pages in the sg_table object πŸ¦‹


🌸 SYNOPSIS 🌸

for_each_sgtable_page (sgt , piter , pgoffset );

literally just three things and you're looping, periodt ✨


πŸŽ€ ARGUMENTS πŸŽ€

  • sgt β€” the sg_table object you're iterating over. the main character, fr fr πŸ‘‘
  • piter β€” the page iterator, holding the current page. think of it as the vibe tracker for where you're at rn 🧚
  • pgoffset β€” the starting page offset, measured in pages. not bytes, bestie, pages πŸ“„

🫢 DESCRIPTION 🫢

so here's the tea: this macro iterates over all the memory pages in the buffer that's described by a scatterlist, which is stored inside the sg_table object you passed in β˜•πŸ’–

see also for_each_sg_page if you're curious about the sibling.

and the important bit β€” in each loop it operates on a PAGE_SIZE unit. so every spin around the loop is exactly one page's worth, no cap πŸ”₯


πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./include/linux/scatterlist.h, plus this whole friend group of related man pages:

go read them all, i'll wait πŸ’œ


okay that's the whole page, you ate that πŸ“ β€” this one comes to you from ./include/linux, dated October 2026, and that's the vibe check complete. slay, bye! 🌈⭐

πŸ“¦ where this page comes from