diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2009-03-18 20:46:21 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-03-28 15:54:36 -0400 |
commit | 9652ada3fb5914a67d8422114e8a76388330fa79 (patch) | |
tree | b37d77bf972dda04b46794c4e50ec6f6d044dc79 /net/sunrpc/svc_xprt.c | |
parent | baf01caf09e87579c2d157e5ee29975db8551522 (diff) |
SUNRPC: Change svc_create_xprt() to take a @family argument
The sv_family field is going away. Pass a protocol family argument to
svc_create_xprt() instead of extracting the family from the passed-in
svc_serv struct.
Again, as this is a listener socket and not an address, we make this
new argument an "int" protocol family, instead of an "sa_family_t."
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/svc_xprt.c')
-rw-r--r-- | net/sunrpc/svc_xprt.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index c947c93dbc24..2819ee093f36 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c | |||
@@ -161,7 +161,9 @@ EXPORT_SYMBOL_GPL(svc_xprt_init); | |||
161 | 161 | ||
162 | static struct svc_xprt *__svc_xpo_create(struct svc_xprt_class *xcl, | 162 | static struct svc_xprt *__svc_xpo_create(struct svc_xprt_class *xcl, |
163 | struct svc_serv *serv, | 163 | struct svc_serv *serv, |
164 | unsigned short port, int flags) | 164 | const int family, |
165 | const unsigned short port, | ||
166 | int flags) | ||
165 | { | 167 | { |
166 | struct sockaddr_in sin = { | 168 | struct sockaddr_in sin = { |
167 | .sin_family = AF_INET, | 169 | .sin_family = AF_INET, |
@@ -176,12 +178,12 @@ static struct svc_xprt *__svc_xpo_create(struct svc_xprt_class *xcl, | |||
176 | struct sockaddr *sap; | 178 | struct sockaddr *sap; |
177 | size_t len; | 179 | size_t len; |
178 | 180 | ||
179 | switch (serv->sv_family) { | 181 | switch (family) { |
180 | case AF_INET: | 182 | case PF_INET: |
181 | sap = (struct sockaddr *)&sin; | 183 | sap = (struct sockaddr *)&sin; |
182 | len = sizeof(sin); | 184 | len = sizeof(sin); |
183 | break; | 185 | break; |
184 | case AF_INET6: | 186 | case PF_INET6: |
185 | sap = (struct sockaddr *)&sin6; | 187 | sap = (struct sockaddr *)&sin6; |
186 | len = sizeof(sin6); | 188 | len = sizeof(sin6); |
187 | break; | 189 | break; |
@@ -192,7 +194,8 @@ static struct svc_xprt *__svc_xpo_create(struct svc_xprt_class *xcl, | |||
192 | return xcl->xcl_ops->xpo_create(serv, sap, len, flags); | 194 | return xcl->xcl_ops->xpo_create(serv, sap, len, flags); |
193 | } | 195 | } |
194 | 196 | ||
195 | int svc_create_xprt(struct svc_serv *serv, char *xprt_name, unsigned short port, | 197 | int svc_create_xprt(struct svc_serv *serv, const char *xprt_name, |
198 | const int family, const unsigned short port, | ||
196 | int flags) | 199 | int flags) |
197 | { | 200 | { |
198 | struct svc_xprt_class *xcl; | 201 | struct svc_xprt_class *xcl; |
@@ -209,7 +212,7 @@ int svc_create_xprt(struct svc_serv *serv, char *xprt_name, unsigned short port, | |||
209 | goto err; | 212 | goto err; |
210 | 213 | ||
211 | spin_unlock(&svc_xprt_class_lock); | 214 | spin_unlock(&svc_xprt_class_lock); |
212 | newxprt = __svc_xpo_create(xcl, serv, port, flags); | 215 | newxprt = __svc_xpo_create(xcl, serv, family, port, flags); |
213 | if (IS_ERR(newxprt)) { | 216 | if (IS_ERR(newxprt)) { |
214 | module_put(xcl->xcl_owner); | 217 | module_put(xcl->xcl_owner); |
215 | return PTR_ERR(newxprt); | 218 | return PTR_ERR(newxprt); |