Lines Matching +full:rpc +full:- +full:if

1 /* SPDX-License-Identifier: GPL-2.0 */
5 * RPC server declarations.
27 * RPC service thread pool.
30 * a single one of these per RPC service, but on NUMA machines those
32 * have one pool per NUMA node. This optimisation reduces cross-
33 * node traffic on multi-node NUMA NFS servers.
52 SP_TASK_PENDING, /* still work to do even if no xprt is queued */
59 * RPC service.
61 * An RPC service is a ``daemon,'' possibly multithreaded, which
62 * receives and processes incoming RPC messages.
66 * We currently do not support more than one RPC program per daemon.
69 struct svc_program * sv_program; /* RPC program */
70 struct svc_stat * sv_stats; /* RPC statistics */
91 #if defined(CONFIG_SUNRPC_BACKCHANNEL)
108 * Maximum payload size supported by a kernel RPC server.
116 * For UDP transports, a block plus NFS,RPC, and UDP headers
135 * RPC Requests and replies are stored in one or more pages.
140 * Pages are sent using ->sendmsg with MSG_SPLICE_PAGES so each server thread
152 * This assumes that the non-page part of an rpc reply will fit
153 * in a page - NFSd ensures this. lockd also has no trouble.
157 * We using ->sendfile to return read data, we might need one extra page
158 * if the request is not page-aligned. So add another '1'.
160 #define RPCSVC_MAXPAGES ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE \
176 * - reply from here */
179 struct svc_serv * rq_server; /* RPC service definition */
213 void * rq_auth_data; /* flavor-specific data */
228 struct auth_domain * rq_client; /* RPC peer info */
229 struct auth_domain * rq_gssclient; /* "gss/"-style peer info */
237 unsigned int rq_status_counter; /* RPC processing counter */
250 #define SVC_NET(rqst) (rqst->rq_xprt ? rqst->rq_xprt->xpt_net : rqst->rq_bc_net)
257 return (struct sockaddr_in *) &rqst->rq_addr; in svc_addr_in()
262 return (struct sockaddr_in6 *) &rqst->rq_addr; in svc_addr_in6()
267 return (struct sockaddr *) &rqst->rq_addr; in svc_addr()
272 return (struct sockaddr_in *) &rqst->rq_daddr; in svc_daddr_in()
277 return (struct sockaddr_in6 *) &rqst->rq_daddr; in svc_daddr_in6()
282 return (struct sockaddr *) &rqst->rq_daddr; in svc_daddr()
286 * svc_thread_should_stop - check if this thread should stop
301 if (test_and_clear_bit(SP_NEED_VICTIM, &rqstp->rq_pool->sp_flags)) in svc_thread_should_stop()
302 set_bit(RQ_VICTIM, &rqstp->rq_flags); in svc_thread_should_stop()
304 return test_bit(RQ_VICTIM, &rqstp->rq_flags); in svc_thread_should_stop()
331 * List of RPC programs on the same transport endpoint
342 struct svc_stat * pg_stats; /* rpc statistics */
355 * RPC program version
360 const struct svc_procedure *vs_proc; /* per-procedure info */
367 /* Don't care if the rpcbind registration fails */
378 * RPC procedure info
462 svc_reserve(rqstp, space + rqstp->rq_auth_slack); in svc_reserve_auth()
466 * svcxdr_init_decode - Prepare an xdr_stream for Call decoding
467 * @rqstp: controlling server RPC transaction context
472 struct xdr_stream *xdr = &rqstp->rq_arg_stream; in svcxdr_init_decode()
473 struct xdr_buf *buf = &rqstp->rq_arg; in svcxdr_init_decode()
474 struct kvec *argv = buf->head; in svcxdr_init_decode()
476 WARN_ON(buf->len != buf->head->iov_len + buf->page_len + buf->tail->iov_len); in svcxdr_init_decode()
477 buf->len = buf->head->iov_len + buf->page_len + buf->tail->iov_len; in svcxdr_init_decode()
479 xdr_init_decode(xdr, buf, argv->iov_base, NULL); in svcxdr_init_decode()
480 xdr_set_scratch_page(xdr, rqstp->rq_scratch_page); in svcxdr_init_decode()
484 * svcxdr_init_encode - Prepare an xdr_stream for svc Reply encoding
485 * @rqstp: controlling server RPC transaction context
490 struct xdr_stream *xdr = &rqstp->rq_res_stream; in svcxdr_init_encode()
491 struct xdr_buf *buf = &rqstp->rq_res; in svcxdr_init_encode()
492 struct kvec *resv = buf->head; in svcxdr_init_encode()
496 xdr->buf = buf; in svcxdr_init_encode()
497 xdr->iov = resv; in svcxdr_init_encode()
498 xdr->p = resv->iov_base + resv->iov_len; in svcxdr_init_encode()
499 xdr->end = resv->iov_base + PAGE_SIZE; in svcxdr_init_encode()
500 buf->len = resv->iov_len; in svcxdr_init_encode()
501 xdr->page_ptr = buf->pages - 1; in svcxdr_init_encode()
502 buf->buflen = PAGE_SIZE * (rqstp->rq_page_end - buf->pages); in svcxdr_init_encode()
503 xdr->rqst = NULL; in svcxdr_init_encode()
507 * svcxdr_encode_opaque_pages - Insert pages into an xdr_stream
524 xdr->page_ptr = rqstp->rq_next_page - 1; in svcxdr_encode_opaque_pages()
528 * svcxdr_set_auth_slack -
529 * @rqstp: RPC transaction
537 struct xdr_stream *xdr = &rqstp->rq_res_stream; in svcxdr_set_auth_slack()
538 struct xdr_buf *buf = &rqstp->rq_res; in svcxdr_set_auth_slack()
539 struct kvec *resv = buf->head; in svcxdr_set_auth_slack()
541 rqstp->rq_auth_slack = slack; in svcxdr_set_auth_slack()
543 xdr->end -= XDR_QUADLEN(slack); in svcxdr_set_auth_slack()
544 buf->buflen -= rqstp->rq_auth_slack; in svcxdr_set_auth_slack()
546 WARN_ON(xdr->iov != resv); in svcxdr_set_auth_slack()
547 WARN_ON(xdr->p > xdr->end); in svcxdr_set_auth_slack()
551 * svcxdr_set_accept_stat - Reserve space for the accept_stat field
552 * @rqstp: RPC transaction context
560 struct xdr_stream *xdr = &rqstp->rq_res_stream; in svcxdr_set_accept_stat()
562 rqstp->rq_accept_statp = xdr_reserve_space(xdr, XDR_UNIT); in svcxdr_set_accept_stat()
563 if (unlikely(!rqstp->rq_accept_statp)) in svcxdr_set_accept_stat()
565 *rqstp->rq_accept_statp = rpc_success; in svcxdr_set_accept_stat()