pack_sg_list_p(9)
π pack_sg_list_p β bestie's guide to the 9p scatter/gather packer π
okay so this is pack_sg_list_p, and yeah it lives in section 9 of the kernel API manual, iykyk π§. The NAME says it all, but let me spell it out for you: it's just like pack_sg_list β except instead of handing it a buffer, you hand it a list of pages. that's the whole vibe. π¦
β¨ SYNOPSIS β¨
int pack_sg_list_p (struct scatterlist *sg , int start , int limit ,
struct page **pdata , int nr_pages , size_t offs , int count );
that's a lot of parameters bestie, but don't panic β we're gonna go through every single one. slay π
πΈ ARGUMENTS πΈ
sgβ the scatter/gather list you're packing into. the destination. the main character of this whole operation πstartβ which segment of thesg_listto start at. like picking which page of the group chat you wanna scroll from π±limitβ the maximum number of pages in thesglist. hard cap, no cap fr π«pdataβ a list of pages to add intosg. yes, actual pages. we're doing page errands today πnr_pagesβ number of pages to pack into the scatter/gather list. count 'em π’offsβ amount of data in the beginning of the first page that you do not to pack. that's a skip, not a bug β literally intentional πcountβ amount of data to pack into the scatter/gather list. the actual payload, the good stuff π
ngl,offs+counttogether are giving "start here, take this much." the first page gets skipped byoffs, andcountis how much data total actually goes in. keep those two straight and you're golden β¨
π₯ SEE ALSO π₯
the whole 9p virtio crew, all linked up, go say hi to them:
- Kernel file
./net/9p/trans_virtio.cβ the source file, the origin story π struct virtio_chan(9)p9_virtio_close(9)req_done(9)pack_sg_list(9)β the OG sibling function, go read this one too π―p9_virtio_request(9)p9_virtio_zc_request(9)p9_virtio_probe(9)p9_virtio_create(9)p9_virtio_remove(9)
lowkey reminder: this page only documentspack_sg_list_pitself. for the buffer-based twin, that'spack_sg_list(9)up there β same energy, different input π«
π and that's the whole page bestie! this one's filed under ./net/9p in the Kernel API Manual, dated October 2026 β screenshot it, cite it, live your truth. periodt π
π«Ά
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms