Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Jason Wang and committed by
Michael S. Tsirkin
201e52ff b16060c5

+6 -6
+6 -6
drivers/virtio/virtio_ring.c
··· 305 305 EXPORT_SYMBOL_GPL(virtio_max_dma_size); 306 306 307 307 static void *vring_alloc_queue(struct virtio_device *vdev, size_t size, 308 - dma_addr_t *dma_handle, gfp_t flag, 308 + dma_addr_t *map_handle, gfp_t flag, 309 309 union virtio_map map) 310 310 { 311 311 if (vring_use_map_api(vdev)) { 312 312 return dma_alloc_coherent(map.dma_dev, size, 313 - dma_handle, flag); 313 + map_handle, flag); 314 314 } else { 315 315 void *queue = alloc_pages_exact(PAGE_ALIGN(size), flag); 316 316 317 317 if (queue) { 318 318 phys_addr_t phys_addr = virt_to_phys(queue); 319 - *dma_handle = (dma_addr_t)phys_addr; 319 + *map_handle = (dma_addr_t)phys_addr; 320 320 321 321 /* 322 322 * Sanity check: make sure we dind't truncate ··· 329 329 * warning and abort if we end up with an 330 330 * unrepresentable address. 331 331 */ 332 - if (WARN_ON_ONCE(*dma_handle != phys_addr)) { 332 + if (WARN_ON_ONCE(*map_handle != phys_addr)) { 333 333 free_pages_exact(queue, PAGE_ALIGN(size)); 334 334 return NULL; 335 335 } ··· 339 339 } 340 340 341 341 static void vring_free_queue(struct virtio_device *vdev, size_t size, 342 - void *queue, dma_addr_t dma_handle, 342 + void *queue, dma_addr_t map_handle, 343 343 union virtio_map map) 344 344 { 345 345 if (vring_use_map_api(vdev)) 346 - dma_free_coherent(map.dma_dev, size, queue, dma_handle); 346 + dma_free_coherent(map.dma_dev, size, queue, map_handle); 347 347 else 348 348 free_pages_exact(queue, PAGE_ALIGN(size)); 349 349 }