summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Wang <jasowang@redhat.com>2025-08-21 14:46:37 +0800
committerMichael S. Tsirkin <mst@redhat.com>2025-10-01 07:24:43 -0400
commit201e52ffe3349396303f741d098a9d285c52f44e (patch)
tree3d89e147bb221f473b298d3b43d6d1a045144547
parentb16060c5c7d56455da3c3c50b4a20a83c2a30810 (diff)
virtio_ring: rename dma_handle to map_handle
Following patch will introduce virtio map operations which means the address is not necessarily used for DMA. Let's rename the dma_handle to map_handle first. Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Message-Id: <20250821064641.5025-6-jasowang@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Tested-by: Lei Yang <leiyang@redhat.com> Reviewed-by: Eugenio Pérez <eperezma@redhat.com>
-rw-r--r--drivers/virtio/virtio_ring.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index cda9bc2121bf..46515b017ccb 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -305,18 +305,18 @@ size_t virtio_max_dma_size(const struct virtio_device *vdev)
EXPORT_SYMBOL_GPL(virtio_max_dma_size);
static void *vring_alloc_queue(struct virtio_device *vdev, size_t size,
- dma_addr_t *dma_handle, gfp_t flag,
+ dma_addr_t *map_handle, gfp_t flag,
union virtio_map map)
{
if (vring_use_map_api(vdev)) {
return dma_alloc_coherent(map.dma_dev, size,
- dma_handle, flag);
+ map_handle, flag);
} else {
void *queue = alloc_pages_exact(PAGE_ALIGN(size), flag);
if (queue) {
phys_addr_t phys_addr = virt_to_phys(queue);
- *dma_handle = (dma_addr_t)phys_addr;
+ *map_handle = (dma_addr_t)phys_addr;
/*
* Sanity check: make sure we dind't truncate
@@ -329,7 +329,7 @@ static void *vring_alloc_queue(struct virtio_device *vdev, size_t size,
* warning and abort if we end up with an
* unrepresentable address.
*/
- if (WARN_ON_ONCE(*dma_handle != phys_addr)) {
+ if (WARN_ON_ONCE(*map_handle != phys_addr)) {
free_pages_exact(queue, PAGE_ALIGN(size));
return NULL;
}
@@ -339,11 +339,11 @@ static void *vring_alloc_queue(struct virtio_device *vdev, size_t size,
}
static void vring_free_queue(struct virtio_device *vdev, size_t size,
- void *queue, dma_addr_t dma_handle,
+ void *queue, dma_addr_t map_handle,
union virtio_map map)
{
if (vring_use_map_api(vdev))
- dma_free_coherent(map.dma_dev, size, queue, dma_handle);
+ dma_free_coherent(map.dma_dev, size, queue, map_handle);
else
free_pages_exact(queue, PAGE_ALIGN(size));
}