]> git.hungrycats.org Git - linux/commitdiff
[NET] Convert sk_queue_shrunk into SOCK_QUEUE_SHRUNK flag
authorThomas Graf <tgraf@suug.ch>
Wed, 16 Mar 2005 01:23:08 +0000 (02:23 +0100)
committerThomas Graf <tgraf@suug.ch>
Wed, 16 Mar 2005 01:23:08 +0000 (02:23 +0100)
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sock.h
net/ipv4/tcp_input.c
net/ipv4/tcp_output.c

index b9d770d2cbdd8d63596d49a72a8197c631992f5d..6411ebd5653d7defa338bba0924bf0fa78c121eb 100644 (file)
@@ -164,7 +164,6 @@ struct sock_common {
   *    @sk_sndmsg_off - cached offset for sendmsg
   *    @sk_send_head - front of stuff to transmit
   *    @sk_write_pending - a write to stream socket waits to start
-  *    @sk_queue_shrunk - write queue has been shrunk recently
   *    @sk_state_change - callback to indicate change in the state of the sock
   *    @sk_data_ready - callback to indicate there is data to be processed
   *    @sk_write_space - callback to indicate there is bf sending space available
@@ -243,7 +242,6 @@ struct sock {
        struct sk_buff          *sk_send_head;
        int                     sk_write_pending;
        void                    *sk_security;
-       __u8                    sk_queue_shrunk;
        /* three bytes hole, try to pack */
        void                    (*sk_state_change)(struct sock *sk);
        void                    (*sk_data_ready)(struct sock *sk, int bytes);
@@ -385,6 +383,7 @@ enum sock_flags {
        SOCK_RCVTSTAMP, /* %SO_TIMESTAMP setting */
        SOCK_NO_LARGESEND, /* whether to sent large segments or not */
        SOCK_LOCALROUTE, /* route locally only, %SO_DONTROUTE setting */
+       SOCK_QUEUE_SHRUNK, /* write queue has been shrunk recently */
 };
 
 static inline void sock_set_flag(struct sock *sk, enum sock_flags flag)
@@ -449,7 +448,7 @@ static inline void sk_stream_set_owner_r(struct sk_buff *skb, struct sock *sk)
 
 static inline void sk_stream_free_skb(struct sock *sk, struct sk_buff *skb)
 {
-       sk->sk_queue_shrunk   = 1;
+       sock_set_flag(sk, SOCK_QUEUE_SHRUNK);
        sk->sk_wmem_queued   -= skb->truesize;
        sk->sk_forward_alloc += skb->truesize;
        __kfree_skb(skb);
index 15dac88c898c5625886a7ee05696dc3c9184c88d..b2c6878d2e3a79d917ec104a82cadbf2e9bba515 100644 (file)
@@ -3935,7 +3935,7 @@ void tcp_cwnd_application_limited(struct sock *sk)
 
 
 /* When incoming ACK allowed to free some skb from write_queue,
- * we remember this event in flag sk->sk_queue_shrunk and wake up socket
+ * we remember this event in flag SOCK_QUEUE_SHRUNK and wake up socket
  * on the exit from tcp input handler.
  *
  * PROBLEM: sndbuf expansion does not work well with largesend.
@@ -3963,8 +3963,8 @@ static void tcp_new_space(struct sock *sk)
 
 static inline void tcp_check_space(struct sock *sk)
 {
-       if (sk->sk_queue_shrunk) {
-               sk->sk_queue_shrunk = 0;
+       if (sock_flag(sk, SOCK_QUEUE_SHRUNK)) {
+               sock_reset_flag(sk, SOCK_QUEUE_SHRUNK);
                if (sk->sk_socket &&
                    test_bit(SOCK_NOSPACE, &sk->sk_socket->flags))
                        tcp_new_space(sk);
index ba0645d0008b94ebb597cd8b5edb336140a63005..6354fa7620d8c1589e7e64abf9d969f452aac12b 100644 (file)
@@ -593,9 +593,9 @@ int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len)
        skb->ip_summed = CHECKSUM_HW;
 
        skb->truesize        -= len;
-       sk->sk_queue_shrunk   = 1;
        sk->sk_wmem_queued   -= len;
        sk->sk_forward_alloc += len;
+       sock_set_flag(sk, SOCK_QUEUE_SHRUNK);
 
        /* Any change of skb->len requires recalculation of tso
         * factor and mss.