svsk 42 include/linux/sunrpc/svcsock.h static inline u32 svc_sock_reclen(struct svc_sock *svsk) svsk 44 include/linux/sunrpc/svcsock.h return ntohl(svsk->sk_reclen) & RPC_FRAGMENT_SIZE_MASK; svsk 47 include/linux/sunrpc/svcsock.h static inline u32 svc_sock_final_rec(struct svc_sock *svsk) svsk 49 include/linux/sunrpc/svcsock.h return ntohl(svsk->sk_reclen) & RPC_LAST_STREAM_FRAGMENT; svsk 118 net/sunrpc/svcsock.c struct svc_sock *svsk = svsk 123 net/sunrpc/svcsock.c skb_free_datagram_locked(svsk->sk_sk, skb); svsk 148 net/sunrpc/svcsock.c struct svc_sock *svsk = svsk 150 net/sunrpc/svcsock.c switch (svsk->sk_sk->sk_family) { svsk 241 net/sunrpc/svcsock.c struct svc_sock *svsk = svsk 243 net/sunrpc/svcsock.c struct socket *sock = svsk->sk_sock; svsk 276 net/sunrpc/svcsock.c svsk, xdr->head[0].iov_base, xdr->head[0].iov_len, svsk 285 net/sunrpc/svcsock.c static int svc_one_sock_name(struct svc_sock *svsk, char *buf, int remaining) svsk 287 net/sunrpc/svcsock.c const struct sock *sk = svsk->sk_sk; svsk 325 net/sunrpc/svcsock.c struct svc_sock *svsk = svsk 332 net/sunrpc/svcsock.c clear_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags); svsk 338 net/sunrpc/svcsock.c len = sock_recvmsg(svsk->sk_sock, &msg, MSG_DONTWAIT); svsk 343 net/sunrpc/svcsock.c set_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags); svsk 346 net/sunrpc/svcsock.c svsk, iov[0].iov_base, iov[0].iov_len, len); svsk 353 net/sunrpc/svcsock.c static void svc_sock_setbufsize(struct svc_sock *svsk, unsigned int nreqs) svsk 355 net/sunrpc/svcsock.c unsigned int max_mesg = svsk->sk_xprt.xpt_server->sv_max_mesg; svsk 356 net/sunrpc/svcsock.c struct socket *sock = svsk->sk_sock; svsk 380 net/sunrpc/svcsock.c struct svc_sock *svsk = (struct svc_sock *)sk->sk_user_data; svsk 382 net/sunrpc/svcsock.c if (svsk) { svsk 384 net/sunrpc/svcsock.c svsk, sk, svsk 385 net/sunrpc/svcsock.c test_bit(XPT_BUSY, &svsk->sk_xprt.xpt_flags)); svsk 389 net/sunrpc/svcsock.c svsk->sk_odata(sk); svsk 390 net/sunrpc/svcsock.c if (!test_and_set_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags)) svsk 391 net/sunrpc/svcsock.c svc_xprt_enqueue(&svsk->sk_xprt); svsk 400 net/sunrpc/svcsock.c struct svc_sock *svsk = (struct svc_sock *)(sk->sk_user_data); svsk 402 net/sunrpc/svcsock.c if (svsk) { svsk 404 net/sunrpc/svcsock.c svsk, sk, test_bit(XPT_BUSY, &svsk->sk_xprt.xpt_flags)); svsk 408 net/sunrpc/svcsock.c svsk->sk_owspace(sk); svsk 409 net/sunrpc/svcsock.c svc_xprt_enqueue(&svsk->sk_xprt); svsk 415 net/sunrpc/svcsock.c struct svc_sock *svsk = container_of(xprt, struct svc_sock, sk_xprt); svsk 419 net/sunrpc/svcsock.c return !test_bit(SOCK_NOSPACE, &svsk->sk_sock->flags); svsk 424 net/sunrpc/svcsock.c struct svc_sock *svsk; svsk 431 net/sunrpc/svcsock.c svsk = container_of(xprt, struct svc_sock, sk_xprt); svsk 432 net/sunrpc/svcsock.c sock = svsk->sk_sock; svsk 497 net/sunrpc/svcsock.c struct svc_sock *svsk = svsk 499 net/sunrpc/svcsock.c struct svc_serv *serv = svsk->sk_xprt.xpt_server; svsk 515 net/sunrpc/svcsock.c if (test_and_clear_bit(XPT_CHNGBUF, &svsk->sk_xprt.xpt_flags)) svsk 524 net/sunrpc/svcsock.c svc_sock_setbufsize(svsk, serv->sv_nrthreads + 3); svsk 526 net/sunrpc/svcsock.c clear_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags); svsk 528 net/sunrpc/svcsock.c err = kernel_recvmsg(svsk->sk_sock, &msg, NULL, svsk 531 net/sunrpc/svcsock.c skb = skb_recv_udp(svsk->sk_sk, 0, 1, &err); svsk 537 net/sunrpc/svcsock.c set_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags); svsk 548 net/sunrpc/svcsock.c sock_write_timestamp(svsk->sk_sk, skb->tstamp); svsk 549 net/sunrpc/svcsock.c set_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags); /* there may be more data... */ svsk 620 net/sunrpc/svcsock.c struct svc_sock *svsk = container_of(xprt, struct svc_sock, sk_xprt); svsk 628 net/sunrpc/svcsock.c set_bit(SOCK_NOSPACE, &svsk->sk_sock->flags); svsk 629 net/sunrpc/svcsock.c required = atomic_read(&svsk->sk_xprt.xpt_reserved) + serv->sv_max_mesg; svsk 630 net/sunrpc/svcsock.c if (required*2 > sock_wspace(svsk->sk_sk)) svsk 632 net/sunrpc/svcsock.c clear_bit(SOCK_NOSPACE, &svsk->sk_sock->flags); svsk 675 net/sunrpc/svcsock.c static void svc_udp_init(struct svc_sock *svsk, struct svc_serv *serv) svsk 679 net/sunrpc/svcsock.c svc_xprt_init(sock_net(svsk->sk_sock->sk), &svc_udp_class, svsk 680 net/sunrpc/svcsock.c &svsk->sk_xprt, serv); svsk 681 net/sunrpc/svcsock.c clear_bit(XPT_CACHE_AUTH, &svsk->sk_xprt.xpt_flags); svsk 682 net/sunrpc/svcsock.c svsk->sk_sk->sk_data_ready = svc_data_ready; svsk 683 net/sunrpc/svcsock.c svsk->sk_sk->sk_write_space = svc_write_space; svsk 689 net/sunrpc/svcsock.c svc_sock_setbufsize(svsk, 3); svsk 692 net/sunrpc/svcsock.c set_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags); svsk 693 net/sunrpc/svcsock.c set_bit(XPT_CHNGBUF, &svsk->sk_xprt.xpt_flags); svsk 696 net/sunrpc/svcsock.c switch (svsk->sk_sk->sk_family) { svsk 708 net/sunrpc/svcsock.c err = kernel_setsockopt(svsk->sk_sock, level, optname, svsk 719 net/sunrpc/svcsock.c struct svc_sock *svsk = (struct svc_sock *)sk->sk_user_data; svsk 724 net/sunrpc/svcsock.c if (svsk) { svsk 727 net/sunrpc/svcsock.c svsk->sk_odata(sk); svsk 741 net/sunrpc/svcsock.c if (svsk) { svsk 742 net/sunrpc/svcsock.c set_bit(XPT_CONN, &svsk->sk_xprt.xpt_flags); svsk 743 net/sunrpc/svcsock.c svc_xprt_enqueue(&svsk->sk_xprt); svsk 754 net/sunrpc/svcsock.c struct svc_sock *svsk = (struct svc_sock *)sk->sk_user_data; svsk 759 net/sunrpc/svcsock.c if (!svsk) svsk 764 net/sunrpc/svcsock.c svsk->sk_ostate(sk); svsk 766 net/sunrpc/svcsock.c set_bit(XPT_CLOSE, &svsk->sk_xprt.xpt_flags); svsk 767 net/sunrpc/svcsock.c svc_xprt_enqueue(&svsk->sk_xprt); svsk 777 net/sunrpc/svcsock.c struct svc_sock *svsk = container_of(xprt, struct svc_sock, sk_xprt); svsk 780 net/sunrpc/svcsock.c struct svc_serv *serv = svsk->sk_xprt.xpt_server; svsk 781 net/sunrpc/svcsock.c struct socket *sock = svsk->sk_sock; svsk 787 net/sunrpc/svcsock.c dprintk("svc: tcp_accept %p sock %p\n", svsk, sock); svsk 791 net/sunrpc/svcsock.c clear_bit(XPT_CONN, &svsk->sk_xprt.xpt_flags); svsk 802 net/sunrpc/svcsock.c set_bit(XPT_CONN, &svsk->sk_xprt.xpt_flags); svsk 825 net/sunrpc/svcsock.c newsock->sk->sk_state_change = svsk->sk_ostate; svsk 826 net/sunrpc/svcsock.c newsock->sk->sk_data_ready = svsk->sk_odata; svsk 827 net/sunrpc/svcsock.c newsock->sk->sk_write_space = svsk->sk_owspace; svsk 861 net/sunrpc/svcsock.c static unsigned int svc_tcp_restore_pages(struct svc_sock *svsk, struct svc_rqst *rqstp) svsk 865 net/sunrpc/svcsock.c if (svsk->sk_datalen == 0) svsk 867 net/sunrpc/svcsock.c len = svsk->sk_datalen; svsk 872 net/sunrpc/svcsock.c BUG_ON(svsk->sk_pages[i] == NULL); svsk 873 net/sunrpc/svcsock.c rqstp->rq_pages[i] = svsk->sk_pages[i]; svsk 874 net/sunrpc/svcsock.c svsk->sk_pages[i] = NULL; svsk 880 net/sunrpc/svcsock.c static void svc_tcp_save_pages(struct svc_sock *svsk, struct svc_rqst *rqstp) svsk 884 net/sunrpc/svcsock.c if (svsk->sk_datalen == 0) svsk 886 net/sunrpc/svcsock.c len = svsk->sk_datalen; svsk 889 net/sunrpc/svcsock.c svsk->sk_pages[i] = rqstp->rq_pages[i]; svsk 894 net/sunrpc/svcsock.c static void svc_tcp_clear_pages(struct svc_sock *svsk) svsk 898 net/sunrpc/svcsock.c if (svsk->sk_datalen == 0) svsk 900 net/sunrpc/svcsock.c len = svsk->sk_datalen; svsk 903 net/sunrpc/svcsock.c if (svsk->sk_pages[i] == NULL) { svsk 907 net/sunrpc/svcsock.c put_page(svsk->sk_pages[i]); svsk 908 net/sunrpc/svcsock.c svsk->sk_pages[i] = NULL; svsk 911 net/sunrpc/svcsock.c svsk->sk_tcplen = 0; svsk 912 net/sunrpc/svcsock.c svsk->sk_datalen = 0; svsk 919 net/sunrpc/svcsock.c static int svc_tcp_recv_record(struct svc_sock *svsk, struct svc_rqst *rqstp) svsk 921 net/sunrpc/svcsock.c struct svc_serv *serv = svsk->sk_xprt.xpt_server; svsk 925 net/sunrpc/svcsock.c if (svsk->sk_tcplen < sizeof(rpc_fraghdr)) { svsk 928 net/sunrpc/svcsock.c want = sizeof(rpc_fraghdr) - svsk->sk_tcplen; svsk 929 net/sunrpc/svcsock.c iov.iov_base = ((char *) &svsk->sk_reclen) + svsk->sk_tcplen; svsk 934 net/sunrpc/svcsock.c svsk->sk_tcplen += len; svsk 942 net/sunrpc/svcsock.c dprintk("svc: TCP record, %d bytes\n", svc_sock_reclen(svsk)); svsk 943 net/sunrpc/svcsock.c if (svc_sock_reclen(svsk) + svsk->sk_datalen > svsk 946 net/sunrpc/svcsock.c svc_sock_reclen(svsk)); svsk 951 net/sunrpc/svcsock.c return svc_sock_reclen(svsk); svsk 956 net/sunrpc/svcsock.c set_bit(XPT_CLOSE, &svsk->sk_xprt.xpt_flags); svsk 960 net/sunrpc/svcsock.c static int receive_cb_reply(struct svc_sock *svsk, struct svc_rqst *rqstp) svsk 962 net/sunrpc/svcsock.c struct rpc_xprt *bc_xprt = svsk->sk_xprt.xpt_bc_xprt; svsk 1019 net/sunrpc/svcsock.c static void svc_tcp_fragment_received(struct svc_sock *svsk) svsk 1023 net/sunrpc/svcsock.c svc_sock_final_rec(svsk) ? "final" : "nonfinal", svsk 1024 net/sunrpc/svcsock.c svc_sock_reclen(svsk)); svsk 1025 net/sunrpc/svcsock.c svsk->sk_tcplen = 0; svsk 1026 net/sunrpc/svcsock.c svsk->sk_reclen = 0; svsk 1034 net/sunrpc/svcsock.c struct svc_sock *svsk = svsk 1036 net/sunrpc/svcsock.c struct svc_serv *serv = svsk->sk_xprt.xpt_server; svsk 1045 net/sunrpc/svcsock.c svsk, test_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags), svsk 1046 net/sunrpc/svcsock.c test_bit(XPT_CONN, &svsk->sk_xprt.xpt_flags), svsk 1047 net/sunrpc/svcsock.c test_bit(XPT_CLOSE, &svsk->sk_xprt.xpt_flags)); svsk 1049 net/sunrpc/svcsock.c len = svc_tcp_recv_record(svsk, rqstp); svsk 1053 net/sunrpc/svcsock.c base = svc_tcp_restore_pages(svsk, rqstp); svsk 1054 net/sunrpc/svcsock.c want = svc_sock_reclen(svsk) - (svsk->sk_tcplen - sizeof(rpc_fraghdr)); svsk 1066 net/sunrpc/svcsock.c svsk->sk_tcplen += len; svsk 1067 net/sunrpc/svcsock.c svsk->sk_datalen += len; svsk 1069 net/sunrpc/svcsock.c if (len != want || !svc_sock_final_rec(svsk)) { svsk 1070 net/sunrpc/svcsock.c svc_tcp_save_pages(svsk, rqstp); svsk 1074 net/sunrpc/svcsock.c svc_tcp_fragment_received(svsk); svsk 1077 net/sunrpc/svcsock.c (int)(svsk->sk_tcplen - sizeof(rpc_fraghdr)), svsk 1078 net/sunrpc/svcsock.c svc_sock_reclen(svsk)); svsk 1082 net/sunrpc/svcsock.c if (svsk->sk_datalen < 8) { svsk 1083 net/sunrpc/svcsock.c svsk->sk_datalen = 0; svsk 1087 net/sunrpc/svcsock.c rqstp->rq_arg.len = svsk->sk_datalen; svsk 1097 net/sunrpc/svcsock.c if (test_bit(XPT_LOCAL, &svsk->sk_xprt.xpt_flags)) svsk 1105 net/sunrpc/svcsock.c len = receive_cb_reply(svsk, rqstp); svsk 1108 net/sunrpc/svcsock.c svsk->sk_datalen = 0; svsk 1109 net/sunrpc/svcsock.c svc_tcp_fragment_received(svsk); svsk 1114 net/sunrpc/svcsock.c svc_xprt_copy_addrs(rqstp, &svsk->sk_xprt); svsk 1127 net/sunrpc/svcsock.c svsk->sk_xprt.xpt_server->sv_name, -len); svsk 1128 net/sunrpc/svcsock.c set_bit(XPT_CLOSE, &svsk->sk_xprt.xpt_flags); svsk 1207 net/sunrpc/svcsock.c static void svc_tcp_init(struct svc_sock *svsk, struct svc_serv *serv) svsk 1209 net/sunrpc/svcsock.c struct sock *sk = svsk->sk_sk; svsk 1211 net/sunrpc/svcsock.c svc_xprt_init(sock_net(svsk->sk_sock->sk), &svc_tcp_class, svsk 1212 net/sunrpc/svcsock.c &svsk->sk_xprt, serv); svsk 1213 net/sunrpc/svcsock.c set_bit(XPT_CACHE_AUTH, &svsk->sk_xprt.xpt_flags); svsk 1214 net/sunrpc/svcsock.c set_bit(XPT_CONG_CTRL, &svsk->sk_xprt.xpt_flags); svsk 1217 net/sunrpc/svcsock.c strcpy(svsk->sk_xprt.xpt_remotebuf, "listener"); svsk 1218 net/sunrpc/svcsock.c set_bit(XPT_LISTENER, &svsk->sk_xprt.xpt_flags); svsk 1220 net/sunrpc/svcsock.c set_bit(XPT_CONN, &svsk->sk_xprt.xpt_flags); svsk 1227 net/sunrpc/svcsock.c svsk->sk_reclen = 0; svsk 1228 net/sunrpc/svcsock.c svsk->sk_tcplen = 0; svsk 1229 net/sunrpc/svcsock.c svsk->sk_datalen = 0; svsk 1230 net/sunrpc/svcsock.c memset(&svsk->sk_pages[0], 0, sizeof(svsk->sk_pages)); svsk 1234 net/sunrpc/svcsock.c set_bit(XPT_DATA, &svsk->sk_xprt.xpt_flags); svsk 1240 net/sunrpc/svcsock.c set_bit(XPT_CLOSE, &svsk->sk_xprt.xpt_flags); svsk 1251 net/sunrpc/svcsock.c struct svc_sock *svsk; svsk 1254 net/sunrpc/svcsock.c list_for_each_entry(svsk, &serv->sv_permsocks, sk_xprt.xpt_list) svsk 1255 net/sunrpc/svcsock.c set_bit(XPT_CHNGBUF, &svsk->sk_xprt.xpt_flags); svsk 1267 net/sunrpc/svcsock.c struct svc_sock *svsk; svsk 1273 net/sunrpc/svcsock.c svsk = kzalloc(sizeof(*svsk), GFP_KERNEL); svsk 1274 net/sunrpc/svcsock.c if (!svsk) svsk 1286 net/sunrpc/svcsock.c kfree(svsk); svsk 1290 net/sunrpc/svcsock.c svsk->sk_sock = sock; svsk 1291 net/sunrpc/svcsock.c svsk->sk_sk = inet; svsk 1292 net/sunrpc/svcsock.c svsk->sk_ostate = inet->sk_state_change; svsk 1293 net/sunrpc/svcsock.c svsk->sk_odata = inet->sk_data_ready; svsk 1294 net/sunrpc/svcsock.c svsk->sk_owspace = inet->sk_write_space; svsk 1301 net/sunrpc/svcsock.c inet->sk_user_data = svsk; svsk 1305 net/sunrpc/svcsock.c svc_udp_init(svsk, serv); svsk 1307 net/sunrpc/svcsock.c svc_tcp_init(svsk, serv); svsk 1311 net/sunrpc/svcsock.c svsk, svsk->sk_sk, svsk 1312 net/sunrpc/svcsock.c test_bit(XPT_LISTENER, &svsk->sk_xprt.xpt_flags), svsk 1313 net/sunrpc/svcsock.c test_bit(XPT_CLOSE, &svsk->sk_xprt.xpt_flags)); svsk 1315 net/sunrpc/svcsock.c return svsk; svsk 1351 net/sunrpc/svcsock.c struct svc_sock *svsk = NULL; svsk 1371 net/sunrpc/svcsock.c svsk = svc_setup_socket(serv, so, SVC_SOCK_DEFAULTS); svsk 1372 net/sunrpc/svcsock.c if (IS_ERR(svsk)) { svsk 1374 net/sunrpc/svcsock.c err = PTR_ERR(svsk); svsk 1377 net/sunrpc/svcsock.c salen = kernel_getsockname(svsk->sk_sock, sin); svsk 1379 net/sunrpc/svcsock.c svc_xprt_set_local(&svsk->sk_xprt, sin, salen); svsk 1380 net/sunrpc/svcsock.c svsk->sk_xprt.xpt_cred = get_cred(cred); svsk 1381 net/sunrpc/svcsock.c svc_add_new_perm_xprt(serv, &svsk->sk_xprt); svsk 1382 net/sunrpc/svcsock.c return svc_one_sock_name(svsk, name_return, len); svsk 1398 net/sunrpc/svcsock.c struct svc_sock *svsk; svsk 1463 net/sunrpc/svcsock.c svsk = svc_setup_socket(serv, sock, flags); svsk 1464 net/sunrpc/svcsock.c if (IS_ERR(svsk)) { svsk 1465 net/sunrpc/svcsock.c error = PTR_ERR(svsk); svsk 1468 net/sunrpc/svcsock.c svc_xprt_set_local(&svsk->sk_xprt, newsin, newlen); svsk 1469 net/sunrpc/svcsock.c return (struct svc_xprt *)svsk; svsk 1482 net/sunrpc/svcsock.c struct svc_sock *svsk = container_of(xprt, struct svc_sock, sk_xprt); svsk 1483 net/sunrpc/svcsock.c struct sock *sk = svsk->sk_sk; svsk 1485 net/sunrpc/svcsock.c dprintk("svc: svc_sock_detach(%p)\n", svsk); svsk 1489 net/sunrpc/svcsock.c sk->sk_state_change = svsk->sk_ostate; svsk 1490 net/sunrpc/svcsock.c sk->sk_data_ready = svsk->sk_odata; svsk 1491 net/sunrpc/svcsock.c sk->sk_write_space = svsk->sk_owspace; svsk 1501 net/sunrpc/svcsock.c struct svc_sock *svsk = container_of(xprt, struct svc_sock, sk_xprt); svsk 1503 net/sunrpc/svcsock.c dprintk("svc: svc_tcp_sock_detach(%p)\n", svsk); svsk 1508 net/sunrpc/svcsock.c svc_tcp_clear_pages(svsk); svsk 1509 net/sunrpc/svcsock.c kernel_sock_shutdown(svsk->sk_sock, SHUT_RDWR); svsk 1518 net/sunrpc/svcsock.c struct svc_sock *svsk = container_of(xprt, struct svc_sock, sk_xprt); svsk 1519 net/sunrpc/svcsock.c dprintk("svc: svc_sock_free(%p)\n", svsk); svsk 1521 net/sunrpc/svcsock.c if (svsk->sk_sock->file) svsk 1522 net/sunrpc/svcsock.c sockfd_put(svsk->sk_sock); svsk 1524 net/sunrpc/svcsock.c sock_release(svsk->sk_sock); svsk 1525 net/sunrpc/svcsock.c kfree(svsk);