mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
net: add sk_stream_is_writeable() helper
Several call sites use the hardcoded following condition : sk_stream_wspace(sk) >= sk_stream_min_wspace(sk) Lets use a helper because TCP_NOTSENT_LOWAT support will change this condition for TCP sockets. Signed-off-by: Eric Dumazet <[email protected]> Cc: Neal Cardwell <[email protected]> Cc: Yuchung Cheng <[email protected]> Acked-by: Neal Cardwell <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
parent
4d58c02520
commit
64dc61306c
7 changed files with 12 additions and 8 deletions
|
|
@ -442,7 +442,7 @@ static void svc_tcp_write_space(struct sock *sk)
|
|||
{
|
||||
struct socket *sock = sk->sk_socket;
|
||||
|
||||
if (sk_stream_wspace(sk) >= sk_stream_min_wspace(sk) && sock)
|
||||
if (sk_stream_is_writeable(sk) && sock)
|
||||
clear_bit(SOCK_NOSPACE, &sock->flags);
|
||||
svc_write_space(sk);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1602,7 +1602,7 @@ static void xs_tcp_write_space(struct sock *sk)
|
|||
read_lock_bh(&sk->sk_callback_lock);
|
||||
|
||||
/* from net/core/stream.c:sk_stream_write_space */
|
||||
if (sk_stream_wspace(sk) >= sk_stream_min_wspace(sk))
|
||||
if (sk_stream_is_writeable(sk))
|
||||
xs_write_space(sk);
|
||||
|
||||
read_unlock_bh(&sk->sk_callback_lock);
|
||||
|
|
|
|||
Loading…
Reference in a new issue