get_dma_buf(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 to dma_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