dma_resv_reserve_fences(9)
π dma_resv_reserve_fences(9) β Kernel API Manual, but make it make sense π
okay bestie, sit down, we're learning dma_resv_reserve_fences today and honestly? she's a prep girlie β you have to book the space before the party even starts π
β¨ NAME β¨
dma_resv_reserve_fences β literally just reserving space so you can add fences to a dma_resv object later. that's the whole vibe π¦
πΈ SYNOPSIS πΈ
int dma_resv_reserve_fences (struct dma_resv *obj , unsigned int num_fences );
like, she takes two things and returns an int. slay.
π ARGUMENTS π
objβ the reservation object. your main character, fr fr π«Άnum_fencesβ how many fences we wanna add. the headcount for the function π
π DESCRIPTION π
okay so the way this works: you call this before dma_resv_add_fence. not after, not during β before. it's giving "RSVP before the event," iykyk π
and you must be holding obj locked through dma_resv_lock when you call it. no lock, no service π
β οΈ important caveat bestie: ifobjgets unlocked at any point before you calldma_resv_add_fence, those preallocated slots have to be re-reserved. like, the reservation expires. this gets validated whenCONFIG_DEBUG_MUTEXESis enabled, so the kernel will catch you if you skip it π
RETURNS β 0 for success, or -errno if things went sideways π
π₯ SEE ALSO π₯
- Kernel file
./drivers/dma-buf/dma-resv.c(the source of truth, periodt) Reservation Object Overview(9)dma_resv_init(9)dma_resv_fini(9)dma_resv_reset_max_fences(9)dma_resv_add_fence(9)dma_resv_replace_fences(9)dma_resv_iter_first_unlocked(9)dma_resv_iter_next_unlocked(9)dma_resv_iter_first(9)dma_resv_iter_next(9)dma_resv_copy_fences(9)dma_resv_get_fences(9)dma_resv_get_singleton(9)dma_resv_wait_timeout(9)dma_resv_set_deadline(9)dma_resv_test_signaled(9)dma_resv_describe(9)
π§ catch you in ./drivers/dma-buf, dated October 2026 β brought to you by the Kernel API Manual, version dma_resv_reserve_fences(9). that's the tea, go reserve those fences πβ¨
π¦ 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