forked from luck/tmp_suning_uos_patched
nfsd4/rpc: move backchannel create logic into rpc code
Also simplify the logic a bit. Cc: stable@vger.kernel.org Signed-off-by: J. Bruce Fields <bfields@redhat.com> Acked-by: Trond Myklebust <trondmy@primarydata.com>
This commit is contained in:
parent
1208fd569c
commit
d50039ea5e
|
@ -710,22 +710,6 @@ static struct rpc_cred *get_backchannel_cred(struct nfs4_client *clp, struct rpc
|
|||
}
|
||||
}
|
||||
|
||||
static struct rpc_clnt *create_backchannel_client(struct rpc_create_args *args)
|
||||
{
|
||||
struct rpc_xprt *xprt;
|
||||
|
||||
if (args->protocol != XPRT_TRANSPORT_BC_TCP)
|
||||
return rpc_create(args);
|
||||
|
||||
xprt = args->bc_xprt->xpt_bc_xprt;
|
||||
if (xprt) {
|
||||
xprt_get(xprt);
|
||||
return rpc_create_xprt(args, xprt);
|
||||
}
|
||||
|
||||
return rpc_create(args);
|
||||
}
|
||||
|
||||
static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *conn, struct nfsd4_session *ses)
|
||||
{
|
||||
int maxtime = max_cb_time(clp->net);
|
||||
|
@ -768,7 +752,7 @@ static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *c
|
|||
args.authflavor = ses->se_cb_sec.flavor;
|
||||
}
|
||||
/* Create RPC client */
|
||||
client = create_backchannel_client(&args);
|
||||
client = rpc_create(&args);
|
||||
if (IS_ERR(client)) {
|
||||
dprintk("NFSD: couldn't create callback client: %ld\n",
|
||||
PTR_ERR(client));
|
||||
|
|
|
@ -137,8 +137,6 @@ struct rpc_create_args {
|
|||
#define RPC_CLNT_CREATE_NO_RETRANS_TIMEOUT (1UL << 9)
|
||||
|
||||
struct rpc_clnt *rpc_create(struct rpc_create_args *args);
|
||||
struct rpc_clnt *rpc_create_xprt(struct rpc_create_args *args,
|
||||
struct rpc_xprt *xprt);
|
||||
struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *,
|
||||
const struct rpc_program *, u32);
|
||||
struct rpc_clnt *rpc_clone_client(struct rpc_clnt *);
|
||||
|
|
|
@ -446,7 +446,7 @@ static struct rpc_clnt * rpc_new_client(const struct rpc_create_args *args,
|
|||
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;
|
||||
|
@ -484,7 +484,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
|
||||
|
@ -510,6 +509,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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user