dma_buf_iter_next(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 to dma_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 πŸ’…
  • NULL if 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:

lowkey go read dma_buf_iter_begin(9) first if you haven't started iterating yet β€” you can't iter_next if 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