Commit 058dc334 authored by Ilpo Järvinen's avatar Ilpo Järvinen Committed by David S. Miller

[TCP]: reduce tcp_output's indentation levels a bit

Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4828e7f4
......@@ -1673,13 +1673,18 @@ static void tcp_retrans_try_collapse(struct sock *sk, struct sk_buff *skb, int m
{
struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *next_skb = tcp_write_queue_next(sk, skb);
int skb_size, next_skb_size;
u16 flags;
/* The first test we must make is that neither of these two
* SKB's are still referenced by someone else.
*/
if (!skb_cloned(skb) && !skb_cloned(next_skb)) {
int skb_size = skb->len, next_skb_size = next_skb->len;
u16 flags = TCP_SKB_CB(skb)->flags;
if (skb_cloned(skb) || skb_cloned(next_skb))
return;
skb_size = skb->len;
next_skb_size = next_skb->len;
flags = TCP_SKB_CB(skb)->flags;
/* Also punt if next skb has been SACK'd. */
if (TCP_SKB_CB(next_skb)->sacked & TCPCB_SACKED_ACKED)
......@@ -1697,16 +1702,14 @@ static void tcp_retrans_try_collapse(struct sock *sk, struct sk_buff *skb, int m
((skb_size + next_skb_size) > mss_now))
return;
BUG_ON(tcp_skb_pcount(skb) != 1 ||
tcp_skb_pcount(next_skb) != 1);
BUG_ON(tcp_skb_pcount(skb) != 1 || tcp_skb_pcount(next_skb) != 1);
tcp_highest_sack_combine(sk, next_skb, skb);
/* Ok. We will be able to collapse the packet. */
tcp_unlink_write_queue(next_skb, sk);
skb_copy_from_linear_data(next_skb,
skb_put(skb, next_skb_size),
skb_copy_from_linear_data(next_skb, skb_put(skb, next_skb_size),
next_skb_size);
if (next_skb->ip_summed == CHECKSUM_PARTIAL)
......@@ -1726,9 +1729,9 @@ static void tcp_retrans_try_collapse(struct sock *sk, struct sk_buff *skb, int m
* packet counting does not break.
*/
TCP_SKB_CB(skb)->sacked |= TCP_SKB_CB(next_skb)->sacked & TCPCB_EVER_RETRANS;
if (TCP_SKB_CB(next_skb)->sacked&TCPCB_SACKED_RETRANS)
if (TCP_SKB_CB(next_skb)->sacked & TCPCB_SACKED_RETRANS)
tp->retrans_out -= tcp_skb_pcount(next_skb);
if (TCP_SKB_CB(next_skb)->sacked&TCPCB_LOST)
if (TCP_SKB_CB(next_skb)->sacked & TCPCB_LOST)
tp->lost_out -= tcp_skb_pcount(next_skb);
/* Reno case is special. Sigh... */
if (tcp_is_reno(tp) && tp->sacked_out)
......@@ -1741,7 +1744,6 @@ static void tcp_retrans_try_collapse(struct sock *sk, struct sk_buff *skb, int m
tcp_clear_retrans_hints_partial(tp);
sk_wmem_free_skb(sk, next_skb);
}
}
/* Do a simple retransmit without using the backoff mechanisms in
......@@ -2416,10 +2418,12 @@ void tcp_send_delayed_ack(struct sock *sk)
/* This routine sends an ack and also updates the window. */
void tcp_send_ack(struct sock *sk)
{
/* If we have been reset, we may not send again. */
if (sk->sk_state != TCP_CLOSE) {
struct sk_buff *buff;
/* If we have been reset, we may not send again. */
if (sk->sk_state == TCP_CLOSE)
return;
/* We are not putting this on the write queue, so
* tcp_transmit_skb() will set the ownership to this
* sock.
......@@ -2446,7 +2450,6 @@ void tcp_send_ack(struct sock *sk)
TCP_SKB_CB(buff)->seq = TCP_SKB_CB(buff)->end_seq = tcp_acceptable_seq(sk);
TCP_SKB_CB(buff)->when = tcp_time_stamp;
tcp_transmit_skb(sk, buff, 0, GFP_ATOMIC);
}
}
/* This routine sends a packet with an out of date sequence
......@@ -2491,10 +2494,12 @@ static int tcp_xmit_probe_skb(struct sock *sk, int urgent)
int tcp_write_wakeup(struct sock *sk)
{
if (sk->sk_state != TCP_CLOSE) {
struct tcp_sock *tp = tcp_sk(sk);
struct sk_buff *skb;
if (sk->sk_state == TCP_CLOSE)
return -1;
if ((skb = tcp_send_head(sk)) != NULL &&
before(TCP_SKB_CB(skb)->seq, tcp_wnd_end(tp))) {
int err;
......@@ -2525,12 +2530,10 @@ int tcp_write_wakeup(struct sock *sk)
return err;
} else {
if (tp->urg_mode &&
between(tp->snd_up, tp->snd_una+1, tp->snd_una+0xFFFF))
between(tp->snd_up, tp->snd_una + 1, tp->snd_una + 0xFFFF))
tcp_xmit_probe_skb(sk, 1);
return tcp_xmit_probe_skb(sk, 0);
}
}
return -1;
}
/* A window probe timeout has occurred. If window is not closed send
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment