Lines Matching defs:sock
37 #include <net/sock.h>
59 static void svc_udp_data_ready(struct sock *, int);
72 static void svc_reclassify_socket(struct socket *sock)
74 struct sock *sk = sock->sk;
96 static void svc_reclassify_socket(struct socket *sock)
158 int svc_send_common(struct socket *sock, struct xdr_buf *xdr,
176 len = kernel_sendpage(sock, headpage, headoffset,
189 result = kernel_sendpage(sock, *ppage, base, size, flags);
203 result = kernel_sendpage(sock, tailpage, tailoffset,
221 struct socket *sock = svsk->sk_sock;
243 if (sock_sendmsg(sock, &msg, 0) < 0)
249 len = svc_send_common(sock, xdr, rqstp->rq_respages[0], headoff,
265 const struct sock *sk = svsk->sk_sk;
349 struct socket *sock = svsk->sk_sock;
352 err = kernel_sock_ioctl(sock, TIOCINQ, (unsigned long) &avail);
383 static void svc_sock_setbufsize(struct socket *sock, unsigned int snd,
391 lock_sock(sock->sk);
392 sock->sk->sk_sndbuf = snd * 2;
393 sock->sk->sk_rcvbuf = rcv * 2;
394 sock->sk->sk_userlocks |= SOCK_SNDBUF_LOCK|SOCK_RCVBUF_LOCK;
395 sock->sk->sk_write_space(sock->sk);
396 release_sock(sock->sk);
401 static void svc_udp_data_ready(struct sock *sk, int count)
419 static void svc_write_space(struct sock *sk)
436 static void svc_tcp_write_space(struct sock *sk)
438 struct socket *sock = sk->sk_socket;
440 if (sk_stream_wspace(sk) >= sk_stream_min_wspace(sk) && sock)
441 clear_bit(SOCK_NOSPACE, &sock->flags);
634 * sock space.
719 static void svc_tcp_listen_data_ready(struct sock *sk, int count_unused)
751 static void svc_tcp_state_change(struct sock *sk)
768 static void svc_tcp_data_ready(struct sock *sk, int count)
791 struct socket *sock = svsk->sk_sock;
797 dprintk("svc: tcp_accept %p sock %p\n", svsk, sock);
798 if (!sock)
802 err = kernel_accept(sock, &newsock, O_NONBLOCK);
1206 struct sock *sk = svsk->sk_sk;
1265 struct socket *sock,
1269 struct sock *inet;
1272 dprintk("svc: svc_setup_socket %p\n", sock);
1278 inet = sock->sk;
1291 svsk->sk_sock = sock;
1298 if (sock->type == SOCK_DGRAM)
1374 struct socket *sock;
1406 error = sock_create_kern(family, type, protocol, &sock);
1410 svc_reclassify_socket(sock);
1419 kernel_setsockopt(sock, SOL_IPV6, IPV6_V6ONLY,
1423 sock->sk->sk_reuse = 1; /* allow address reuse */
1424 error = kernel_bind(sock, sin, len);
1429 error = kernel_getsockname(sock, newsin, &newlen);
1434 if ((error = kernel_listen(sock, 64)) < 0)
1438 if ((svsk = svc_setup_socket(serv, sock, &error, flags)) != NULL) {
1445 sock_release(sock);
1456 struct sock *sk = svsk->sk_sk;