for_each_sgtable_dma_page(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ for_each_sgtable_dma_page ✨

okay so bestie, welcome to the Kernel API Manual β€” yes this is a real manual page, no cap, and it's about the cutest lil loop macro in the DMA-adjacent scatterlist cinematic universe πŸ¦‹


🌸 NAME 🌸

for_each_sgtable_dma_page β€” the one that iterates over the DMA mapped sg_table object πŸ’… like it literally just loops, that's the whole vibe


πŸŽ€ SYNOPSIS πŸŽ€

for_each_sgtable_dma_page (sgt , dma_iter , pgoffset );

that's it. three little args, iconic, ate, periodt ✨


πŸ’– ARGUMENTS πŸ’–

  • sgt β€” the sg_table object you're iterating over, main character energy, show it some respect 🫢
  • dma_iter β€” the DMA page iterator, and it's the one holding the current page, so like, it's carrying the whole loop honestly 😭
  • pgoffset β€” your starting page offset, measured in pages, not bytes, don't come at me with bytes πŸ™ˆ

πŸ”₯ DESCRIPTION πŸ”₯

So what it does: it iterates over all the DMA mapped pages in the buffer described by a scatterlist stored in the given sg_table object. all of them. every single one. no skipping πŸ’€

Also go peek at for_each_sg_dma_page while you're here β€” see also, bestie, it's giving sibling energy πŸ‘‘

And real talk, the important detail: in each loop it operates on PAGE_SIZE unit ⭐ so every step of the loop is one whole page, not a byte, not a nibble, a page. write that down πŸŽ€


🌈 SEE ALSO 🌈

Kernel file ./include/linux/scatterlist.h β€” and honestly the whole scatterlist friend group came to the function:

like that's the whole group chat, everyone showed up, obsessed πŸ’œ


okay mwah, that's the page!! this lil icon lives in ./include/linux (that's the source/version, cute right), dated October 2026, and it's brought to you by the for_each_sgtable_dma_page(9) girlies. bye bestie, go iterate responsibly πŸ§šβ€β™€οΈπŸ’–

πŸ“¦ where this page comes from