OSDN Git Service

hw/virtio: Have virtqueue_get_avail_bytes() pass caches arg to callees
authorPhilippe Mathieu-Daudé <philmd@redhat.com>
Mon, 6 Sep 2021 10:43:18 +0000 (12:43 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 5 Oct 2021 15:19:40 +0000 (11:19 -0400)
commitd6ed27bae717ceac9de0c53a31389143846b8465
tree4f27cd9299a6636f9a1a5b43dbb740d5e614b8a0
parentab4dd2746c234f038206b3ccfe6bec1f19f98c24
hw/virtio: Have virtqueue_get_avail_bytes() pass caches arg to callees

Both virtqueue_packed_get_avail_bytes() and
virtqueue_split_get_avail_bytes() access the region cache, but
their caller also does. Simplify by having virtqueue_get_avail_bytes
calling both with RCU lock held, and passing the caches as argument.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20210906104318.1569967-4-philmd@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
hw/virtio/virtio.c