Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 162922
b: refs/heads/master
c: bf95d20
h: refs/heads/master
v: v3
  • Loading branch information
Hendrik Brueckner authored and David S. Miller committed Sep 17, 2009
1 parent d3618f6 commit 00cbfa1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 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: 7514bab04e567c9408fe0facbde4277f09d5eb74
refs/heads/master: bf95d20fdbd602d72c28a009a55d90d5109b8a86
16 changes: 14 additions & 2 deletions trunk/net/iucv/af_iucv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,10 @@ static int iucv_sock_sendmsg(struct kiocb *iocb, struct socket *sock,
return err;
}

/* iucv_fragment_skb() - Fragment a single IUCV message into multiple skb's
*
* Locking: must be called with message_q.lock held
*/
static int iucv_fragment_skb(struct sock *sk, struct sk_buff *skb, int len)
{
int dataleft, size, copied = 0;
Expand Down Expand Up @@ -1070,6 +1074,10 @@ static int iucv_fragment_skb(struct sock *sk, struct sk_buff *skb, int len)
return 0;
}

/* iucv_process_message() - Receive a single outstanding IUCV message
*
* Locking: must be called with message_q.lock held
*/
static void iucv_process_message(struct sock *sk, struct sk_buff *skb,
struct iucv_path *path,
struct iucv_message *msg)
Expand Down Expand Up @@ -1120,6 +1128,10 @@ static void iucv_process_message(struct sock *sk, struct sk_buff *skb,
skb_queue_head(&iucv_sk(sk)->backlog_skb_q, skb);
}

/* iucv_process_message_q() - Process outstanding IUCV messages
*
* Locking: must be called with message_q.lock held
*/
static void iucv_process_message_q(struct sock *sk)
{
struct iucv_sock *iucv = iucv_sk(sk);
Expand Down Expand Up @@ -1210,6 +1222,7 @@ static int iucv_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
kfree_skb(skb);

/* Queue backlog skbs */
spin_lock_bh(&iucv->message_q.lock);
rskb = skb_dequeue(&iucv->backlog_skb_q);
while (rskb) {
if (sock_queue_rcv_skb(sk, rskb)) {
Expand All @@ -1221,11 +1234,10 @@ static int iucv_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
}
}
if (skb_queue_empty(&iucv->backlog_skb_q)) {
spin_lock_bh(&iucv->message_q.lock);
if (!list_empty(&iucv->message_q.list))
iucv_process_message_q(sk);
spin_unlock_bh(&iucv->message_q.lock);
}
spin_unlock_bh(&iucv->message_q.lock);
}

done:
Expand Down

0 comments on commit 00cbfa1

Please sign in to comment.