diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2010-04-12 09:18:28 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2010-05-19 08:45:41 -0400 |
commit | 946cfe0e05664543b22ed674fff3764f41a372c7 (patch) | |
tree | ecab9338ebd5eccf3befbf1325b3705cbf3bbc75 /drivers | |
parent | 316f25f5b3d547ce892d370f99f08a27276896ff (diff) |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/virtio/virtio_balloon.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index bfec7c29486..0f1da45ba47 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c | |||
@@ -75,7 +75,7 @@ static void balloon_ack(struct virtqueue *vq) | |||
75 | struct virtio_balloon *vb; | 75 | struct virtio_balloon *vb; |
76 | unsigned int len; | 76 | unsigned int len; |
77 | 77 | ||
78 | vb = vq->vq_ops->get_buf(vq, &len); | 78 | vb = virtqueue_get_buf(vq, &len); |
79 | if (vb) | 79 | if (vb) |
80 | complete(&vb->acked); | 80 | complete(&vb->acked); |
81 | } | 81 | } |
@@ -89,9 +89,9 @@ static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq) | |||
89 | init_completion(&vb->acked); | 89 | init_completion(&vb->acked); |
90 | 90 | ||
91 | /* We should always be able to add one buffer to an empty queue. */ | 91 | /* We should always be able to add one buffer to an empty queue. */ |
92 | if (vq->vq_ops->add_buf(vq, &sg, 1, 0, vb) < 0) | 92 | if (virtqueue_add_buf(vq, &sg, 1, 0, vb) < 0) |
93 | BUG(); | 93 | BUG(); |
94 | vq->vq_ops->kick(vq); | 94 | virtqueue_kick(vq); |
95 | 95 | ||
96 | /* When host has read buffer, this completes via balloon_ack */ | 96 | /* When host has read buffer, this completes via balloon_ack */ |
97 | wait_for_completion(&vb->acked); | 97 | wait_for_completion(&vb->acked); |
@@ -204,7 +204,7 @@ static void stats_request(struct virtqueue *vq) | |||
204 | struct virtio_balloon *vb; | 204 | struct virtio_balloon *vb; |
205 | unsigned int len; | 205 | unsigned int len; |
206 | 206 | ||
207 | vb = vq->vq_ops->get_buf(vq, &len); | 207 | vb = virtqueue_get_buf(vq, &len); |
208 | if (!vb) | 208 | if (!vb) |
209 | return; | 209 | return; |
210 | vb->need_stats_update = 1; | 210 | vb->need_stats_update = 1; |
@@ -221,9 +221,9 @@ static void stats_handle_request(struct virtio_balloon *vb) | |||
221 | 221 | ||
222 | vq = vb->stats_vq; | 222 | vq = vb->stats_vq; |
223 | sg_init_one(&sg, vb->stats, sizeof(vb->stats)); | 223 | sg_init_one(&sg, vb->stats, sizeof(vb->stats)); |
224 | if (vq->vq_ops->add_buf(vq, &sg, 1, 0, vb) < 0) | 224 | if (virtqueue_add_buf(vq, &sg, 1, 0, vb) < 0) |
225 | BUG(); | 225 | BUG(); |
226 | vq->vq_ops->kick(vq); | 226 | virtqueue_kick(vq); |
227 | } | 227 | } |
228 | 228 | ||
229 | static void virtballoon_changed(struct virtio_device *vdev) | 229 | static void virtballoon_changed(struct virtio_device *vdev) |
@@ -314,10 +314,9 @@ static int virtballoon_probe(struct virtio_device *vdev) | |||
314 | * use it to signal us later. | 314 | * use it to signal us later. |
315 | */ | 315 | */ |
316 | sg_init_one(&sg, vb->stats, sizeof vb->stats); | 316 | sg_init_one(&sg, vb->stats, sizeof vb->stats); |
317 | if (vb->stats_vq->vq_ops->add_buf(vb->stats_vq, | 317 | if (virtqueue_add_buf(vb->stats_vq, &sg, 1, 0, vb) < 0) |
318 | &sg, 1, 0, vb) < 0) | ||
319 | BUG(); | 318 | BUG(); |
320 | vb->stats_vq->vq_ops->kick(vb->stats_vq); | 319 | virtqueue_kick(vb->stats_vq); |
321 | } | 320 | } |
322 | 321 | ||
323 | vb->thread = kthread_run(balloon, vb, "vballoon"); | 322 | vb->thread = kthread_run(balloon, vb, "vballoon"); |