diff options
| author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-11-02 23:56:40 -0400 |
|---|---|---|
| committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-11-02 23:56:40 -0400 |
| commit | 31cbecb4ab538f433145bc5a46f3bea9b9627031 (patch) | |
| tree | d6206d42dea7298f7ef05fd1f7bf474245f0d43a /include/linux/sunrpc | |
| parent | 2b72c9ccd22c4a3299e5a358dcd639fb253730f4 (diff) | |
| parent | 278c023a99b0d6b471d0f4a79835c703482e29ac (diff) | |
Merge branch 'osd-devel' into nfs-for-next
Diffstat (limited to 'include/linux/sunrpc')
| -rw-r--r-- | include/linux/sunrpc/clnt.h | 8 | ||||
| -rw-r--r-- | include/linux/sunrpc/svc.h | 32 |
2 files changed, 29 insertions, 11 deletions
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index ad09bed239f..3d8f9c44e27 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
| @@ -221,7 +221,13 @@ static inline bool __rpc_cmp_addr6(const struct sockaddr *sap1, | |||
| 221 | { | 221 | { |
| 222 | const struct sockaddr_in6 *sin1 = (const struct sockaddr_in6 *)sap1; | 222 | const struct sockaddr_in6 *sin1 = (const struct sockaddr_in6 *)sap1; |
| 223 | const struct sockaddr_in6 *sin2 = (const struct sockaddr_in6 *)sap2; | 223 | const struct sockaddr_in6 *sin2 = (const struct sockaddr_in6 *)sap2; |
| 224 | return ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr); | 224 | |
| 225 | if (!ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr)) | ||
| 226 | return false; | ||
| 227 | else if (ipv6_addr_type(&sin1->sin6_addr) & IPV6_ADDR_LINKLOCAL) | ||
| 228 | return sin1->sin6_scope_id == sin2->sin6_scope_id; | ||
| 229 | |||
| 230 | return true; | ||
| 225 | } | 231 | } |
| 226 | 232 | ||
| 227 | static inline bool __rpc_copy_addr6(struct sockaddr *dst, | 233 | static inline bool __rpc_copy_addr6(struct sockaddr *dst, |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 5e71a306216..35b37b1e929 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
| @@ -212,11 +212,6 @@ static inline void svc_putu32(struct kvec *iov, __be32 val) | |||
| 212 | iov->iov_len += sizeof(__be32); | 212 | iov->iov_len += sizeof(__be32); |
| 213 | } | 213 | } |
| 214 | 214 | ||
| 215 | union svc_addr_u { | ||
| 216 | struct in_addr addr; | ||
| 217 | struct in6_addr addr6; | ||
| 218 | }; | ||
| 219 | |||
| 220 | /* | 215 | /* |
| 221 | * The context of a single thread, including the request currently being | 216 | * The context of a single thread, including the request currently being |
| 222 | * processed. | 217 | * processed. |
| @@ -225,8 +220,12 @@ struct svc_rqst { | |||
| 225 | struct list_head rq_list; /* idle list */ | 220 | struct list_head rq_list; /* idle list */ |
| 226 | struct list_head rq_all; /* all threads list */ | 221 | struct list_head rq_all; /* all threads list */ |
| 227 | struct svc_xprt * rq_xprt; /* transport ptr */ | 222 | struct svc_xprt * rq_xprt; /* transport ptr */ |
| 223 | |||
| 228 | struct sockaddr_storage rq_addr; /* peer address */ | 224 | struct sockaddr_storage rq_addr; /* peer address */ |
| 229 | size_t rq_addrlen; | 225 | size_t rq_addrlen; |
| 226 | struct sockaddr_storage rq_daddr; /* dest addr of request | ||
| 227 | * - reply from here */ | ||
| 228 | size_t rq_daddrlen; | ||
| 230 | 229 | ||
| 231 | struct svc_serv * rq_server; /* RPC service definition */ | 230 | struct svc_serv * rq_server; /* RPC service definition */ |
| 232 | struct svc_pool * rq_pool; /* thread pool */ | 231 | struct svc_pool * rq_pool; /* thread pool */ |
| @@ -255,9 +254,6 @@ struct svc_rqst { | |||
| 255 | unsigned short | 254 | unsigned short |
| 256 | rq_secure : 1; /* secure port */ | 255 | rq_secure : 1; /* secure port */ |
| 257 | 256 | ||
| 258 | union svc_addr_u rq_daddr; /* dest addr of request | ||
| 259 | * - reply from here */ | ||
| 260 | |||
| 261 | void * rq_argp; /* decoded arguments */ | 257 | void * rq_argp; /* decoded arguments */ |
| 262 | void * rq_resp; /* xdr'd results */ | 258 | void * rq_resp; /* xdr'd results */ |
| 263 | void * rq_auth_data; /* flavor-specific data */ | 259 | void * rq_auth_data; /* flavor-specific data */ |
| @@ -300,6 +296,21 @@ static inline struct sockaddr *svc_addr(const struct svc_rqst *rqst) | |||
| 300 | return (struct sockaddr *) &rqst->rq_addr; | 296 | return (struct sockaddr *) &rqst->rq_addr; |
| 301 | } | 297 | } |
| 302 | 298 | ||
| 299 | static inline struct sockaddr_in *svc_daddr_in(const struct svc_rqst *rqst) | ||
| 300 | { | ||
| 301 | return (struct sockaddr_in *) &rqst->rq_daddr; | ||
| 302 | } | ||
| 303 | |||
| 304 | static inline struct sockaddr_in6 *svc_daddr_in6(const struct svc_rqst *rqst) | ||
| 305 | { | ||
| 306 | return (struct sockaddr_in6 *) &rqst->rq_daddr; | ||
| 307 | } | ||
| 308 | |||
| 309 | static inline struct sockaddr *svc_daddr(const struct svc_rqst *rqst) | ||
| 310 | { | ||
| 311 | return (struct sockaddr *) &rqst->rq_daddr; | ||
| 312 | } | ||
| 313 | |||
| 303 | /* | 314 | /* |
| 304 | * Check buffer bounds after decoding arguments | 315 | * Check buffer bounds after decoding arguments |
| 305 | */ | 316 | */ |
| @@ -340,7 +351,8 @@ struct svc_deferred_req { | |||
| 340 | struct svc_xprt *xprt; | 351 | struct svc_xprt *xprt; |
| 341 | struct sockaddr_storage addr; /* where reply must go */ | 352 | struct sockaddr_storage addr; /* where reply must go */ |
| 342 | size_t addrlen; | 353 | size_t addrlen; |
| 343 | union svc_addr_u daddr; /* where reply must come from */ | 354 | struct sockaddr_storage daddr; /* where reply must come from */ |
| 355 | size_t daddrlen; | ||
| 344 | struct cache_deferred_req handle; | 356 | struct cache_deferred_req handle; |
| 345 | size_t xprt_hlen; | 357 | size_t xprt_hlen; |
| 346 | int argslen; | 358 | int argslen; |
| @@ -405,7 +417,7 @@ void svc_rpcb_cleanup(struct svc_serv *serv); | |||
| 405 | struct svc_serv *svc_create(struct svc_program *, unsigned int, | 417 | struct svc_serv *svc_create(struct svc_program *, unsigned int, |
| 406 | void (*shutdown)(struct svc_serv *)); | 418 | void (*shutdown)(struct svc_serv *)); |
| 407 | struct svc_rqst *svc_prepare_thread(struct svc_serv *serv, | 419 | struct svc_rqst *svc_prepare_thread(struct svc_serv *serv, |
| 408 | struct svc_pool *pool); | 420 | struct svc_pool *pool, int node); |
| 409 | void svc_exit_thread(struct svc_rqst *); | 421 | void svc_exit_thread(struct svc_rqst *); |
| 410 | struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int, | 422 | struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int, |
| 411 | void (*shutdown)(struct svc_serv *), | 423 | void (*shutdown)(struct svc_serv *), |
