aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@parallels.com>2010-09-27 05:59:48 -0400
committerJ. Bruce Fields <bfields@redhat.com>2010-09-27 10:16:11 -0400
commit352114f395bd79353faf0bc1506ead94de393f55 (patch)
tree46d9001aff3738afd13323fc883d89b7e8a74450 /net
parent3be4479fdf2fb7eb17a4592917ae4b536058b0c7 (diff)
sunrpc: Add net to pure API calls
There are two calls that operate on ip_map_cache and are directly called from the nfsd code. Other places will be handled in a different way. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/svcauth_unix.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c
index f4751805ecfe..2a76c7cf603e 100644
--- a/net/sunrpc/svcauth_unix.c
+++ b/net/sunrpc/svcauth_unix.c
@@ -327,7 +327,8 @@ static struct ip_map *__ip_map_lookup(struct cache_detail *cd, char *class,
327 return NULL; 327 return NULL;
328} 328}
329 329
330static inline struct ip_map *ip_map_lookup(char *class, struct in6_addr *addr) 330static inline struct ip_map *ip_map_lookup(struct net *net, char *class,
331 struct in6_addr *addr)
331{ 332{
332 return __ip_map_lookup(&ip_map_cache, class, addr); 333 return __ip_map_lookup(&ip_map_cache, class, addr);
333} 334}
@@ -360,12 +361,13 @@ static int __ip_map_update(struct cache_detail *cd, struct ip_map *ipm,
360 return 0; 361 return 0;
361} 362}
362 363
363static inline int ip_map_update(struct ip_map *ipm, struct unix_domain *udom, time_t expiry) 364static inline int ip_map_update(struct net *net, struct ip_map *ipm,
365 struct unix_domain *udom, time_t expiry)
364{ 366{
365 return __ip_map_update(&ip_map_cache, ipm, udom, expiry); 367 return __ip_map_update(&ip_map_cache, ipm, udom, expiry);
366} 368}
367 369
368int auth_unix_add_addr(struct in6_addr *addr, struct auth_domain *dom) 370int auth_unix_add_addr(struct net *net, struct in6_addr *addr, struct auth_domain *dom)
369{ 371{
370 struct unix_domain *udom; 372 struct unix_domain *udom;
371 struct ip_map *ipmp; 373 struct ip_map *ipmp;
@@ -373,10 +375,10 @@ int auth_unix_add_addr(struct in6_addr *addr, struct auth_domain *dom)
373 if (dom->flavour != &svcauth_unix) 375 if (dom->flavour != &svcauth_unix)
374 return -EINVAL; 376 return -EINVAL;
375 udom = container_of(dom, struct unix_domain, h); 377 udom = container_of(dom, struct unix_domain, h);
376 ipmp = ip_map_lookup("nfsd", addr); 378 ipmp = ip_map_lookup(net, "nfsd", addr);
377 379
378 if (ipmp) 380 if (ipmp)
379 return ip_map_update(ipmp, udom, NEVER); 381 return ip_map_update(net, ipmp, udom, NEVER);
380 else 382 else
381 return -ENOMEM; 383 return -ENOMEM;
382} 384}
@@ -394,12 +396,12 @@ int auth_unix_forget_old(struct auth_domain *dom)
394} 396}
395EXPORT_SYMBOL_GPL(auth_unix_forget_old); 397EXPORT_SYMBOL_GPL(auth_unix_forget_old);
396 398
397struct auth_domain *auth_unix_lookup(struct in6_addr *addr) 399struct auth_domain *auth_unix_lookup(struct net *net, struct in6_addr *addr)
398{ 400{
399 struct ip_map *ipm; 401 struct ip_map *ipm;
400 struct auth_domain *rv; 402 struct auth_domain *rv;
401 403
402 ipm = ip_map_lookup("nfsd", addr); 404 ipm = ip_map_lookup(net, "nfsd", addr);
403 405
404 if (!ipm) 406 if (!ipm)
405 return NULL; 407 return NULL;
@@ -725,7 +727,7 @@ svcauth_unix_set_client(struct svc_rqst *rqstp)
725 727
726 ipm = ip_map_cached_get(xprt); 728 ipm = ip_map_cached_get(xprt);
727 if (ipm == NULL) 729 if (ipm == NULL)
728 ipm = ip_map_lookup(rqstp->rq_server->sv_program->pg_class, 730 ipm = ip_map_lookup(&init_net, rqstp->rq_server->sv_program->pg_class,
729 &sin6->sin6_addr); 731 &sin6->sin6_addr);
730 732
731 if (ipm == NULL) 733 if (ipm == NULL)