From: "Michael S. Tsirkin" <mst@redhat.com>
To: rusty@rustcorp.com.au, virtualization@lists.linux-foundation.org
Subject: [PATCH 1/6] virtio: add virtqueue_ vq_ops wrappers
Date: Mon, 12 Apr 2010 16:18:25 +0300 [thread overview]
Message-ID: <2232ad0aeff2a3ca62ed8dfa114e5be5436c95d9.1271078235.git.mst@redhat.com> (raw)
In-Reply-To: <cover.1271078235.git.mst@redhat.com>
Add inline functions that wrap vq->vq_ops-> calls
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
include/linux/virtio.h | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index 40d1709..18ccc68 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -77,6 +77,40 @@ struct virtqueue_ops {
void *(*detach_unused_buf)(struct virtqueue *vq);
};
+static inline int virtqueue_add_buf(struct virtqueue *vq,
+ struct scatterlist sg[],
+ unsigned int out_num,
+ unsigned int in_num,
+ void *data)
+{
+ return vq->vq_ops->add_buf(vq, sg, out_num, in_num, data);
+}
+
+static inline int void virtqueue_kick(struct virtqueue *vq)
+{
+ return vq->vq_ops->kick(vq);
+}
+
+static inline void *virtqueue_get_buf(struct virtqueue *vq, unsigned int *len)
+{
+ return vq->vq_ops->get_buf(vq, len);
+}
+
+static inline void virtqueue_disable_cb(struct virtqueue *vq)
+{
+ vq->vq_ops->disable_cb(vq);
+}
+
+static inline bool virtqueue_enable_cb(struct virtqueue *vq)
+{
+ return vq->vq_ops->enable_cb(vq);
+}
+
+static inline void *virtqueue_detach_unused_buf(struct virtqueue *vq)
+{
+ return vq->vq_ops->detach_unused_buf(vq);
+}
+
/**
* virtio_device - representation of a device using virtio
* @index: unique position on the virtio bus
--
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 ` Michael S. Tsirkin [this message]
2010-04-12 13:18 ` [PATCH 2/6] virtio_balloon: use virtqueue_xxx wrappers Michael S. Tsirkin
2010-04-12 13:18 ` [PATCH 3/6] virtio_console: " 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=2232ad0aeff2a3ca62ed8dfa114e5be5436c95d9.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).