Skip to contentSkip to conversation

SUNRPC: Add a helper to switch the transport of an rpc_clnt

PATCH New Chuck Lever 1 participant 1 message Jul 19, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 SUNRPC: Add a helper to switch the transport of an rpc_clnt

From: Trond Myklebust <[email protected]>

[ cel: forward ported to 3.11 ]

---

I changed this patch slightly to ensure that on an error return, rpc_switch_client_transport() hasn't mangled the clnt so that it cannot be used again.

I don't want to leave the upper layers with a clnt that can't be used for a retry, or that might cause an unexplained hang rather than an immediate error exit.

Does this seem reasonable?

 include/linux/sunrpc/clnt.h |    4 ++
 net/sunrpc/clnt.c           |   87 ++++++++++++++++++++++++++++++++++++++++---
 2 files changed, 85 insertions(+), 6 deletions(-)
include/linux/sunrpc/clnt.h +4 -0
index bfe11be..29bb018 100644
@@ -134,6 +134,10 @@ void rpc_task_reset_client(struct rpc_task *task, struct rpc_clnt *clnt);
 struct rpc_clnt *rpc_clone_client(struct rpc_clnt *);
 struct rpc_clnt *rpc_clone_client_set_auth(struct rpc_clnt *,
 				rpc_authflavor_t);
+int		rpc_switch_client_transport(struct rpc_clnt *,
+				struct xprt_create *,
+				const struct rpc_timeout *);
+
 void		rpc_shutdown_client(struct rpc_clnt *);
 void		rpc_release_client(struct rpc_clnt *);
 void		rpc_task_release_client(struct rpc_task *);
net/sunrpc/clnt.c +81 -6

128 lines not on this page · raw message