aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/vhost/vhost.c
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2011-07-19 10:15:43 -0400
committerMichael S. Tsirkin <mst@redhat.com>2011-07-19 10:17:28 -0400
commitb834226b04d6fb51178a64e98872856986c71474 (patch)
tree61bc6a86691586b490210029aeb603969d97e399 /drivers/vhost/vhost.c
parent75fd9edc1054a1fa1d1411adec368dadf68e764e (diff)
vhost: optimize interrupt enable/disable
As we now only update used ring after enabling the backend, we can write flags with __put_user: as that's done on data path, it matters. Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/vhost/vhost.c')
-rw-r--r--drivers/vhost/vhost.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index c16d22545868..c14c42b95ab8 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -998,7 +998,7 @@ int vhost_log_write(struct vhost_virtqueue *vq, struct vhost_log *log,
998static int vhost_update_used_flags(struct vhost_virtqueue *vq) 998static int vhost_update_used_flags(struct vhost_virtqueue *vq)
999{ 999{
1000 void __user *used; 1000 void __user *used;
1001 if (put_user(vq->used_flags, &vq->used->flags) < 0) 1001 if (__put_user(vq->used_flags, &vq->used->flags) < 0)
1002 return -EFAULT; 1002 return -EFAULT;
1003 if (unlikely(vq->log_used)) { 1003 if (unlikely(vq->log_used)) {
1004 /* Make sure the flag is seen before log. */ 1004 /* Make sure the flag is seen before log. */
@@ -1016,7 +1016,7 @@ static int vhost_update_used_flags(struct vhost_virtqueue *vq)
1016 1016
1017static int vhost_update_avail_event(struct vhost_virtqueue *vq, u16 avail_event) 1017static int vhost_update_avail_event(struct vhost_virtqueue *vq, u16 avail_event)
1018{ 1018{
1019 if (put_user(vq->avail_idx, vhost_avail_event(vq))) 1019 if (__put_user(vq->avail_idx, vhost_avail_event(vq)))
1020 return -EFAULT; 1020 return -EFAULT;
1021 if (unlikely(vq->log_used)) { 1021 if (unlikely(vq->log_used)) {
1022 void __user *used; 1022 void __user *used;