dma_buf_iter_begin(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ dma_buf_iter_begin(9) ✨

okay so bestie, welcome to the Kernel API Manual entry for dma_buf_iter_begin β€” and yes, this is a function name, not a weird TikTok sound πŸ’…


🌸 NAME 🌸

dma_buf_iter_begin β€” your official start-the-tour button for the global list of all DMA buffers πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

struct dma_buf * dma_buf_iter_begin (void );

πŸ’œ ARGUMENTS πŸ’œ

  • void β€” literally no arguments. nothing. zero. she takes nothing and she serves 🫢

✨ DESCRIPTION ✨

Okay so here's the vibe: this function hands you back the first buffer in the global list of DMA-bufs that's not in the process of being destroyed. Like, she's scanning the whole list and she skips past the ones that are mid-glow-down ✨🚫

When she finds one, she increments that buffer's reference count to prevent buffer destruction β€” protecting her new fave from getting deleted while you're still looking at it πŸ˜­πŸ’–

Important, no cap: callers must release the reference. You do that either by continuing iteration with dma_buf_iter_next, or with dma_buf_put. don't just walk away and leave the refcount hanging, that's rude and also a bug πŸ™ˆ


πŸ”₯ RETURN πŸ”₯

  • First buffer from global list, with refcount elevated πŸ‘‘ (she's protected now, bestie)
  • NULL if no active buffers are present πŸ’€ (empty list, nothing to see, go home)

🌈 SEE ALSO 🌈

Kernel file ./drivers/dma-buf/dma-buf.c β€” plus the whole friend group, and we love them all:


okay that's the whole page, go be iconic with your iterator πŸ§šπŸ’«

sign-off time: this one lives in ./drivers/dma-buf, dated October 2026, and it's the dma_buf_iter_begin(9) page β€” mwah πŸ’‹πŸ“

πŸ“¦ where this page comes from