summaryrefslogtreecommitdiff
path: root/drivers/vhost/vhost.h
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2020-05-27 16:15:52 +0200
committerLinus Walleij <linus.walleij@linaro.org>2020-05-27 16:15:52 +0200
commitce1d966a302229a88bcb4398a5ca76d657b06848 (patch)
tree812671d666fef8b5a955087cff5dc7b3cd555a35 /drivers/vhost/vhost.h
parentf8af9113b1cf71cd21b0a027d38b06c15989c789 (diff)
parent9cb1fd0efd195590b828b9b865421ad345a4a145 (diff)
Merge tag 'v5.7-rc7' into devel
Linux 5.7-rc7
Diffstat (limited to 'drivers/vhost/vhost.h')
-rw-r--r--drivers/vhost/vhost.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h
index 181382185bbc..f8403bd46b85 100644
--- a/drivers/vhost/vhost.h
+++ b/drivers/vhost/vhost.h
@@ -231,6 +231,33 @@ enum {
(1ULL << VIRTIO_F_VERSION_1)
};
+/**
+ * vhost_vq_set_backend - Set backend.
+ *
+ * @vq Virtqueue.
+ * @private_data The private data.
+ *
+ * Context: Need to call with vq->mutex acquired.
+ */
+static inline void vhost_vq_set_backend(struct vhost_virtqueue *vq,
+ void *private_data)
+{
+ vq->private_data = private_data;
+}
+
+/**
+ * vhost_vq_get_backend - Get backend.
+ *
+ * @vq Virtqueue.
+ *
+ * Context: Need to call with vq->mutex acquired.
+ * Return: Private data previously set with vhost_vq_set_backend.
+ */
+static inline void *vhost_vq_get_backend(struct vhost_virtqueue *vq)
+{
+ return vq->private_data;
+}
+
static inline bool vhost_has_feature(struct vhost_virtqueue *vq, int bit)
{
return vq->acked_features & (1ULL << bit);