[PATCH v7 06/13] nvme-pci: implement dma-buf backed requests
Pavel Begunkov
asml.silence at gmail.com
Mon Oct 5 04:45:40 PDT 2026
On 10/5/26 10:15, Christoph Hellwig wrote:
> On Mon, Sep 28, 2026 at 02:32:22PM +0100, Pavel Begunkov wrote:
>> +static void nvme_dmabuf_map_sync_for_cpu(struct nvme_dev *nvme_dev,
>> + struct request *req)
>> +{
>> + struct device *dev = nvme_dev->dev;
>> + enum dma_data_direction dma_dir;
>> + struct bio *bio = req->bio;
>> + struct nvme_dmabuf_map *map = to_nvme_dmabuf_map(bio->bi_dmabuf_map);
>> +
>> + dma_dir = rq_data_dir(req) == READ ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
>> + dma_sync_sgtable_for_cpu(dev, map->sgt, dma_dir);
>
> This can use rq_dma_dir in the argument. Same for the other DMA API
> calls.
Will change
> Btw, given how larger the dmabuf code is now, have you considered
> splitting it into a new nvme-pci-dmabuf.c file?
Let me see
--
Pavel Begunkov
More information about the Linux-nvme
mailing list