virtqueue_ad...uf_premapped(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… virtqueue_ad...uf_premapped(9) β€” from the Kernel API Manual, bestie ✨

okay so picture this: you're deep in kernel land, you've got a struct virtqueue, and you want the other side to be able to see some output buffers. That's it. That's the whole gig. Welcome to virtqueue_add_outbuf_premapped, my love 🫢


🌸 NAME 🌸

virtqueue_add_outbuf_premapped β€” expose output buffers to other end


✨ SYNOPSIS ✨

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

πŸŽ€ ARGUMENTS πŸŽ€

  • vq β€” the struct virtqueue we're talking about. the main character, basically πŸ‘‘
  • sg β€” the scatterlist. and bestie, it must be well-formed and terminated! no cap, this is not optional πŸ’€
  • num β€” the number of entries in sg that are readable by the other side.
  • data β€” the token identifying the buffer. your little name tag for it 🏷️
  • gfp β€” how to do memory allocations (if necessary). iykyk 🌈

πŸ’– DESCRIPTION πŸ’–

Caller must ensure we don't call this with other virtqueue operations at the same time (except where noted).

fr fr, read that again. it's giving "one at a time, queen." no overlapping virtqueue ops unless the docs explicitly say otherwise πŸ™ˆ

πŸ”₯ RETURN πŸ”₯

Returns zero or a negative error (ie. ENOSPC, ENOMEM, EIO).

so: 0 = slayed ✨, negative = it's giving struggle 😭


πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./drivers/virtio/virtio_ring.c, plus the whole friend group:


and that's the whole page, bestie πŸŒˆπŸ’œ live from ./drivers/virtio, dated October 2026, courtesy of the Kernel API Manual β€” go forth and map those buffers responsibly πŸ§šβ€β™€οΈβ­

πŸ“¦ where this page comes from