mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-05-10 09:15:53 +00:00
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
3 changed files with 11 additions and 21 deletions
|
@ -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)
|
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);
|
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;
|
args.authflavor = ses->se_cb_sec.flavor;
|
||||||
}
|
}
|
||||||
/* Create RPC client */
|
/* Create RPC client */
|
||||||
client = create_backchannel_client(&args);
|
client = rpc_create(&args);
|
||||||
if (IS_ERR(client)) {
|
if (IS_ERR(client)) {
|
||||||
dprintk("NFSD: couldn't create callback client: %ld\n",
|
dprintk("NFSD: couldn't create callback client: %ld\n",
|
||||||
PTR_ERR(client));
|
PTR_ERR(client));
|
||||||
|
|
|
@ -137,8 +137,6 @@ struct rpc_create_args {
|
||||||
#define RPC_CLNT_CREATE_NO_RETRANS_TIMEOUT (1UL << 9)
|
#define RPC_CLNT_CREATE_NO_RETRANS_TIMEOUT (1UL << 9)
|
||||||
|
|
||||||
struct rpc_clnt *rpc_create(struct rpc_create_args *args);
|
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 *,
|
struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *,
|
||||||
const struct rpc_program *, u32);
|
const struct rpc_program *, u32);
|
||||||
struct rpc_clnt *rpc_clone_client(struct rpc_clnt *);
|
struct rpc_clnt *rpc_clone_client(struct rpc_clnt *);
|
||||||
|
|
|
@ -446,7 +446,7 @@ out_no_rpciod:
|
||||||
return ERR_PTR(err);
|
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_xprt *xprt)
|
||||||
{
|
{
|
||||||
struct rpc_clnt *clnt = NULL;
|
struct rpc_clnt *clnt = NULL;
|
||||||
|
@ -484,7 +484,6 @@ struct rpc_clnt *rpc_create_xprt(struct rpc_create_args *args,
|
||||||
|
|
||||||
return clnt;
|
return clnt;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(rpc_create_xprt);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* rpc_create - create an RPC client and transport with one call
|
* 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];
|
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)
|
if (args->flags & RPC_CLNT_CREATE_INFINITE_SLOTS)
|
||||||
xprtargs.flags |= XPRT_CREATE_INFINITE_SLOTS;
|
xprtargs.flags |= XPRT_CREATE_INFINITE_SLOTS;
|
||||||
if (args->flags & RPC_CLNT_CREATE_NO_IDLE_TIMEOUT)
|
if (args->flags & RPC_CLNT_CREATE_NO_IDLE_TIMEOUT)
|
||||||
|
|
Loading…
Add table
Reference in a new issue