Commit d96b9c93 authored by J. Bruce Fields's avatar J. Bruce Fields

svcrpc: autoload rdma module

This should fix failures like:

	# rpc.nfsd --rdma
	rpc.nfsd: Unable to request RDMA services: Protocol not supported
Reported-by: default avatarSteve Dickson <steved@redhat.com>
Reviewed-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent d9e4084f
...@@ -244,13 +244,12 @@ void svc_add_new_perm_xprt(struct svc_serv *serv, struct svc_xprt *new) ...@@ -244,13 +244,12 @@ void svc_add_new_perm_xprt(struct svc_serv *serv, struct svc_xprt *new)
svc_xprt_received(new); svc_xprt_received(new);
} }
int svc_create_xprt(struct svc_serv *serv, const char *xprt_name, int _svc_create_xprt(struct svc_serv *serv, const char *xprt_name,
struct net *net, const int family, struct net *net, const int family,
const unsigned short port, int flags) const unsigned short port, int flags)
{ {
struct svc_xprt_class *xcl; struct svc_xprt_class *xcl;
dprintk("svc: creating transport %s[%d]\n", xprt_name, port);
spin_lock(&svc_xprt_class_lock); spin_lock(&svc_xprt_class_lock);
list_for_each_entry(xcl, &svc_xprt_class_list, xcl_list) { list_for_each_entry(xcl, &svc_xprt_class_list, xcl_list) {
struct svc_xprt *newxprt; struct svc_xprt *newxprt;
...@@ -274,12 +273,28 @@ int svc_create_xprt(struct svc_serv *serv, const char *xprt_name, ...@@ -274,12 +273,28 @@ int svc_create_xprt(struct svc_serv *serv, const char *xprt_name,
} }
err: err:
spin_unlock(&svc_xprt_class_lock); spin_unlock(&svc_xprt_class_lock);
dprintk("svc: transport %s not found\n", xprt_name);
/* This errno is exposed to user space. Provide a reasonable /* This errno is exposed to user space. Provide a reasonable
* perror msg for a bad transport. */ * perror msg for a bad transport. */
return -EPROTONOSUPPORT; return -EPROTONOSUPPORT;
} }
int svc_create_xprt(struct svc_serv *serv, const char *xprt_name,
struct net *net, const int family,
const unsigned short port, int flags)
{
int err;
dprintk("svc: creating transport %s[%d]\n", xprt_name, port);
err = _svc_create_xprt(serv, xprt_name, net, family, port, flags);
if (err == -EPROTONOSUPPORT) {
request_module("svc%s", xprt_name);
err = _svc_create_xprt(serv, xprt_name, net, family, port, flags);
}
if (err)
dprintk("svc: transport %s not found, err %d\n",
xprt_name, err);
return err;
}
EXPORT_SYMBOL_GPL(svc_create_xprt); EXPORT_SYMBOL_GPL(svc_create_xprt);
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment