[Linaro-mm-sig] [RFC] dma-shared-buf: Add buffer sharing framework

Clark, Rob rob at ti.com
Thu Aug 25 01:03:26 UTC 2011


On Wed, Aug 10, 2011 at 7:11 AM, Sumit Semwal <sumit.semwal at ti.com> wrote:
>
> +/**
> + * struct dma_buf - shared buffer object
> + * @file: file pointer used for sharing buffers across, and for refcounting.
> + * @ops: dma_buf_ops associated with this buffer object
> + * @priv: user specific private data
> + */
> +struct dma_buf {
> +       struct file *file;
> +       struct dma_buf_ops *ops;
> +       void *priv;
> +};
> +

hmm, I wonder if we should stuff a ptr in there to store the creating
driver (or device?) ptr?  This way if it somehow gets passed back to
the creating driver, it could realize that it is a dma_buf that it
created in the first place.. and that it was safe to cast and deref
the priv ptr.

BR,
-R



More information about the Linaro-mm-sig mailing list