STRUCT DMA_BUF_ATTACH_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

struct dma_buf_attach_ops β€” importer operations for an attachment. ok so we're in the Kernel API Manual now, bestie, and this struct is literally the importer's whole attachment-ops vibe πŸ’…

✨ SYNOPSIS ✨

here's the exact shape, no cap:

struct dma_buf_attach_ops {
    bool allow_peer2peer;
    void (*invalidate_mappings)(struct dma_buf_attachment *attach);
};

πŸŽ€ Members πŸŽ€

  • allow_peer2peer β€” if this is set to true, the importer must be able to handle peer resources without struct pages. that's the whole rule, fr fr.
  • invalidate_mappings β€” [optional] notification that the DMA-buf is moving. if this callback is provided, the framework can avoid pinning the backing store while mappings exists. highkey useful 🫢
okay but the lock tea is important: this callback is called with the lock of the reservation object associated with the dma_buf held, and the mapping function must be called with this lock held as well. that's what makes sure no mapping is created concurrently with an ongoing move operation. no cap, this is the concurrency safety moment.

see the kdoc for dma_buf_invalidate_mappings for details on the required behavior.

πŸ¦‹ Description πŸ¦‹

attachment operations implemented by the importer. that's it, that's the description β€” importer-side attachment ops, periodt.

🌸 SEE ALSO 🌸


signing off from ./include/linux, October 2026 β€” go read the kdoc and slay πŸ’–βœ¨

πŸ“¦ where this page comes from