virtqueue_a...uf_premapped(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– virtqueue_add_inbuf_premapped β€” Kernel API Manual, section 9 ✨

okay so bestie, we're in the <pink>Kernel API Manual</pink>, section 9, and today's main character is virtqueue_add_inbuf_premapped β€” she exposes input buffers to the other end. that's it, that's the vibe. πŸŽ€


✨ NAME ✨

virtqueue_add_inbuf_premapped β€” expose input buffers to other end πŸ’…


🌸 SYNOPSIS 🌸

int virtqueue_add_inbuf_premapped (struct virtqueue *vq , struct
scatterlist *sg , unsigned int num , void *data , void *ctx , gfp_t gfp
);

like, just look at her. six args, all iconic. πŸ”₯


πŸ¦‹ ARGUMENTS πŸ¦‹

  • vq β€” the struct virtqueue we're talking about. yes, that one, the virtqueue in question. πŸ‘‘
  • sg β€” the scatterlist. and ngl, it must be well-formed and terminated! this is not a drill, she is NOT flexible about this. 😭
  • num β€” the number of entries in sg that are writable by the other side. count them. fr. πŸ“
  • data β€” the token identifying the buffer. her little name tag πŸŽ€
  • ctx β€” extra context for the token. because the token deserves lore. ✨
  • gfp β€” how to do memory allocations (if necessary). that "if necessary" is doing a lot of heavy lifting, iykyk. πŸ’€

πŸ’œ DESCRIPTION πŸ’œ

okay so here's the thing, bestie β€” the caller must ensure we don't call this with other virtqueue operations at the same time (except where noted). it's giving "one thing at a time" energy. no parallel chaos. no cap. 🫢


🌈 RETURN 🌈

returns zero, or a negative error β€” ie. ENOSPC, ENOMEM, EIO. so like, zero = slay, negative = the vibe check failed. πŸ’…

bestie this is the part where you actually check the return value. i'm serious. πŸ™ˆ

⭐ SEE ALSO ⭐

start in the kernel file ./drivers/virtio/virtio_ring.c, then go meet the whole friend group:

like, the whole squad. go say hi. 🌸🧚


and that's the page, bestie!! this cute lil manual lives in ./drivers/virtio, and it's dated October 2026 β€” virtqueue_a...uf_premapped(9) out. mwah. πŸ’–βœ¨πŸŽ€πŸ¦‹
πŸ“¦ where this page comes from