Commit 7f96df9b authored by Thomas Graf's avatar Thomas Graf

[NET] Convert sk_user_write_queue into SOCK_USE_WRITE_QUEUE flag

Signed-off-by: default avatarThomas Graf <tgraf@suug.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3ad701b9
......@@ -116,7 +116,6 @@ struct sock_common {
* struct sock - network layer representation of sockets
* @__sk_common - shared layout with tcp_tw_bucket
* @sk_shutdown - mask of %SEND_SHUTDOWN and/or %RCV_SHUTDOWN
* @sk_use_write_queue - wheter to call sk->sk_write_space in sock_wfree
* @sk_userlocks - %SO_SNDBUF and %SO_RCVBUF settings
* @sk_lock - synchronizer
* @sk_rcvbuf - size of receive buffer in bytes
......@@ -191,7 +190,6 @@ struct sock {
#define sk_bind_node __sk_common.skc_bind_node
#define sk_refcnt __sk_common.skc_refcnt
unsigned char sk_shutdown;
unsigned char sk_use_write_queue;
unsigned char sk_userlocks;
socket_lock_t sk_lock;
int sk_rcvbuf;
......@@ -390,6 +388,7 @@ enum sock_flags {
SOCK_BROADCAST,
SOCK_TIMESTAMP,
SOCK_ZAPPED,
SOCK_USE_WRITE_QUEUE, /* whether to call sk->sk_write_space in sock_wfree */
};
static inline void sock_set_flag(struct sock *sk, enum sock_flags flag)
......
......@@ -712,7 +712,7 @@ void sock_wfree(struct sk_buff *skb)
/* In case it might be waiting for more memory. */
atomic_sub(skb->truesize, &sk->sk_wmem_alloc);
if (!sk->sk_use_write_queue)
if (!sock_flag(sk, SOCK_USE_WRITE_QUEUE))
sk->sk_write_space(sk);
sock_put(sk);
}
......
......@@ -2064,7 +2064,7 @@ static int tcp_v4_init_sock(struct sock *sk)
sk->sk_state = TCP_CLOSE;
sk->sk_write_space = sk_stream_write_space;
sk->sk_use_write_queue = 1;
sock_set_flag(sk, SOCK_USE_WRITE_QUEUE);
tp->af_specific = &ipv4_specific;
......
......@@ -2027,7 +2027,7 @@ static int tcp_v6_init_sock(struct sock *sk)
tp->af_specific = &ipv6_specific;
sk->sk_write_space = sk_stream_write_space;
sk->sk_use_write_queue = 1;
sock_set_flag(sk, SOCK_USE_WRITE_QUEUE);
sk->sk_sndbuf = sysctl_tcp_wmem[1];
sk->sk_rcvbuf = sysctl_tcp_rmem[1];
......
......@@ -126,7 +126,7 @@ static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep,
/* Use SCTP specific send buffer space queues. */
sk->sk_write_space = sctp_write_space;
sk->sk_use_write_queue = 1;
sock_set_flag(sk, SOCK_USE_WRITE_QUEUE);
/* Initialize the secret key used with cookie. */
get_random_bytes(&ep->secret_key[0], SCTP_SECRET_SIZE);
......
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