Subject: [PATCH] RPC: get rid of xprt->stream Description: Now we can remove the last few places that use the "xprt->stream" variable, and get rid of it from the rpc_xprt structure. Test-plan: Destructive testing (unplugging the network temporarily). Connectathon with UDP and TCP. Created: Sun, 05 Dec 2004 23:16:45 -0500 Signed-off-by: Chuck Lever --- fs/lockd/host.c | 3 +-- include/linux/sunrpc/xprt.h | 3 +-- net/sunrpc/xprt.c | 3 +-- net/sunrpc/xprtsock.c | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff -X /home/cel/src/linux/dont-diff -Naurp 33-rpc-tsh_size/fs/lockd/host.c 34-rpc-xprt-stream/fs/lockd/host.c --- 33-rpc-tsh_size/fs/lockd/host.c 2004-10-18 17:54:31.000000000 -0400 +++ 34-rpc-xprt-stream/fs/lockd/host.c 2004-12-02 16:15:54.409321000 -0500 @@ -178,11 +178,10 @@ nlm_bind_host(struct nlm_host *host) /* If we've already created an RPC client, check whether * RPC rebind is required - * Note: why keep rebinding if we're on a tcp connection? */ if ((clnt = host->h_rpcclnt) != NULL) { xprt = clnt->cl_xprt; - if (!xprt->stream && time_after_eq(jiffies, host->h_nextrebind)) { + if (time_after_eq(jiffies, host->h_nextrebind)) { clnt->cl_port = 0; host->h_nextrebind = jiffies + NLM_HOST_REBIND; dprintk("lockd: next rebind in %ld jiffies\n", diff -X /home/cel/src/linux/dont-diff -Naurp 33-rpc-tsh_size/include/linux/sunrpc/xprt.h 34-rpc-xprt-stream/include/linux/sunrpc/xprt.h --- 33-rpc-tsh_size/include/linux/sunrpc/xprt.h 2004-12-05 22:57:50.417340000 -0500 +++ 34-rpc-xprt-stream/include/linux/sunrpc/xprt.h 2004-12-05 22:57:54.242178000 -0500 @@ -168,8 +168,7 @@ struct rpc_xprt { unsigned long state; /* transport state */ unsigned char shutdown : 1, /* being shut down */ nocong : 1, /* no congestion control */ - resvport : 1, /* use a reserved port */ - stream : 1; /* TCP */ + resvport : 1; /* use a reserved port */ /* * XID diff -X /home/cel/src/linux/dont-diff -Naurp 33-rpc-tsh_size/net/sunrpc/xprt.c 34-rpc-xprt-stream/net/sunrpc/xprt.c --- 33-rpc-tsh_size/net/sunrpc/xprt.c 2004-12-02 16:02:59.591553000 -0500 +++ 34-rpc-xprt-stream/net/sunrpc/xprt.c 2004-12-02 16:15:54.420319000 -0500 @@ -578,8 +578,7 @@ xprt_transmit(struct rpc_task *task) case -ENOTCONN: return; default: - if (xprt->stream) - xprt_disconnect(xprt); + break; } xprt_release_write(xprt, task); } diff -X /home/cel/src/linux/dont-diff -Naurp 33-rpc-tsh_size/net/sunrpc/xprtsock.c 34-rpc-xprt-stream/net/sunrpc/xprtsock.c --- 33-rpc-tsh_size/net/sunrpc/xprtsock.c 2004-12-05 18:10:08.137090000 -0500 +++ 34-rpc-xprt-stream/net/sunrpc/xprtsock.c 2004-12-05 18:10:27.935270000 -0500 @@ -357,6 +357,7 @@ static fastcall int xs_tcp_send_request( break; default: printk(KERN_NOTICE "RPC: sendmsg returned error %d\n", -status); + xprt_disconnect(xprt); break; } @@ -1130,7 +1131,6 @@ int xs_setup_udp(struct rpc_xprt *xprt, xprt->prot = IPPROTO_UDP; xprt->port = XS_MAX_RESVPORT; xprt->tsh_size = 0; - xprt->stream = 0; xprt->nocong = 0; xprt->cwnd = RPC_INITCWND; xprt->resvport = capable(CAP_NET_BIND_SERVICE) ? 1 : 0; @@ -1171,7 +1171,6 @@ int xs_setup_tcp(struct rpc_xprt *xprt, xprt->prot = IPPROTO_TCP; xprt->port = XS_MAX_RESVPORT; xprt->tsh_size = sizeof(rpc_fraghdr); - xprt->stream = 1; xprt->nocong = 1; xprt->cwnd = RPC_MAXCWND(xprt); xprt->resvport = capable(CAP_NET_BIND_SERVICE) ? 1 : 0;