From: "Michael S. Tsirkin" <mst@redhat.com>
To: rusty@rustcorp.com.au, virtualization@lists.linux-foundation.org
Subject: [PATCH 2/6] virtio_balloon: use virtqueue_xxx wrappers
Date: Mon, 12 Apr 2010 16:18:28 +0300 [thread overview]
Message-ID: <43367b72d188c910d6e1444c0c425ed508741dcd.1271078235.git.mst@redhat.com> (raw)
In-Reply-To: <cover.1271078235.git.mst@redhat.com>
Switch virtio_balloon to new virtqueue_xxx wrappers.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
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 3aed388..6caab1a 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -75,7 +75,7 @@ static void balloon_ack(struct virtqueue *vq)
struct virtio_balloon *vb;
unsigned int len;
- vb = vq->vq_ops->get_buf(vq, &len);
+ vb = virtqueue_get_buf(vq, &len);
if (vb)
complete(&vb->acked);
}
@@ -89,9 +89,9 @@ static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq)
init_completion(&vb->acked);
/* 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();
- vq->vq_ops->kick(vq);
+ virtqueue_kick(vq);
/* When host has read buffer, this completes via balloon_ack */
wait_for_completion(&vb->acked);
@@ -203,7 +203,7 @@ static void stats_request(struct virtqueue *vq)
struct virtio_balloon *vb;
unsigned int len;
- vb = vq->vq_ops->get_buf(vq, &len);
+ vb = virtqueue_get_buf(vq, &len);
if (!vb)
return;
vb->need_stats_update = 1;
@@ -220,9 +220,9 @@ static void stats_handle_request(struct virtio_balloon *vb)
vq = vb->stats_vq;
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();
- vq->vq_ops->kick(vq);
+ virtqueue_kick(vq);
}
static void virtballoon_changed(struct virtio_device *vdev)
@@ -313,10 +313,9 @@ static int virtballoon_probe(struct virtio_device *vdev)
* use it to signal us later.
*/
sg_init_one(&sg, vb->stats, sizeof vb->stats);
- if (vb->stats_vq->vq_ops->add_buf(vb->stats_vq,
- &sg, 1, 0, vb) < 0)
+ if (virtqueue_add_buf(vb->stats_vq, &sg, 1, 0, vb) < 0)
BUG();
- vb->stats_vq->vq_ops->kick(vb->stats_vq);
+ virtqueue_kick(vb->stats_vq);
}
vb->thread = kthread_run(balloon, vb, "vballoon");
--
1.7.0.2.280.gc6f05
next prev parent reply other threads:[~2010-04-12 13:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-12 13:18 [PATCH 0/6] virtio: virtqueue ops cleanup Michael S. Tsirkin
2010-04-12 13:18 ` [PATCH 1/6] virtio: add virtqueue_ vq_ops wrappers Michael S. Tsirkin
2010-04-12 13:18 ` Michael S. Tsirkin [this message]
2010-04-12 13:18 ` [PATCH 3/6] virtio_console: use virtqueue_xxx wrappers Michael S. Tsirkin
2010-04-12 13:18 ` [PATCH 4/6] virtio_blk: " Michael S. Tsirkin
2010-04-12 13:19 ` [PATCH 5/6] virtio_net: " Michael S. Tsirkin
2010-04-12 13:19 ` [PATCH 6/6] virtio_ring: remove a level of indirection Michael S. Tsirkin
2010-04-13 13:06 ` [PATCH 0/6] virtio: virtqueue ops cleanup Michael S. Tsirkin
2010-04-13 13:11 ` [PATCH] virtio-rng: use virtqueue_xxx wrappers Michael S. Tsirkin
2010-04-13 13:11 ` [PATCH] trans_virtio: " Michael S. Tsirkin
2010-04-20 9:10 ` Rusty Russell
2010-04-19 20:49 ` [PATCH 0/6] virtio: virtqueue ops cleanup Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=43367b72d188c910d6e1444c0c425ed508741dcd.1271078235.git.mst@redhat.com \
--to=mst@redhat.com \
--cc=rusty@rustcorp.com.au \
--cc=virtualization@lists.linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).