diff options
author | David S. Miller <davem@davemloft.net> | 2010-12-14 14:33:23 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-14 14:33:23 -0500 |
commit | 9fe146aef44afe5ec677d8150b6ae94e09b773f7 (patch) | |
tree | 25342064d136f582e57c6c2ebf4ec62dc8c71576 /drivers/vhost/net.c | |
parent | 6389aa73ab8c15084fce18307a8e198eaff818da (diff) | |
parent | 4e53f78e5b06c073a5c10814c72e98c1ca8a9f10 (diff) |
Merge branch 'vhost-net-next' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
Diffstat (limited to 'drivers/vhost/net.c')
-rw-r--r-- | drivers/vhost/net.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index f442668a1e52..9b3ca103135f 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c | |||
@@ -10,7 +10,6 @@ | |||
10 | #include <linux/eventfd.h> | 10 | #include <linux/eventfd.h> |
11 | #include <linux/vhost.h> | 11 | #include <linux/vhost.h> |
12 | #include <linux/virtio_net.h> | 12 | #include <linux/virtio_net.h> |
13 | #include <linux/mmu_context.h> | ||
14 | #include <linux/miscdevice.h> | 13 | #include <linux/miscdevice.h> |
15 | #include <linux/module.h> | 14 | #include <linux/module.h> |
16 | #include <linux/mutex.h> | 15 | #include <linux/mutex.h> |
@@ -143,7 +142,6 @@ static void handle_tx(struct vhost_net *net) | |||
143 | return; | 142 | return; |
144 | } | 143 | } |
145 | 144 | ||
146 | use_mm(net->dev.mm); | ||
147 | mutex_lock(&vq->mutex); | 145 | mutex_lock(&vq->mutex); |
148 | vhost_disable_notify(vq); | 146 | vhost_disable_notify(vq); |
149 | 147 | ||
@@ -208,7 +206,6 @@ static void handle_tx(struct vhost_net *net) | |||
208 | } | 206 | } |
209 | 207 | ||
210 | mutex_unlock(&vq->mutex); | 208 | mutex_unlock(&vq->mutex); |
211 | unuse_mm(net->dev.mm); | ||
212 | } | 209 | } |
213 | 210 | ||
214 | static int peek_head_len(struct sock *sk) | 211 | static int peek_head_len(struct sock *sk) |
@@ -313,7 +310,6 @@ static void handle_rx_big(struct vhost_net *net) | |||
313 | if (!sock || skb_queue_empty(&sock->sk->sk_receive_queue)) | 310 | if (!sock || skb_queue_empty(&sock->sk->sk_receive_queue)) |
314 | return; | 311 | return; |
315 | 312 | ||
316 | use_mm(net->dev.mm); | ||
317 | mutex_lock(&vq->mutex); | 313 | mutex_lock(&vq->mutex); |
318 | vhost_disable_notify(vq); | 314 | vhost_disable_notify(vq); |
319 | hdr_size = vq->vhost_hlen; | 315 | hdr_size = vq->vhost_hlen; |
@@ -392,7 +388,6 @@ static void handle_rx_big(struct vhost_net *net) | |||
392 | } | 388 | } |
393 | 389 | ||
394 | mutex_unlock(&vq->mutex); | 390 | mutex_unlock(&vq->mutex); |
395 | unuse_mm(net->dev.mm); | ||
396 | } | 391 | } |
397 | 392 | ||
398 | /* Expects to be always run from workqueue - which acts as | 393 | /* Expects to be always run from workqueue - which acts as |
@@ -424,7 +419,6 @@ static void handle_rx_mergeable(struct vhost_net *net) | |||
424 | if (!sock || skb_queue_empty(&sock->sk->sk_receive_queue)) | 419 | if (!sock || skb_queue_empty(&sock->sk->sk_receive_queue)) |
425 | return; | 420 | return; |
426 | 421 | ||
427 | use_mm(net->dev.mm); | ||
428 | mutex_lock(&vq->mutex); | 422 | mutex_lock(&vq->mutex); |
429 | vhost_disable_notify(vq); | 423 | vhost_disable_notify(vq); |
430 | vhost_hlen = vq->vhost_hlen; | 424 | vhost_hlen = vq->vhost_hlen; |
@@ -459,7 +453,7 @@ static void handle_rx_mergeable(struct vhost_net *net) | |||
459 | move_iovec_hdr(vq->iov, vq->hdr, vhost_hlen, in); | 453 | move_iovec_hdr(vq->iov, vq->hdr, vhost_hlen, in); |
460 | else | 454 | else |
461 | /* Copy the header for use in VIRTIO_NET_F_MRG_RXBUF: | 455 | /* Copy the header for use in VIRTIO_NET_F_MRG_RXBUF: |
462 | * needed because sendmsg can modify msg_iov. */ | 456 | * needed because recvmsg can modify msg_iov. */ |
463 | copy_iovec_hdr(vq->iov, vq->hdr, sock_hlen, in); | 457 | copy_iovec_hdr(vq->iov, vq->hdr, sock_hlen, in); |
464 | msg.msg_iovlen = in; | 458 | msg.msg_iovlen = in; |
465 | err = sock->ops->recvmsg(NULL, sock, &msg, | 459 | err = sock->ops->recvmsg(NULL, sock, &msg, |
@@ -501,7 +495,6 @@ static void handle_rx_mergeable(struct vhost_net *net) | |||
501 | } | 495 | } |
502 | 496 | ||
503 | mutex_unlock(&vq->mutex); | 497 | mutex_unlock(&vq->mutex); |
504 | unuse_mm(net->dev.mm); | ||
505 | } | 498 | } |
506 | 499 | ||
507 | static void handle_rx(struct vhost_net *net) | 500 | static void handle_rx(struct vhost_net *net) |