]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
svc: Add a max payload value to the transport
authorTom Tucker <tom@opengridcomputing.com>
Mon, 31 Dec 2007 03:07:21 +0000 (21:07 -0600)
committerJ. Bruce Fields <bfields@citi.umich.edu>
Fri, 1 Feb 2008 21:42:08 +0000 (16:42 -0500)
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 <tom@opengridcomputing.com>
Acked-by: Neil Brown <neilb@suse.de>
Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
Reviewed-by: Greg Banks <gnb@sgi.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
include/linux/sunrpc/svc_xprt.h
net/sunrpc/svc.c
net/sunrpc/svcsock.c

index fe8e787bb95d870d5f19f622ba4b90b8b7b8eaa9..187dc4e2e2022e6ac00e33d05ed3c1fb2cc30eac 100644 (file)
@@ -17,6 +17,7 @@ struct svc_xprt_class {
        struct module           *xcl_owner;
        struct svc_xprt_ops     *xcl_ops;
        struct list_head        xcl_list;
+       u32                     xcl_max_payload;
 };
 
 struct svc_xprt {
index 4ad5fbbb18b48df0d2ad9a0b457212a6c764330d..94eed9b800382321b1732d06b3e98d16bc615616 100644 (file)
@@ -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;
index 54f1b3d993a650e485544f9d159adbe4c1af4671..c507f6f8ee545c116be598cd673d71420296bcf0 100644 (file)
@@ -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)