diff options
author | David S. Miller <davem@davemloft.net> | 2005-07-08 17:57:23 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-07-08 17:57:23 -0400 |
commit | b03efcfb2180289718991bb984044ce6c5b7d1b0 (patch) | |
tree | f3b0c6c4eaf0991c28b7116a20994b48398eea57 /net/ipv4/tcp.c | |
parent | a92b7b80579fe68fe229892815c750f6652eb6a9 (diff) |
[NET]: Transform skb_queue_len() binary tests into skb_queue_empty()
This is part of the grand scheme to eliminate the qlen
member of skb_queue_head, and subsequently remove the
'list' member of sk_buff.
Most users of skb_queue_len() want to know if the queue is
empty or not, and that's trivially done with skb_queue_empty()
which doesn't use the skb_queue_head->qlen member and instead
uses the queue list emptyness as the test.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r-- | net/ipv4/tcp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 29894c749163..ddb6ce4ecff2 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -1105,7 +1105,7 @@ static void tcp_prequeue_process(struct sock *sk) | |||
1105 | struct sk_buff *skb; | 1105 | struct sk_buff *skb; |
1106 | struct tcp_sock *tp = tcp_sk(sk); | 1106 | struct tcp_sock *tp = tcp_sk(sk); |
1107 | 1107 | ||
1108 | NET_ADD_STATS_USER(LINUX_MIB_TCPPREQUEUED, skb_queue_len(&tp->ucopy.prequeue)); | 1108 | NET_INC_STATS_USER(LINUX_MIB_TCPPREQUEUED); |
1109 | 1109 | ||
1110 | /* RX process wants to run with disabled BHs, though it is not | 1110 | /* RX process wants to run with disabled BHs, though it is not |
1111 | * necessary */ | 1111 | * necessary */ |
@@ -1369,7 +1369,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
1369 | * is not empty. It is more elegant, but eats cycles, | 1369 | * is not empty. It is more elegant, but eats cycles, |
1370 | * unfortunately. | 1370 | * unfortunately. |
1371 | */ | 1371 | */ |
1372 | if (skb_queue_len(&tp->ucopy.prequeue)) | 1372 | if (!skb_queue_empty(&tp->ucopy.prequeue)) |
1373 | goto do_prequeue; | 1373 | goto do_prequeue; |
1374 | 1374 | ||
1375 | /* __ Set realtime policy in scheduler __ */ | 1375 | /* __ Set realtime policy in scheduler __ */ |
@@ -1394,7 +1394,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
1394 | } | 1394 | } |
1395 | 1395 | ||
1396 | if (tp->rcv_nxt == tp->copied_seq && | 1396 | if (tp->rcv_nxt == tp->copied_seq && |
1397 | skb_queue_len(&tp->ucopy.prequeue)) { | 1397 | !skb_queue_empty(&tp->ucopy.prequeue)) { |
1398 | do_prequeue: | 1398 | do_prequeue: |
1399 | tcp_prequeue_process(sk); | 1399 | tcp_prequeue_process(sk); |
1400 | 1400 | ||
@@ -1476,7 +1476,7 @@ skip_copy: | |||
1476 | } while (len > 0); | 1476 | } while (len > 0); |
1477 | 1477 | ||
1478 | if (user_recv) { | 1478 | if (user_recv) { |
1479 | if (skb_queue_len(&tp->ucopy.prequeue)) { | 1479 | if (!skb_queue_empty(&tp->ucopy.prequeue)) { |
1480 | int chunk; | 1480 | int chunk; |
1481 | 1481 | ||
1482 | tp->ucopy.len = copied > 0 ? len : 0; | 1482 | tp->ucopy.len = copied > 0 ? len : 0; |