get_dma_buf(9)
β¨ get_dma_buf(9) β¨
okay so this is a page from the Kernel API Manual, bestie β yes, the actual kernel API manual, we're in the big leagues now π
π NAME π
get_dma_buf β it's literally just a convenience wrapper for get_file. that's the whole vibe. short, sweet, does one thing π
π¦ SYNOPSIS π¦
void get_dma_buf (struct dma_buf *dmabuf );
likeβ¦ that's it. one function, one arg, no drama β¨
πΈ ARGUMENTS πΈ
dmabufβ [in] pointer todma_buf. that's the whole parameter list, she's low maintenance π«Ά
π DESCRIPTION π
okay so what does she actually do? get_dma_buf increments the reference count on the dma-buf. that's the entire job. refcount go up π
and why do we even need that? because some drivers need to create additional references to the dmabuf on the kernel side. that's the use case, no cap.
the example the page gives, fr fr: an exporter that needs to keep a dmabuf ptr so that subsequent exports don't create a new dmabuf. like, she's holding onto the pointer so the kernel doesn't go off and make a whole second dmabuf behind her back π iconic behavior honestly π
π§ SEE ALSO π§
- Kernel file
./include/linux/dma-buf.hβ go read it, iykyk π struct dma_buf_ops(9)struct dma_buf(9)struct dma_buf_attach_ops(9)struct dma_buf_attachment(9)struct dma_buf_export_info(9)DEFINE_DMA_BUF_EXPORT_INFO(9)dma_buf_is_dynamic(9)
that's the whole friend group right there β go say hi to all of them π
ngl, this one's a tiny page for a tiny function. refcount goes up, nothing else happens, and we respect that level of focus π―
and that's a wrap, bestie!! π this page lives in ./include/linux, dated October 2026, and it's filed under get_dma_buf(9) in case you ever need to find her again. mwah π π¦β¨
π¦ 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