diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-04-01 13:28:15 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-04-01 13:28:15 -0400 |
commit | cc85906110e26fe8537c3bdbc08a74ae8110030b (patch) | |
tree | 891813098ede3dba4d5ff3b83b1f7b491367ad2f /fs/nfs/callback.c | |
parent | c09bca786ff941ed17c5f381c4eca5b106808c51 (diff) | |
parent | c69da774b28e01e062e0a3aba7509f2dcfd2a11a (diff) |
Merge branch 'devel' into for-linus
Diffstat (limited to 'fs/nfs/callback.c')
-rw-r--r-- | fs/nfs/callback.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c index 3e634f2a1083..a886e692ddd0 100644 --- a/fs/nfs/callback.c +++ b/fs/nfs/callback.c | |||
@@ -38,19 +38,10 @@ static struct svc_program nfs4_callback_program; | |||
38 | 38 | ||
39 | unsigned int nfs_callback_set_tcpport; | 39 | unsigned int nfs_callback_set_tcpport; |
40 | unsigned short nfs_callback_tcpport; | 40 | unsigned short nfs_callback_tcpport; |
41 | unsigned short nfs_callback_tcpport6; | ||
41 | static const int nfs_set_port_min = 0; | 42 | static const int nfs_set_port_min = 0; |
42 | static const int nfs_set_port_max = 65535; | 43 | static const int nfs_set_port_max = 65535; |
43 | 44 | ||
44 | /* | ||
45 | * If the kernel has IPv6 support available, always listen for | ||
46 | * both AF_INET and AF_INET6 requests. | ||
47 | */ | ||
48 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
49 | static const sa_family_t nfs_callback_family = AF_INET6; | ||
50 | #else | ||
51 | static const sa_family_t nfs_callback_family = AF_INET; | ||
52 | #endif | ||
53 | |||
54 | static int param_set_port(const char *val, struct kernel_param *kp) | 45 | static int param_set_port(const char *val, struct kernel_param *kp) |
55 | { | 46 | { |
56 | char *endp; | 47 | char *endp; |
@@ -116,19 +107,29 @@ int nfs_callback_up(void) | |||
116 | mutex_lock(&nfs_callback_mutex); | 107 | mutex_lock(&nfs_callback_mutex); |
117 | if (nfs_callback_info.users++ || nfs_callback_info.task != NULL) | 108 | if (nfs_callback_info.users++ || nfs_callback_info.task != NULL) |
118 | goto out; | 109 | goto out; |
119 | serv = svc_create(&nfs4_callback_program, NFS4_CALLBACK_BUFSIZE, | 110 | serv = svc_create(&nfs4_callback_program, NFS4_CALLBACK_BUFSIZE, NULL); |
120 | nfs_callback_family, NULL); | ||
121 | ret = -ENOMEM; | 111 | ret = -ENOMEM; |
122 | if (!serv) | 112 | if (!serv) |
123 | goto out_err; | 113 | goto out_err; |
124 | 114 | ||
125 | ret = svc_create_xprt(serv, "tcp", nfs_callback_set_tcpport, | 115 | ret = svc_create_xprt(serv, "tcp", PF_INET, |
126 | SVC_SOCK_ANONYMOUS); | 116 | nfs_callback_set_tcpport, SVC_SOCK_ANONYMOUS); |
127 | if (ret <= 0) | 117 | if (ret <= 0) |
128 | goto out_err; | 118 | goto out_err; |
129 | nfs_callback_tcpport = ret; | 119 | nfs_callback_tcpport = ret; |
130 | dprintk("NFS: Callback listener port = %u (af %u)\n", | 120 | dprintk("NFS: Callback listener port = %u (af %u)\n", |
131 | nfs_callback_tcpport, nfs_callback_family); | 121 | nfs_callback_tcpport, PF_INET); |
122 | |||
123 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
124 | ret = svc_create_xprt(serv, "tcp", PF_INET6, | ||
125 | nfs_callback_set_tcpport, SVC_SOCK_ANONYMOUS); | ||
126 | if (ret > 0) { | ||
127 | nfs_callback_tcpport6 = ret; | ||
128 | dprintk("NFS: Callback listener port = %u (af %u)\n", | ||
129 | nfs_callback_tcpport6, PF_INET6); | ||
130 | } else if (ret != -EAFNOSUPPORT) | ||
131 | goto out_err; | ||
132 | #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ | ||
132 | 133 | ||
133 | nfs_callback_info.rqst = svc_prepare_thread(serv, &serv->sv_pools[0]); | 134 | nfs_callback_info.rqst = svc_prepare_thread(serv, &serv->sv_pools[0]); |
134 | if (IS_ERR(nfs_callback_info.rqst)) { | 135 | if (IS_ERR(nfs_callback_info.rqst)) { |