提交 fc5d00b0 编写于 作者: P Pavel Emelyanov 提交者: J. Bruce Fields

sunrpc: Add net argument to svc_create_xprt

Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
上级 e204e621
...@@ -206,7 +206,7 @@ static int create_lockd_listener(struct svc_serv *serv, const char *name, ...@@ -206,7 +206,7 @@ static int create_lockd_listener(struct svc_serv *serv, const char *name,
xprt = svc_find_xprt(serv, name, family, 0); xprt = svc_find_xprt(serv, name, family, 0);
if (xprt == NULL) if (xprt == NULL)
return svc_create_xprt(serv, name, family, port, return svc_create_xprt(serv, name, &init_net, family, port,
SVC_SOCK_DEFAULTS); SVC_SOCK_DEFAULTS);
svc_xprt_put(xprt); svc_xprt_put(xprt);
return 0; return 0;
......
...@@ -109,7 +109,7 @@ nfs4_callback_up(struct svc_serv *serv) ...@@ -109,7 +109,7 @@ nfs4_callback_up(struct svc_serv *serv)
{ {
int ret; int ret;
ret = svc_create_xprt(serv, "tcp", PF_INET, ret = svc_create_xprt(serv, "tcp", &init_net, PF_INET,
nfs_callback_set_tcpport, SVC_SOCK_ANONYMOUS); nfs_callback_set_tcpport, SVC_SOCK_ANONYMOUS);
if (ret <= 0) if (ret <= 0)
goto out_err; goto out_err;
...@@ -117,7 +117,7 @@ nfs4_callback_up(struct svc_serv *serv) ...@@ -117,7 +117,7 @@ nfs4_callback_up(struct svc_serv *serv)
dprintk("NFS: Callback listener port = %u (af %u)\n", dprintk("NFS: Callback listener port = %u (af %u)\n",
nfs_callback_tcpport, PF_INET); nfs_callback_tcpport, PF_INET);
ret = svc_create_xprt(serv, "tcp", PF_INET6, ret = svc_create_xprt(serv, "tcp", &init_net, PF_INET6,
nfs_callback_set_tcpport, SVC_SOCK_ANONYMOUS); nfs_callback_set_tcpport, SVC_SOCK_ANONYMOUS);
if (ret > 0) { if (ret > 0) {
nfs_callback_tcpport6 = ret; nfs_callback_tcpport6 = ret;
......
...@@ -1015,12 +1015,12 @@ static ssize_t __write_ports_addxprt(char *buf) ...@@ -1015,12 +1015,12 @@ static ssize_t __write_ports_addxprt(char *buf)
if (err != 0) if (err != 0)
return err; return err;
err = svc_create_xprt(nfsd_serv, transport, err = svc_create_xprt(nfsd_serv, transport, &init_net,
PF_INET, port, SVC_SOCK_ANONYMOUS); PF_INET, port, SVC_SOCK_ANONYMOUS);
if (err < 0) if (err < 0)
goto out_err; goto out_err;
err = svc_create_xprt(nfsd_serv, transport, err = svc_create_xprt(nfsd_serv, transport, &init_net,
PF_INET6, port, SVC_SOCK_ANONYMOUS); PF_INET6, port, SVC_SOCK_ANONYMOUS);
if (err < 0 && err != -EAFNOSUPPORT) if (err < 0 && err != -EAFNOSUPPORT)
goto out_close; goto out_close;
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <linux/lockd/bind.h> #include <linux/lockd/bind.h>
#include <linux/nfsacl.h> #include <linux/nfsacl.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <net/net_namespace.h>
#include "nfsd.h" #include "nfsd.h"
#include "cache.h" #include "cache.h"
#include "vfs.h" #include "vfs.h"
...@@ -186,12 +187,12 @@ static int nfsd_init_socks(int port) ...@@ -186,12 +187,12 @@ static int nfsd_init_socks(int port)
if (!list_empty(&nfsd_serv->sv_permsocks)) if (!list_empty(&nfsd_serv->sv_permsocks))
return 0; return 0;
error = svc_create_xprt(nfsd_serv, "udp", PF_INET, port, error = svc_create_xprt(nfsd_serv, "udp", &init_net, PF_INET, port,
SVC_SOCK_DEFAULTS); SVC_SOCK_DEFAULTS);
if (error < 0) if (error < 0)
return error; return error;
error = svc_create_xprt(nfsd_serv, "tcp", PF_INET, port, error = svc_create_xprt(nfsd_serv, "tcp", &init_net, PF_INET, port,
SVC_SOCK_DEFAULTS); SVC_SOCK_DEFAULTS);
if (error < 0) if (error < 0)
return error; return error;
......
...@@ -74,8 +74,8 @@ int svc_reg_xprt_class(struct svc_xprt_class *); ...@@ -74,8 +74,8 @@ int svc_reg_xprt_class(struct svc_xprt_class *);
void svc_unreg_xprt_class(struct svc_xprt_class *); void svc_unreg_xprt_class(struct svc_xprt_class *);
void svc_xprt_init(struct svc_xprt_class *, struct svc_xprt *, void svc_xprt_init(struct svc_xprt_class *, struct svc_xprt *,
struct svc_serv *); struct svc_serv *);
int svc_create_xprt(struct svc_serv *, const char *, const int, int svc_create_xprt(struct svc_serv *, const char *, struct net *,
const unsigned short, int); const int, const unsigned short, int);
void svc_xprt_enqueue(struct svc_xprt *xprt); void svc_xprt_enqueue(struct svc_xprt *xprt);
void svc_xprt_received(struct svc_xprt *); void svc_xprt_received(struct svc_xprt *);
void svc_xprt_put(struct svc_xprt *xprt); void svc_xprt_put(struct svc_xprt *xprt);
......
...@@ -204,8 +204,8 @@ static struct svc_xprt *__svc_xpo_create(struct svc_xprt_class *xcl, ...@@ -204,8 +204,8 @@ static struct svc_xprt *__svc_xpo_create(struct svc_xprt_class *xcl,
} }
int svc_create_xprt(struct svc_serv *serv, const char *xprt_name, int svc_create_xprt(struct svc_serv *serv, const char *xprt_name,
const int family, const unsigned short port, struct net *net, const int family,
int flags) const unsigned short port, int flags)
{ {
struct svc_xprt_class *xcl; struct svc_xprt_class *xcl;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册