STRUCT DMA_BUF_ATTACH_OPS(9)
π 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 totrue, the importer must be able to handle peer resources withoutstruct 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 πΈ
- Kernel file:
./include/linux/dma-buf.h struct dma_buf_ops(9)struct dma_buf(9)struct dma_buf_attachment(9)struct dma_buf_export_info(9)DEFINE_DMA_BUF_EXPORT_INFO(9)get_dma_buf(9)dma_buf_is_dynamic(9)
signing off from ./include/linux, October 2026 β go read the kdoc and slay πβ¨
π¦ 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