diff options
| author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-08-09 15:14:29 -0400 |
|---|---|---|
| committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-08-09 15:14:29 -0400 |
| commit | bc74b4f5e63a09fb78e245794a0de1e5a2716bbe (patch) | |
| tree | 5e96e63fd69303162456549f12bff5f9b2ee2a22 /net/sunrpc/svcauth_unix.c | |
| parent | da77005f0d64486cd760f43d9b7cc2379262a363 (diff) | |
SUNRPC: Allow the cache_detail to specify alternative upcall mechanisms
For events that are rare, such as referral DNS lookups, it makes limited
sense to have a daemon constantly listening for upcalls on a channel. An
alternative in those cases might simply be to run the app that fills the
cache using call_usermodehelper_exec() and friends.
The following patch allows the cache_detail to specify alternative upcall
mechanisms for these particular cases.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/svcauth_unix.c')
| -rw-r--r-- | net/sunrpc/svcauth_unix.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c index 5c865e2d299e..6caffa34ac01 100644 --- a/net/sunrpc/svcauth_unix.c +++ b/net/sunrpc/svcauth_unix.c | |||
| @@ -171,6 +171,11 @@ static void ip_map_request(struct cache_detail *cd, | |||
| 171 | (*bpp)[-1] = '\n'; | 171 | (*bpp)[-1] = '\n'; |
| 172 | } | 172 | } |
| 173 | 173 | ||
| 174 | static int ip_map_upcall(struct cache_detail *cd, struct cache_head *h) | ||
| 175 | { | ||
| 176 | return sunrpc_cache_pipe_upcall(cd, h, ip_map_request); | ||
| 177 | } | ||
| 178 | |||
| 174 | static struct ip_map *ip_map_lookup(char *class, struct in6_addr *addr); | 179 | static struct ip_map *ip_map_lookup(char *class, struct in6_addr *addr); |
| 175 | static int ip_map_update(struct ip_map *ipm, struct unix_domain *udom, time_t expiry); | 180 | static int ip_map_update(struct ip_map *ipm, struct unix_domain *udom, time_t expiry); |
| 176 | 181 | ||
| @@ -289,7 +294,7 @@ struct cache_detail ip_map_cache = { | |||
| 289 | .hash_table = ip_table, | 294 | .hash_table = ip_table, |
| 290 | .name = "auth.unix.ip", | 295 | .name = "auth.unix.ip", |
| 291 | .cache_put = ip_map_put, | 296 | .cache_put = ip_map_put, |
| 292 | .cache_request = ip_map_request, | 297 | .cache_upcall = ip_map_upcall, |
| 293 | .cache_parse = ip_map_parse, | 298 | .cache_parse = ip_map_parse, |
| 294 | .cache_show = ip_map_show, | 299 | .cache_show = ip_map_show, |
| 295 | .match = ip_map_match, | 300 | .match = ip_map_match, |
| @@ -523,6 +528,11 @@ static void unix_gid_request(struct cache_detail *cd, | |||
| 523 | (*bpp)[-1] = '\n'; | 528 | (*bpp)[-1] = '\n'; |
| 524 | } | 529 | } |
| 525 | 530 | ||
| 531 | static int unix_gid_upcall(struct cache_detail *cd, struct cache_head *h) | ||
| 532 | { | ||
| 533 | return sunrpc_cache_pipe_upcall(cd, h, unix_gid_request); | ||
| 534 | } | ||
| 535 | |||
| 526 | static struct unix_gid *unix_gid_lookup(uid_t uid); | 536 | static struct unix_gid *unix_gid_lookup(uid_t uid); |
| 527 | extern struct cache_detail unix_gid_cache; | 537 | extern struct cache_detail unix_gid_cache; |
| 528 | 538 | ||
| @@ -622,7 +632,7 @@ struct cache_detail unix_gid_cache = { | |||
| 622 | .hash_table = gid_table, | 632 | .hash_table = gid_table, |
| 623 | .name = "auth.unix.gid", | 633 | .name = "auth.unix.gid", |
| 624 | .cache_put = unix_gid_put, | 634 | .cache_put = unix_gid_put, |
| 625 | .cache_request = unix_gid_request, | 635 | .cache_upcall = unix_gid_upcall, |
| 626 | .cache_parse = unix_gid_parse, | 636 | .cache_parse = unix_gid_parse, |
| 627 | .cache_show = unix_gid_show, | 637 | .cache_show = unix_gid_show, |
| 628 | .match = unix_gid_match, | 638 | .match = unix_gid_match, |
