[RFC 73/85] nfs41: Setup the backchannel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ricardo Labiaga <ricardo.labiaga@xxxxxxxxxx>

The NFS v4.1 callback service has already been setup, and
rpc_xprt->serv points to the svc_serv structure describing it.
Invoke the xprt_setup_backchannel() initialization to pre-
allocate the necessary backchannel structures.

Signed-off-by: Ricardo Labiaga <ricardo.labiaga@xxxxxxxxxx>
Signed-off-by: Benny Halevy <bhalevy@xxxxxxxxxxx>
---
 fs/nfs/client.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index dc5b6e7..2a24d43 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -39,6 +39,7 @@
 #include <linux/nfs_xdr.h>
 #if defined(CONFIG_NFS_V4_1)
 #include <linux/nfs41_session_recovery.h>
+#include <linux/sunrpc/bc_xprt.h>
 #endif /* CONFIG_NFS_V4_1 */
 
 #include <asm/system.h>
@@ -1125,7 +1126,7 @@ error:
 }
 
 /*
- * Allocate and initialize a session if required
+ * Allocate and initialize a session if required, including its backchannel.
  */
 int nfs4_init_session(struct nfs_client *clp, struct rpc_clnt *clnt)
 {
@@ -1145,6 +1146,12 @@ int nfs4_init_session(struct nfs_client *clp, struct rpc_clnt *clnt)
 		else {
 			session->clnt = clnt;
 			session->clp = clp;
+
+			error = xprt_setup_backchannel(clnt->cl_xprt,
+					NFS41_BC_MIN_CALLBACKS);
+			if (error < 0)
+				/* nfs4_put session sets the session to NULL */
+				nfs4_put_session(&session);
 		}
 		clp->cl_session = session;
 	}
-- 
1.6.0.2

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux