[PATCH v3 01/10] file: add callback for creating long-term dmabuf maps

Christian König christian.koenig at amd.com
Wed Apr 29 23:03:47 PDT 2026


On 4/29/26 17:25, Pavel Begunkov wrote:
> Introduce a new file callback that allows creating long-term dma
> mapping. All necessary information together with a dmabuf will be passed
> in the second argument of type struct io_dmabuf_token, which will be
> defined in following patches.

Well first of all the naming is probably not the best. Maybe rather call that dma-buf attachment or context or mappping.

Then the patch should probably define the full interface and not just add the callback here and then the structure in a follow up patch.

Regards,
Christian.

> 
> Signed-off-by: Pavel Begunkov <asml.silence at gmail.com>
> ---
>  include/linux/fs.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index b5b01bb22d12..c5558aab4628 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -1920,6 +1920,7 @@ struct dir_context {
>  
>  struct io_uring_cmd;
>  struct offset_ctx;
> +struct io_dmabuf_token;
>  
>  typedef unsigned int __bitwise fop_flags_t;
>  
> @@ -1967,6 +1968,7 @@ struct file_operations {
>  	int (*uring_cmd_iopoll)(struct io_uring_cmd *, struct io_comp_batch *,
>  				unsigned int poll_flags);
>  	int (*mmap_prepare)(struct vm_area_desc *);
> +	int (*create_dmabuf_token)(struct file *, struct io_dmabuf_token *);
>  } __randomize_layout;
>  
>  /* Supports async buffered reads */




More information about the Linux-nvme mailing list