diff options
| author | Trond Myklebust <trond.myklebust@primarydata.com> | 2016-07-24 12:51:10 -0400 | 
|---|---|---|
| committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2016-07-24 12:51:10 -0400 | 
| commit | dc05973b288a5226bb7e56afd6c2fa07560a907c (patch) | |
| tree | 2e1eade8b6010ff4c844341fdeec9ee966d75ac7 /net/sunrpc/clnt.c | |
| parent | 297fae4d0bee5d683533f3324baf1b363e7b48bf (diff) | |
| parent | e7bdea7750eb2a64aea4a08fa5c0a31719c8155d (diff) | |
Merge commit 'e7bdea7750eb'
Needed in order to work on top of pNFS changes in Linus' upstream kernel.
Diffstat (limited to 'net/sunrpc/clnt.c')
| -rw-r--r-- | net/sunrpc/clnt.c | 31 | 
1 files changed, 25 insertions, 6 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 06b4df9faaa1..2808d550d273 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -446,16 +446,27 @@ out_no_rpciod:  	return ERR_PTR(err);  } -struct rpc_clnt *rpc_create_xprt(struct rpc_create_args *args, +static struct rpc_clnt *rpc_create_xprt(struct rpc_create_args *args,  					struct rpc_xprt *xprt)  {  	struct rpc_clnt *clnt = NULL;  	struct rpc_xprt_switch *xps; -	xps = xprt_switch_alloc(xprt, GFP_KERNEL); -	if (xps == NULL) -		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))  		return clnt; @@ -483,7 +494,6 @@ struct rpc_clnt *rpc_create_xprt(struct rpc_create_args *args,  	return clnt;  } -EXPORT_SYMBOL_GPL(rpc_create_xprt);  /**   * rpc_create - create an RPC client and transport with one call @@ -509,6 +519,15 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args)  	};  	char servername[48]; +	if (args->bc_xprt) { +		WARN_ON(args->protocol != XPRT_TRANSPORT_BC_TCP); +		xprt = args->bc_xprt->xpt_bc_xprt; +		if (xprt) { +			xprt_get(xprt); +			return rpc_create_xprt(args, xprt); +		} +	} +  	if (args->flags & RPC_CLNT_CREATE_INFINITE_SLOTS)  		xprtargs.flags |= XPRT_CREATE_INFINITE_SLOTS;  	if (args->flags & RPC_CLNT_CREATE_NO_IDLE_TIMEOUT)  | 
