|
@@ -452,10 +452,20 @@ static struct rpc_clnt *rpc_create_xprt(struct rpc_create_args *args,
|
|
|
struct rpc_clnt *clnt = NULL;
|
|
|
struct rpc_xprt_switch *xps;
|
|
|
|
|
|
- xps = xprt_switch_alloc(xprt, GFP_KERNEL);
|
|
|
- if (xps == NULL) {
|
|
|
- xprt_put(xprt);
|
|
|
- return ERR_PTR(-ENOMEM);
|
|
|
+ if (args->bc_xprt && args->bc_xprt->xpt_bc_xps) {
|
|
|
+ WARN_ON(args->protocol != XPRT_TRANSPORT_BC_TCP);
|
|
|
+ xps = args->bc_xprt->xpt_bc_xps;
|
|
|
+ xprt_switch_get(xps);
|
|
|
+ } else {
|
|
|
+ xps = xprt_switch_alloc(xprt, GFP_KERNEL);
|
|
|
+ if (xps == NULL) {
|
|
|
+ xprt_put(xprt);
|
|
|
+ return ERR_PTR(-ENOMEM);
|
|
|
+ }
|
|
|
+ if (xprt->bc_xprt) {
|
|
|
+ xprt_switch_get(xps);
|
|
|
+ xprt->bc_xprt->xpt_bc_xps = xps;
|
|
|
+ }
|
|
|
}
|
|
|
clnt = rpc_new_client(args, xps, xprt, NULL);
|
|
|
if (IS_ERR(clnt))
|