提交 55c1c4ca 编写于 作者: D Dave Airlie 提交者: Sumit Semwal

dma-buf: pass flags into dma_buf_fd.

We need to pass the flags into dma_buf_fd at this point,
so the flags end up doing the right thing for O_CLOEXEC.
Signed-off-by: NDave Airlie <airlied@redhat.com>
Signed-off-by: NRob Clark <rob@ti.com>
Signed-off-by: NSumit Semwal <sumit.semwal@linaro.org>
上级 33ea2dcb
...@@ -107,17 +107,18 @@ EXPORT_SYMBOL_GPL(dma_buf_export); ...@@ -107,17 +107,18 @@ EXPORT_SYMBOL_GPL(dma_buf_export);
/** /**
* dma_buf_fd - returns a file descriptor for the given dma_buf * dma_buf_fd - returns a file descriptor for the given dma_buf
* @dmabuf: [in] pointer to dma_buf for which fd is required. * @dmabuf: [in] pointer to dma_buf for which fd is required.
* @flags: [in] flags to give to fd
* *
* On success, returns an associated 'fd'. Else, returns error. * On success, returns an associated 'fd'. Else, returns error.
*/ */
int dma_buf_fd(struct dma_buf *dmabuf) int dma_buf_fd(struct dma_buf *dmabuf, int flags)
{ {
int error, fd; int error, fd;
if (!dmabuf || !dmabuf->file) if (!dmabuf || !dmabuf->file)
return -EINVAL; return -EINVAL;
error = get_unused_fd(); error = get_unused_fd_flags(flags);
if (error < 0) if (error < 0)
return error; return error;
fd = error; fd = error;
......
...@@ -117,7 +117,7 @@ void dma_buf_detach(struct dma_buf *dmabuf, ...@@ -117,7 +117,7 @@ void dma_buf_detach(struct dma_buf *dmabuf,
struct dma_buf_attachment *dmabuf_attach); struct dma_buf_attachment *dmabuf_attach);
struct dma_buf *dma_buf_export(void *priv, const struct dma_buf_ops *ops, struct dma_buf *dma_buf_export(void *priv, const struct dma_buf_ops *ops,
size_t size, int flags); size_t size, int flags);
int dma_buf_fd(struct dma_buf *dmabuf); int dma_buf_fd(struct dma_buf *dmabuf, int flags);
struct dma_buf *dma_buf_get(int fd); struct dma_buf *dma_buf_get(int fd);
void dma_buf_put(struct dma_buf *dmabuf); void dma_buf_put(struct dma_buf *dmabuf);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册