diff options
| author | Pavel Emelyanov <xemul@parallels.com> | 2010-09-27 05:59:13 -0400 |
|---|---|---|
| committer | J. Bruce Fields <bfields@redhat.com> | 2010-09-27 10:16:11 -0400 |
| commit | 3be4479fdf2fb7eb17a4592917ae4b536058b0c7 (patch) | |
| tree | 6d1ee4fde52da130a41966f72a9542a24ecc450c | |
| parent | e3bfca01c1ad378deaee598292bcc7ee19024563 (diff) | |
sunrpc: Pass xprt to cached get/put routines
They do not require the rqst actually and having the xprt simplifies
further patching.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
| -rw-r--r-- | net/sunrpc/svcauth_unix.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c index 49e39ff2291..f4751805ecf 100644 --- a/net/sunrpc/svcauth_unix.c +++ b/net/sunrpc/svcauth_unix.c | |||
| @@ -426,10 +426,9 @@ void svcauth_unix_purge(void) | |||
| 426 | EXPORT_SYMBOL_GPL(svcauth_unix_purge); | 426 | EXPORT_SYMBOL_GPL(svcauth_unix_purge); |
| 427 | 427 | ||
| 428 | static inline struct ip_map * | 428 | static inline struct ip_map * |
| 429 | ip_map_cached_get(struct svc_rqst *rqstp) | 429 | ip_map_cached_get(struct svc_xprt *xprt) |
| 430 | { | 430 | { |
| 431 | struct ip_map *ipm = NULL; | 431 | struct ip_map *ipm = NULL; |
| 432 | struct svc_xprt *xprt = rqstp->rq_xprt; | ||
| 433 | 432 | ||
| 434 | if (test_bit(XPT_CACHE_AUTH, &xprt->xpt_flags)) { | 433 | if (test_bit(XPT_CACHE_AUTH, &xprt->xpt_flags)) { |
| 435 | spin_lock(&xprt->xpt_lock); | 434 | spin_lock(&xprt->xpt_lock); |
| @@ -454,10 +453,8 @@ ip_map_cached_get(struct svc_rqst *rqstp) | |||
| 454 | } | 453 | } |
| 455 | 454 | ||
| 456 | static inline void | 455 | static inline void |
| 457 | ip_map_cached_put(struct svc_rqst *rqstp, struct ip_map *ipm) | 456 | ip_map_cached_put(struct svc_xprt *xprt, struct ip_map *ipm) |
| 458 | { | 457 | { |
| 459 | struct svc_xprt *xprt = rqstp->rq_xprt; | ||
| 460 | |||
| 461 | if (test_bit(XPT_CACHE_AUTH, &xprt->xpt_flags)) { | 458 | if (test_bit(XPT_CACHE_AUTH, &xprt->xpt_flags)) { |
| 462 | spin_lock(&xprt->xpt_lock); | 459 | spin_lock(&xprt->xpt_lock); |
| 463 | if (xprt->xpt_auth_cache == NULL) { | 460 | if (xprt->xpt_auth_cache == NULL) { |
| @@ -707,6 +704,7 @@ svcauth_unix_set_client(struct svc_rqst *rqstp) | |||
| 707 | struct ip_map *ipm; | 704 | struct ip_map *ipm; |
| 708 | struct group_info *gi; | 705 | struct group_info *gi; |
| 709 | struct svc_cred *cred = &rqstp->rq_cred; | 706 | struct svc_cred *cred = &rqstp->rq_cred; |
| 707 | struct svc_xprt *xprt = rqstp->rq_xprt; | ||
| 710 | 708 | ||
| 711 | switch (rqstp->rq_addr.ss_family) { | 709 | switch (rqstp->rq_addr.ss_family) { |
| 712 | case AF_INET: | 710 | case AF_INET: |
| @@ -725,7 +723,7 @@ svcauth_unix_set_client(struct svc_rqst *rqstp) | |||
| 725 | if (rqstp->rq_proc == 0) | 723 | if (rqstp->rq_proc == 0) |
| 726 | return SVC_OK; | 724 | return SVC_OK; |
| 727 | 725 | ||
| 728 | ipm = ip_map_cached_get(rqstp); | 726 | ipm = ip_map_cached_get(xprt); |
| 729 | if (ipm == NULL) | 727 | if (ipm == NULL) |
| 730 | ipm = ip_map_lookup(rqstp->rq_server->sv_program->pg_class, | 728 | ipm = ip_map_lookup(rqstp->rq_server->sv_program->pg_class, |
| 731 | &sin6->sin6_addr); | 729 | &sin6->sin6_addr); |
| @@ -745,7 +743,7 @@ svcauth_unix_set_client(struct svc_rqst *rqstp) | |||
| 745 | case 0: | 743 | case 0: |
| 746 | rqstp->rq_client = &ipm->m_client->h; | 744 | rqstp->rq_client = &ipm->m_client->h; |
| 747 | kref_get(&rqstp->rq_client->ref); | 745 | kref_get(&rqstp->rq_client->ref); |
| 748 | ip_map_cached_put(rqstp, ipm); | 746 | ip_map_cached_put(xprt, ipm); |
| 749 | break; | 747 | break; |
| 750 | } | 748 | } |
| 751 | 749 | ||
