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

Reply via email to