4 * Generic stream handling routines. These are generic for most
5 * protocols. Even IP. Tonight 8-).
6 * This is used because TCP, LLC (others too) layer all have mostly
7 * identical sendmsg() and recvmsg() code.
8 * So we (will) share it here.
10 * Authors: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
11 * (from old tcp.c code)
12 * Alan Cox <alan@redhat.com> (Borrowed comments 8-))
15 #include <linux/module.h>
16 #include <linux/net.h>
17 #include <linux/signal.h>
18 #include <linux/wait.h>
22 * sk_stream_write_space - stream socket write_space callback.
25 * FIXME: write proper description
27 void sk_stream_write_space(struct sock *sk)
29 struct socket *sock = sk->sk_socket;
31 if (sk_stream_wspace(sk) >= sk_stream_min_wspace(sk) && sock) {
32 clear_bit(SOCK_NOSPACE, &sock->flags);
34 if (sk->sk_sleep && waitqueue_active(sk->sk_sleep))
35 wake_up_interruptible(sk->sk_sleep);
36 if (sock->fasync_list && !(sk->sk_shutdown & SEND_SHUTDOWN))
37 sock_wake_async(sock, 2, POLL_OUT);
41 EXPORT_SYMBOL(sk_stream_write_space);