diff options
author | 2025-05-22 23:04:26 +0000 | |
---|---|---|
committer | 2025-05-27 09:51:25 -0700 | |
commit | 76ea95534995adde1aa3cb1aa97ef33f50a617a9 (patch) | |
tree | 4105fd1476a851860c78c01ceed32daea16d8e28 /include | |
parent | dma-buf: Rename debugfs symbols (diff) | |
download | wireguard-linux-76ea95534995adde1aa3cb1aa97ef33f50a617a9.tar.xz wireguard-linux-76ea95534995adde1aa3cb1aa97ef33f50a617a9.zip |
bpf: Add dmabuf iterator
The dmabuf iterator traverses the list of all DMA buffers.
DMA buffers are refcounted through their associated struct file. A
reference is taken on each buffer as the list is iterated to ensure each
buffer persists for the duration of the bpf program execution without
holding the list mutex.
Signed-off-by: T.J. Mercier <tjmercier@google.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Acked-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20250522230429.941193-3-tjmercier@google.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/dma-buf.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/dma-buf.h b/include/linux/dma-buf.h index 8ff4add71f88..7af2ea839f58 100644 --- a/include/linux/dma-buf.h +++ b/include/linux/dma-buf.h @@ -634,4 +634,6 @@ int dma_buf_vmap(struct dma_buf *dmabuf, struct iosys_map *map); void dma_buf_vunmap(struct dma_buf *dmabuf, struct iosys_map *map); int dma_buf_vmap_unlocked(struct dma_buf *dmabuf, struct iosys_map *map); void dma_buf_vunmap_unlocked(struct dma_buf *dmabuf, struct iosys_map *map); +struct dma_buf *dma_buf_iter_begin(void); +struct dma_buf *dma_buf_iter_next(struct dma_buf *dmbuf); #endif /* __DMA_BUF_H__ */ |