virtsnd_pcm_sg_from(9)
β¨ virtsnd_pcm_sg_from(9) β Kernel API Manual β¨
okay bestie, welcome to the virtsnd_pcm_sg_from page, part of the Kernel API Manual π she's a little function with a big job and honestly? she ate.
π NAME π
virtsnd_pcm_sg_from β build an sg-list from a vmalloc'ed buffer. that's it, that's the whole vibe β¨
π¦ SYNOPSIS π¦
void virtsnd_pcm_sg_from (struct scatterlist *sgs , int nsgs , u8 *data
, unsigned int length );
like, look at her. five lines. effortless. π
πΈ ARGUMENTS πΈ
sgsβ the preallocated sg-list you're gonna populate. it's already there, you're just filling it in, no cap π«Άnsgsβ the maximum number of elements in thesgs. respect the cap, bestie, it's literally the cap πdataβ pointer to avmalloc'ed buffer. vmalloc'ed, okay? don't come at her with anything else πlengthβ buffer size. the size. of the buffer. iconic of her honestly π
π₯ DESCRIPTION π₯
so what she does is: she splits the buffer into physically contiguous parts, and then she makes an sg-list out of those parts.
it's giving organizer energy β one big messy buffer goes in, one tidy sg-list comes out, and she doesn't even break a sweat π β¨
β CONTEXT β
Any context. literally any. she's flexible like that π§
π SEE ALSO π
kernel file ./sound/virtio/virtio_pcm_msg.c, plus the whole friend group:
struct virtio_pcm_msg(9)enum pcm_msg_sg_index(9)virtsnd_pcm_sg_num(9)virtsnd_pcm_msg_alloc(9)virtsnd_pcm_msg_free(9)virtsnd_pcm_msg_send(9)virtsnd_pcm_msg_pending_num(9)virtsnd_pcm_msg_complete(9)virtsnd_pcm_notify_cb(9)virtsnd_pcm_tx_notify_cb(9)virtsnd_pcm_rx_notify_cb(9)virtsnd_pcm_ctl_msg_alloc(9)
go read them all, iykyk π
ok that's the page!! mwah π
and before you go β this lil beauty lives in ./sound/virtio, dated October 2026, and yes she's virtsnd_pcm_sg_from(9) all over again at the bottom because she's consistent like that ππ bye bestie, slay your sg-lists πΈ
π¦ 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