NFS: Enable client side NFSv4.1 backchannel to use other transports
[linux-block.git] / net / sunrpc / xprtrdma / backchannel.c
index 0b3387fe3f0dc140d86eeaf972d0a9a58f91eb86..2dcb44f69e539e530c208086acb4a1bee6e710ee 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/module.h>
 #include <linux/sunrpc/xprt.h>
 #include <linux/sunrpc/svc.h>
+#include <linux/sunrpc/svc_xprt.h>
 
 #include "xprt_rdma.h"
 
@@ -173,6 +174,26 @@ out_err:
        return -ENOMEM;
 }
 
+/**
+ * xprt_rdma_bc_up - Create transport endpoint for backchannel service
+ * @serv: server endpoint
+ * @net: network namespace
+ *
+ * The "xprt" is an implied argument: it supplies the name of the
+ * backchannel transport class.
+ *
+ * Returns zero on success, negative errno on failure
+ */
+int xprt_rdma_bc_up(struct svc_serv *serv, struct net *net)
+{
+       int ret;
+
+       ret = svc_create_xprt(serv, "rdma-bc", net, PF_INET, 0, 0);
+       if (ret < 0)
+               return ret;
+       return 0;
+}
+
 /**
  * rpcrdma_bc_marshal_reply - Send backwards direction reply
  * @rqst: buffer containing RPC reply data