pack_sg_list_p(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 the sg_list to start at. like picking which page of the group chat you wanna scroll from πŸ“±
  • limit β€” the maximum number of pages in the sg list. hard cap, no cap fr 🚫
  • pdata β€” a list of pages to add into sg. 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 + count together are giving "start here, take this much." the first page gets skipped by offs, and count is 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:


lowkey reminder: this page only documents pack_sg_list_p itself. for the buffer-based twin, that's pack_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