You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
dma-buf: replace dma_buf_export() with dma_buf_export_named()
For debugging purposes, it is useful to have a name-string added while exporting buffers. Hence, dma_buf_export() is replaced with dma_buf_export_named(), which additionally takes 'exp_name' as a parameter. For backward compatibility, and for lazy exporters who don't wish to name themselves, a #define dma_buf_export() is also made available, which adds a __FILE__ instead of 'exp_name'. Cc: Daniel Vetter <daniel.vetter@ffwll.ch> [Thanks for the idea!] Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
This commit is contained in:
@@ -52,14 +52,23 @@ The dma_buf buffer sharing API usage contains the following steps:
|
||||
associated with this buffer.
|
||||
|
||||
Interface:
|
||||
struct dma_buf *dma_buf_export(void *priv, struct dma_buf_ops *ops,
|
||||
size_t size, int flags)
|
||||
struct dma_buf *dma_buf_export_named(void *priv, struct dma_buf_ops *ops,
|
||||
size_t size, int flags,
|
||||
const char *exp_name)
|
||||
|
||||
If this succeeds, dma_buf_export allocates a dma_buf structure, and returns a
|
||||
pointer to the same. It also associates an anonymous file with this buffer,
|
||||
so it can be exported. On failure to allocate the dma_buf object, it returns
|
||||
NULL.
|
||||
|
||||
'exp_name' is the name of exporter - to facilitate information while
|
||||
debugging.
|
||||
|
||||
Exporting modules which do not wish to provide any specific name may use the
|
||||
helper define 'dma_buf_export()', with the same arguments as above, but
|
||||
without the last argument; a __FILE__ pre-processor directive will be
|
||||
inserted in place of 'exp_name' instead.
|
||||
|
||||
2. Userspace gets a handle to pass around to potential buffer-users
|
||||
|
||||
Userspace entity requests for a file-descriptor (fd) which is a handle to the
|
||||
|
||||
Reference in New Issue
Block a user