virtio_balloon: use virtqueue_xxx wrappers
Switch virtio_balloon to new virtqueue_xxx wrappers. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
316f25f5b3
commit
946cfe0e05
|
@ -75,7 +75,7 @@ static void balloon_ack(struct virtqueue *vq)
|
||||||
struct virtio_balloon *vb;
|
struct virtio_balloon *vb;
|
||||||
unsigned int len;
|
unsigned int len;
|
||||||
|
|
||||||
vb = vq->vq_ops->get_buf(vq, &len);
|
vb = virtqueue_get_buf(vq, &len);
|
||||||
if (vb)
|
if (vb)
|
||||||
complete(&vb->acked);
|
complete(&vb->acked);
|
||||||
}
|
}
|
||||||
|
@ -89,9 +89,9 @@ static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq)
|
||||||
init_completion(&vb->acked);
|
init_completion(&vb->acked);
|
||||||
|
|
||||||
/* We should always be able to add one buffer to an empty queue. */
|
/* We should always be able to add one buffer to an empty queue. */
|
||||||
if (vq->vq_ops->add_buf(vq, &sg, 1, 0, vb) < 0)
|
if (virtqueue_add_buf(vq, &sg, 1, 0, vb) < 0)
|
||||||
BUG();
|
BUG();
|
||||||
vq->vq_ops->kick(vq);
|
virtqueue_kick(vq);
|
||||||
|
|
||||||
/* When host has read buffer, this completes via balloon_ack */
|
/* When host has read buffer, this completes via balloon_ack */
|
||||||
wait_for_completion(&vb->acked);
|
wait_for_completion(&vb->acked);
|
||||||
|
@ -204,7 +204,7 @@ static void stats_request(struct virtqueue *vq)
|
||||||
struct virtio_balloon *vb;
|
struct virtio_balloon *vb;
|
||||||
unsigned int len;
|
unsigned int len;
|
||||||
|
|
||||||
vb = vq->vq_ops->get_buf(vq, &len);
|
vb = virtqueue_get_buf(vq, &len);
|
||||||
if (!vb)
|
if (!vb)
|
||||||
return;
|
return;
|
||||||
vb->need_stats_update = 1;
|
vb->need_stats_update = 1;
|
||||||
|
@ -221,9 +221,9 @@ static void stats_handle_request(struct virtio_balloon *vb)
|
||||||
|
|
||||||
vq = vb->stats_vq;
|
vq = vb->stats_vq;
|
||||||
sg_init_one(&sg, vb->stats, sizeof(vb->stats));
|
sg_init_one(&sg, vb->stats, sizeof(vb->stats));
|
||||||
if (vq->vq_ops->add_buf(vq, &sg, 1, 0, vb) < 0)
|
if (virtqueue_add_buf(vq, &sg, 1, 0, vb) < 0)
|
||||||
BUG();
|
BUG();
|
||||||
vq->vq_ops->kick(vq);
|
virtqueue_kick(vq);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void virtballoon_changed(struct virtio_device *vdev)
|
static void virtballoon_changed(struct virtio_device *vdev)
|
||||||
|
@ -314,10 +314,9 @@ static int virtballoon_probe(struct virtio_device *vdev)
|
||||||
* use it to signal us later.
|
* use it to signal us later.
|
||||||
*/
|
*/
|
||||||
sg_init_one(&sg, vb->stats, sizeof vb->stats);
|
sg_init_one(&sg, vb->stats, sizeof vb->stats);
|
||||||
if (vb->stats_vq->vq_ops->add_buf(vb->stats_vq,
|
if (virtqueue_add_buf(vb->stats_vq, &sg, 1, 0, vb) < 0)
|
||||||
&sg, 1, 0, vb) < 0)
|
|
||||||
BUG();
|
BUG();
|
||||||
vb->stats_vq->vq_ops->kick(vb->stats_vq);
|
virtqueue_kick(vb->stats_vq);
|
||||||
}
|
}
|
||||||
|
|
||||||
vb->thread = kthread_run(balloon, vb, "vballoon");
|
vb->thread = kthread_run(balloon, vb, "vballoon");
|
||||||
|
|
Loading…
Reference in New Issue