Lines Matching refs:rqstp

118 static void svc_tcp_release_rqst(struct svc_rqst *rqstp)  in svc_tcp_release_rqst()  argument
120 struct sk_buff *skb = rqstp->rq_xprt_ctxt; in svc_tcp_release_rqst()
124 container_of(rqstp->rq_xprt, struct svc_sock, sk_xprt); in svc_tcp_release_rqst()
126 rqstp->rq_xprt_ctxt = NULL; in svc_tcp_release_rqst()
136 static void svc_udp_release_rqst(struct svc_rqst *rqstp) in svc_udp_release_rqst() argument
138 struct sk_buff *skb = rqstp->rq_xprt_ctxt; in svc_udp_release_rqst()
141 rqstp->rq_xprt_ctxt = NULL; in svc_udp_release_rqst()
153 static void svc_set_cmsg_data(struct svc_rqst *rqstp, struct cmsghdr *cmh) in svc_set_cmsg_data() argument
156 container_of(rqstp->rq_xprt, struct svc_sock, sk_xprt); in svc_set_cmsg_data()
165 svc_daddr_in(rqstp)->sin_addr.s_addr; in svc_set_cmsg_data()
172 struct sockaddr_in6 *daddr = svc_daddr_in6(rqstp); in svc_set_cmsg_data()
184 static int svc_sock_result_payload(struct svc_rqst *rqstp, unsigned int offset, in svc_sock_result_payload() argument
251 static ssize_t svc_tcp_read_msg(struct svc_rqst *rqstp, size_t buflen, in svc_tcp_read_msg() argument
255 container_of(rqstp->rq_xprt, struct svc_sock, sk_xprt); in svc_tcp_read_msg()
256 struct bio_vec *bvec = rqstp->rq_bvec; in svc_tcp_read_msg()
262 rqstp->rq_xprt_hlen = 0; in svc_tcp_read_msg()
267 bvec[i].bv_page = rqstp->rq_pages[i]; in svc_tcp_read_msg()
271 rqstp->rq_respages = &rqstp->rq_pages[i]; in svc_tcp_read_msg()
272 rqstp->rq_next_page = rqstp->rq_respages + 1; in svc_tcp_read_msg()
309 static void svc_sock_secure_port(struct svc_rqst *rqstp) in svc_sock_secure_port() argument
311 if (svc_port_is_privileged(svc_addr(rqstp))) in svc_sock_secure_port()
312 set_bit(RQ_SECURE, &rqstp->rq_flags); in svc_sock_secure_port()
314 clear_bit(RQ_SECURE, &rqstp->rq_flags); in svc_sock_secure_port()
369 static int svc_udp_get_dest_address4(struct svc_rqst *rqstp, in svc_udp_get_dest_address4() argument
373 struct sockaddr_in *daddr = svc_daddr_in(rqstp); in svc_udp_get_dest_address4()
386 static int svc_udp_get_dest_address6(struct svc_rqst *rqstp, in svc_udp_get_dest_address6() argument
390 struct sockaddr_in6 *daddr = svc_daddr_in6(rqstp); in svc_udp_get_dest_address6()
408 static int svc_udp_get_dest_address(struct svc_rqst *rqstp, in svc_udp_get_dest_address() argument
413 return svc_udp_get_dest_address4(rqstp, cmh); in svc_udp_get_dest_address()
415 return svc_udp_get_dest_address6(rqstp, cmh); in svc_udp_get_dest_address()
431 static int svc_udp_recvfrom(struct svc_rqst *rqstp) in svc_udp_recvfrom() argument
434 container_of(rqstp->rq_xprt, struct svc_sock, sk_xprt); in svc_udp_recvfrom()
443 .msg_name = svc_addr(rqstp), in svc_udp_recvfrom()
471 len = svc_addr_len(svc_addr(rqstp)); in svc_udp_recvfrom()
472 rqstp->rq_addrlen = len; in svc_udp_recvfrom()
482 rqstp->rq_arg.len = len; in svc_udp_recvfrom()
485 rqstp->rq_prot = IPPROTO_UDP; in svc_udp_recvfrom()
487 if (!svc_udp_get_dest_address(rqstp, cmh)) in svc_udp_recvfrom()
489 rqstp->rq_daddrlen = svc_addr_len(svc_daddr(rqstp)); in svc_udp_recvfrom()
494 if (csum_partial_copy_to_xdr(&rqstp->rq_arg, skb)) in svc_udp_recvfrom()
500 rqstp->rq_arg.head[0].iov_base = skb->data; in svc_udp_recvfrom()
501 rqstp->rq_arg.head[0].iov_len = len; in svc_udp_recvfrom()
504 rqstp->rq_xprt_ctxt = skb; in svc_udp_recvfrom()
507 rqstp->rq_arg.page_base = 0; in svc_udp_recvfrom()
508 if (len <= rqstp->rq_arg.head[0].iov_len) { in svc_udp_recvfrom()
509 rqstp->rq_arg.head[0].iov_len = len; in svc_udp_recvfrom()
510 rqstp->rq_arg.page_len = 0; in svc_udp_recvfrom()
511 rqstp->rq_respages = rqstp->rq_pages+1; in svc_udp_recvfrom()
513 rqstp->rq_arg.page_len = len - rqstp->rq_arg.head[0].iov_len; in svc_udp_recvfrom()
514 rqstp->rq_respages = rqstp->rq_pages + 1 + in svc_udp_recvfrom()
515 DIV_ROUND_UP(rqstp->rq_arg.page_len, PAGE_SIZE); in svc_udp_recvfrom()
517 rqstp->rq_next_page = rqstp->rq_respages+1; in svc_udp_recvfrom()
522 svc_xprt_received(rqstp->rq_xprt); in svc_udp_recvfrom()
541 svc_xprt_received(rqstp->rq_xprt); in svc_udp_recvfrom()
554 static int svc_udp_sendto(struct svc_rqst *rqstp) in svc_udp_sendto() argument
556 struct svc_xprt *xprt = rqstp->rq_xprt; in svc_udp_sendto()
558 struct xdr_buf *xdr = &rqstp->rq_res; in svc_udp_sendto()
565 .msg_name = &rqstp->rq_addr, in svc_udp_sendto()
566 .msg_namelen = rqstp->rq_addrlen, in svc_udp_sendto()
573 svc_udp_release_rqst(rqstp); in svc_udp_sendto()
575 svc_set_cmsg_data(rqstp, cmh); in svc_udp_sendto()
813 struct svc_rqst *rqstp) in svc_tcp_restore_pages() argument
822 if (rqstp->rq_pages[i] != NULL) in svc_tcp_restore_pages()
823 put_page(rqstp->rq_pages[i]); in svc_tcp_restore_pages()
825 rqstp->rq_pages[i] = svsk->sk_pages[i]; in svc_tcp_restore_pages()
828 rqstp->rq_arg.head[0].iov_base = page_address(rqstp->rq_pages[0]); in svc_tcp_restore_pages()
832 static void svc_tcp_save_pages(struct svc_sock *svsk, struct svc_rqst *rqstp) in svc_tcp_save_pages() argument
841 svsk->sk_pages[i] = rqstp->rq_pages[i]; in svc_tcp_save_pages()
842 rqstp->rq_pages[i] = NULL; in svc_tcp_save_pages()
871 struct svc_rqst *rqstp) in svc_tcp_read_marker() argument
910 static int receive_cb_reply(struct svc_sock *svsk, struct svc_rqst *rqstp) in receive_cb_reply() argument
915 __be32 *p = (__be32 *)rqstp->rq_arg.head[0].iov_base; in receive_cb_reply()
936 src = &rqstp->rq_arg.head[0]; in receive_cb_reply()
940 xprt_complete_rqst(req->rq_task, rqstp->rq_arg.len); in receive_cb_reply()
941 rqstp->rq_arg.len = 0; in receive_cb_reply()
980 static int svc_tcp_recvfrom(struct svc_rqst *rqstp) in svc_tcp_recvfrom() argument
983 container_of(rqstp->rq_xprt, struct svc_sock, sk_xprt); in svc_tcp_recvfrom()
991 len = svc_tcp_read_marker(svsk, rqstp); in svc_tcp_recvfrom()
995 base = svc_tcp_restore_pages(svsk, rqstp); in svc_tcp_recvfrom()
997 len = svc_tcp_read_msg(rqstp, base + want, base); in svc_tcp_recvfrom()
1008 rqstp->rq_arg.len = svsk->sk_datalen; in svc_tcp_recvfrom()
1009 rqstp->rq_arg.page_base = 0; in svc_tcp_recvfrom()
1010 if (rqstp->rq_arg.len <= rqstp->rq_arg.head[0].iov_len) { in svc_tcp_recvfrom()
1011 rqstp->rq_arg.head[0].iov_len = rqstp->rq_arg.len; in svc_tcp_recvfrom()
1012 rqstp->rq_arg.page_len = 0; in svc_tcp_recvfrom()
1014 rqstp->rq_arg.page_len = rqstp->rq_arg.len - rqstp->rq_arg.head[0].iov_len; in svc_tcp_recvfrom()
1016 rqstp->rq_xprt_ctxt = NULL; in svc_tcp_recvfrom()
1017 rqstp->rq_prot = IPPROTO_TCP; in svc_tcp_recvfrom()
1019 set_bit(RQ_LOCAL, &rqstp->rq_flags); in svc_tcp_recvfrom()
1021 clear_bit(RQ_LOCAL, &rqstp->rq_flags); in svc_tcp_recvfrom()
1023 p = (__be32 *)rqstp->rq_arg.head[0].iov_base; in svc_tcp_recvfrom()
1026 len = receive_cb_reply(svsk, rqstp); in svc_tcp_recvfrom()
1035 svc_xprt_copy_addrs(rqstp, &svsk->sk_xprt); in svc_tcp_recvfrom()
1039 svc_xprt_received(rqstp->rq_xprt); in svc_tcp_recvfrom()
1040 return rqstp->rq_arg.len; in svc_tcp_recvfrom()
1043 svc_tcp_save_pages(svsk, rqstp); in svc_tcp_recvfrom()
1064 svc_xprt_received(rqstp->rq_xprt); in svc_tcp_recvfrom()
1158 static int svc_tcp_sendto(struct svc_rqst *rqstp) in svc_tcp_sendto() argument
1160 struct svc_xprt *xprt = rqstp->rq_xprt; in svc_tcp_sendto()
1162 struct xdr_buf *xdr = &rqstp->rq_res; in svc_tcp_sendto()
1168 svc_tcp_release_rqst(rqstp); in svc_tcp_sendto()