STRUCT VIRTIO_DMA_BUF_OPS(9)
β¨ struct virtio_dma_buf_ops β¨
okay bestie, so this is a page from the Kernel API Manual about struct virtio_dma_buf_ops β literally the operations you can do on an exported object dma-buf π
. Yes it's kernel-land, yes it's iconic, let's get into it π«Ά
πΈ NAME πΈ
struct virtio_dma_buf_ops β the operations possible on an exported object dma-buf. that's it, that's the whole vibe β¨
π¦ SYNOPSIS π¦
here's the struct, exactly as it lives, don't come for me about the indentation it's the kernel's fault π
struct virtio_dma_buf_ops {
struct dma_buf_ops ops;
int (*device_attach)(struct dma_buf *dma_buf, struct dma_buf_attachment *attach);
int (*get_uuid)(struct dma_buf *dma_buf, uuid_t *uuid);
};
π Members π
okay so there are three of them, and each one has very different energy:
opsβ this is the basedma_buf_ops, the foundation of the whole fit π. and listen, there's a rule here that is not optional:ops.attachMUST bevirtio_dma_buf_attach. like, that's not a suggestion, that's the law, no cap π₯device_attachβ [optional] callback, invoked byvirtio_dma_buf_attachduring all attach operations. so it's a little bonus hook that fires every single time something attaches β optional but lowkey a whole moment πget_uuidβ [required] callback to get the uuid of the exported object. required required, like you literally cannot skip this one bestie π«Ά
ngl, double-check thatops.attachline before you ship anything β messing that up is anot memoment waiting to happen π
π SEE ALSO π
Kernel file ./include/linux/virtio_dma_buf.h β go read it, it ate π
and that's the whole page, mwah π β signed, sealed, delivered from ./include/linux, October 2026, straight out of the Kernel API Manual, struct virtio_dma_buf_ops(9) era π§π
π¦ 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