mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
svc: Add a max payload value to the transport
The svc_max_payload function currently looks at the socket type to determine the max payload. Add a max payload value to svc_xprt_class so it can be returned directly. Signed-off-by: Tom Tucker <[email protected]> Acked-by: Neil Brown <[email protected]> Reviewed-by: Chuck Lever <[email protected]> Reviewed-by: Greg Banks <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
This commit is contained in:
parent
9f29868b49
commit
490231558e
3 changed files with 4 additions and 3 deletions
|
|
@ -1055,10 +1055,8 @@ err_bad:
|
|||
*/
|
||||
u32 svc_max_payload(const struct svc_rqst *rqstp)
|
||||
{
|
||||
int max = RPCSVC_MAXPAYLOAD_TCP;
|
||||
u32 max = rqstp->rq_xprt->xpt_class->xcl_max_payload;
|
||||
|
||||
if (rqstp->rq_sock->sk_sock->type == SOCK_DGRAM)
|
||||
max = RPCSVC_MAXPAYLOAD_UDP;
|
||||
if (rqstp->rq_server->sv_max_payload < max)
|
||||
max = rqstp->rq_server->sv_max_payload;
|
||||
return max;
|
||||
|
|
|
|||
|
|
@ -906,6 +906,7 @@ static struct svc_xprt_ops svc_udp_ops = {
|
|||
static struct svc_xprt_class svc_udp_class = {
|
||||
.xcl_name = "udp",
|
||||
.xcl_ops = &svc_udp_ops,
|
||||
.xcl_max_payload = RPCSVC_MAXPAYLOAD_UDP,
|
||||
};
|
||||
|
||||
static void
|
||||
|
|
@ -1359,6 +1360,7 @@ static struct svc_xprt_ops svc_tcp_ops = {
|
|||
static struct svc_xprt_class svc_tcp_class = {
|
||||
.xcl_name = "tcp",
|
||||
.xcl_ops = &svc_tcp_ops,
|
||||
.xcl_max_payload = RPCSVC_MAXPAYLOAD_TCP,
|
||||
};
|
||||
|
||||
void svc_init_xprt_sock(void)
|
||||
|
|
|
|||
Loading…
Reference in a new issue