diff options
Diffstat (limited to 'fs/nfsd/nfs4callback.c')
-rw-r--r-- | fs/nfsd/nfs4callback.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c index 7f05cd140de3..39c8ef875f91 100644 --- a/fs/nfsd/nfs4callback.c +++ b/fs/nfsd/nfs4callback.c | |||
@@ -32,6 +32,7 @@ | |||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #include <linux/sunrpc/clnt.h> | 34 | #include <linux/sunrpc/clnt.h> |
35 | #include <linux/sunrpc/xprt.h> | ||
35 | #include <linux/sunrpc/svc_xprt.h> | 36 | #include <linux/sunrpc/svc_xprt.h> |
36 | #include <linux/slab.h> | 37 | #include <linux/slab.h> |
37 | #include "nfsd.h" | 38 | #include "nfsd.h" |
@@ -635,6 +636,22 @@ static struct rpc_cred *get_backchannel_cred(struct nfs4_client *clp, struct rpc | |||
635 | } | 636 | } |
636 | } | 637 | } |
637 | 638 | ||
639 | static struct rpc_clnt *create_backchannel_client(struct rpc_create_args *args) | ||
640 | { | ||
641 | struct rpc_xprt *xprt; | ||
642 | |||
643 | if (args->protocol != XPRT_TRANSPORT_BC_TCP) | ||
644 | return rpc_create(args); | ||
645 | |||
646 | xprt = args->bc_xprt->xpt_bc_xprt; | ||
647 | if (xprt) { | ||
648 | xprt_get(xprt); | ||
649 | return rpc_create_xprt(args, xprt); | ||
650 | } | ||
651 | |||
652 | return rpc_create(args); | ||
653 | } | ||
654 | |||
638 | static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *conn, struct nfsd4_session *ses) | 655 | static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *conn, struct nfsd4_session *ses) |
639 | { | 656 | { |
640 | struct rpc_timeout timeparms = { | 657 | struct rpc_timeout timeparms = { |
@@ -674,7 +691,7 @@ static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *c | |||
674 | args.authflavor = ses->se_cb_sec.flavor; | 691 | args.authflavor = ses->se_cb_sec.flavor; |
675 | } | 692 | } |
676 | /* Create RPC client */ | 693 | /* Create RPC client */ |
677 | client = rpc_create(&args); | 694 | client = create_backchannel_client(&args); |
678 | if (IS_ERR(client)) { | 695 | if (IS_ERR(client)) { |
679 | dprintk("NFSD: couldn't create callback client: %ld\n", | 696 | dprintk("NFSD: couldn't create callback client: %ld\n", |
680 | PTR_ERR(client)); | 697 | PTR_ERR(client)); |