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: Thu, 30 Sep 2004 21:03:09 -0400 Signed-off-by: Chuck Lever --- fs/lockd/host.c | 3 +-- include/linux/sunrpc/xprt.h | 3 +-- net/sunrpc/clntsock.c | 3 +-- net/sunrpc/xprt.c | 3 +-- 4 files changed, 4 insertions(+), 8 deletions(-) diff -X /home/cel/src/linux/dont-diff -Naurp 27-rpc-tsh_size/fs/lockd/host.c 28-rpc-xprt-stream/fs/lockd/host.c --- 27-rpc-tsh_size/fs/lockd/host.c 2004-09-30 12:34:19.701075000 -0400 +++ 28-rpc-xprt-stream/fs/lockd/host.c 2004-09-30 14:34:50.584951000 -0400 @@ -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 27-rpc-tsh_size/include/linux/sunrpc/xprt.h 28-rpc-xprt-stream/include/linux/sunrpc/xprt.h --- 27-rpc-tsh_size/include/linux/sunrpc/xprt.h 2004-09-30 14:34:02.032398000 -0400 +++ 28-rpc-xprt-stream/include/linux/sunrpc/xprt.h 2004-09-30 14:34:50.588944000 -0400 @@ -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 27-rpc-tsh_size/net/sunrpc/clntsock.c 28-rpc-xprt-stream/net/sunrpc/clntsock.c --- 27-rpc-tsh_size/net/sunrpc/clntsock.c 2004-09-30 14:34:02.042392000 -0400 +++ 28-rpc-xprt-stream/net/sunrpc/clntsock.c 2004-09-30 14:34:50.591940000 -0400 @@ -355,6 +355,7 @@ static fastcall int xprt_sock_tcp_send_r break; default: printk(KERN_NOTICE "RPC: sendmsg returned error %d\n", -status); + xprt_disconnect(xprt); break; } @@ -1132,7 +1133,6 @@ int xprt_sock_setup_udp(struct rpc_xprt xprt->prot = IPPROTO_UDP; xprt->port = XPRT_SOCK_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; @@ -1174,7 +1174,6 @@ int xprt_sock_setup_tcp(struct rpc_xprt xprt->prot = IPPROTO_TCP; xprt->port = XPRT_SOCK_MAX_RESVPORT; xprt->tsh_size = sizeof(rpc_stream_record_marker_t); - xprt->stream = 1; xprt->nocong = 1; xprt->cwnd = RPC_MAXCWND(xprt); xprt->resvport = capable(CAP_NET_BIND_SERVICE) ? 1 : 0; diff -X /home/cel/src/linux/dont-diff -Naurp 27-rpc-tsh_size/net/sunrpc/xprt.c 28-rpc-xprt-stream/net/sunrpc/xprt.c --- 27-rpc-tsh_size/net/sunrpc/xprt.c 2004-09-30 14:30:48.711298000 -0400 +++ 28-rpc-xprt-stream/net/sunrpc/xprt.c 2004-09-30 14:34:50.594943000 -0400 @@ -579,8 +579,7 @@ xprt_transmit(struct rpc_task *task) case -ENOTCONN: return; default: - if (xprt->stream) - xprt_disconnect(xprt); + break; } xprt_release_write(xprt, task); }