dma_buf_iter_next(9)
π dma_buf_iter_next β a Kernel API Manual moment
okay bestie, so this one is from the Kernel API Manual and honestly? it's a little baddie with a very specific job. it's dma_buf_iter_next(9), and it's here to help you keep the iteration going through the global list of all DMA buffers π
β¨ NAME β¨
dma_buf_iter_next β literally just: continue iteration through the global list of all DMA buffers π¦
π SYNOPSIS π
struct dma_buf * dma_buf_iter_next (struct dma_buf *dmabuf );
π ARGUMENTS π
dmabuf[in] β pointer todma_buf. that's the one, that's your girl π«Ά
πΈ DESCRIPTION πΈ
okay so here's the vibe: this decrements the reference count on the buffer you passed in π so like, she's done with that one, respectfully.
then it returns the next buffer from the remainder of the global list of DMA-bufs, and that one comes back with its reference count incremented β¨
and the way this is important β callers must release the reference, no cap. you do that either by continuing the iteration with dma_buf_iter_next, or by using dma_buf_put. periodt. don't just walk away from a refcount, that's not the energy we're bringing π
π₯ RETURN π₯
- Next buffer from the global list, with refcount elevated π
NULLif no additional active buffers are present β that's your "we're so done here" signal, and honestly? iconic πΈ
β SEE ALSO β
the kernel file is over at ./drivers/dma-buf/dma-buf.c and here's the whole squad, fr fr:
dma_buf_iter_begin(9)implicit fence polling(9)dma_buf_set_name(9)dma buf device access(9)dma_buf_export(9)dma_buf_fd(9)dma_buf_fd_install(9)dma_buf_get(9)dma_buf_put(9)locking convention(9)dma_buf_dynamic_attach(9)dma_buf_attach(9)dma_buf_detach(9)dma_buf_pin(9)dma_buf_unpin(9)dma_buf_map_attachment(9)dma_buf_map_attachment_unlocked(9)dma_buf_unmap_attachment(9)dma_buf_unmap_attachment_unlocked(9)dma_buf_attach_revocable(9)dma_buf_invalidate_mappings(9)cpu access(9)dma_buf_begin_cpu_access(9)dma_buf_end_cpu_access(9)dma_buf_mmap(9)dma_buf_vmap(9)dma_buf_vmap_unlocked(9)dma_buf_vunmap(9)dma_buf_vunmap_unlocked(9)
lowkey go readdma_buf_iter_begin(9)first if you haven't started iterating yet β you can'titer_nextif you never began, iykyk π
and that's the page, bestie π§ this little number lives in ./drivers/dma-buf, dated October 2026, and it's page dma_buf_iter_next(9) of the Kernel API Manual. slay, go release those references π
π
π¦ 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