summaryrefslogtreecommitdiffstats
path: root/include/net/sock.h
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2013-07-23 05:26:31 +0200
committerDavid S. Miller <davem@davemloft.net>2013-07-25 02:54:48 +0200
commit64dc61306ce7da370833289739e2f52dfc6b37ba (patch)
tree3d04f970a54863e025f13c7f9de18c221e16b7d7 /include/net/sock.h
parentnet: sctp: trivial: add uapi/linux/sctp.h into maintainers (diff)
downloadlinux-64dc61306ce7da370833289739e2f52dfc6b37ba.tar.xz
linux-64dc61306ce7da370833289739e2f52dfc6b37ba.zip
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 <edumazet@google.com> Cc: Neal Cardwell <ncardwell@google.com> Cc: Yuchung Cheng <ycheng@google.com> Acked-by: Neal Cardwell <ncardwell@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/sock.h')
-rw-r--r--include/net/sock.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index e0473f61693f..d0b5fdee50a2 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1088,6 +1088,10 @@ static inline struct cg_proto *parent_cg_proto(struct proto *proto,
}
#endif
+static inline bool sk_stream_is_writeable(const struct sock *sk)
+{
+ return sk_stream_wspace(sk) >= sk_stream_min_wspace(sk);
+}
static inline bool sk_has_memory_pressure(const struct sock *sk)
{