Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 313911
b: refs/heads/master
c: ccf7e72
h: refs/heads/master
i:
  313909: 112d238
  313907: 16239f1
  313903: d8e8b52
v: v3
  • Loading branch information
Hong zhi guo authored and David S. Miller committed Jun 7, 2012
1 parent 10fce25 commit b562285
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e9939c80e9cb51f0da7d6e70838fd6c90248439f
refs/heads/master: ccf7e72b54253f926a35fdfa0366e0cb9ba72ffd
8 changes: 3 additions & 5 deletions trunk/drivers/net/macvtap.c
Original file line number Diff line number Diff line change
Expand Up @@ -847,13 +847,12 @@ static ssize_t macvtap_do_read(struct macvtap_queue *q, struct kiocb *iocb,
const struct iovec *iv, unsigned long len,
int noblock)
{
DECLARE_WAITQUEUE(wait, current);
DEFINE_WAIT(wait);
struct sk_buff *skb;
ssize_t ret = 0;

add_wait_queue(sk_sleep(&q->sk), &wait);
while (len) {
current->state = TASK_INTERRUPTIBLE;
prepare_to_wait(sk_sleep(&q->sk), &wait, TASK_INTERRUPTIBLE);

/* Read frames from the queue */
skb = skb_dequeue(&q->sk.sk_receive_queue);
Expand All @@ -875,8 +874,7 @@ static ssize_t macvtap_do_read(struct macvtap_queue *q, struct kiocb *iocb,
break;
}

current->state = TASK_RUNNING;
remove_wait_queue(sk_sleep(&q->sk), &wait);
finish_wait(sk_sleep(&q->sk), &wait);
return ret;
}

Expand Down

0 comments on commit b562285

Please sign in to comment.