diff options
author | NeilBrown <neilb@suse.de> | 2006-03-27 04:14:59 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-27 11:44:41 -0500 |
commit | efc36aa5608f5717338747e152c23f2cfdb14697 (patch) | |
tree | ab444f6e6c88ed07a8d5a034777c10de50e663fd /net/sunrpc/auth_gss | |
parent | 3e7b19198003fc25b11838e709f17d4fa173b2d7 (diff) |
[PATCH] knfsd: Change the store of auth_domains to not be a 'cache'
The 'auth_domain's are simply handles on internal data structures. They do
not cache information from user-space, and forcing them into the mold of a
'cache' misrepresents their true nature and causes confusion.
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'net/sunrpc/auth_gss')
-rw-r--r-- | net/sunrpc/auth_gss/svcauth_gss.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c index 23632d84d8d7..6b073c2e6930 100644 --- a/net/sunrpc/auth_gss/svcauth_gss.c +++ b/net/sunrpc/auth_gss/svcauth_gss.c | |||
@@ -645,6 +645,8 @@ find_gss_auth_domain(struct gss_ctx *ctx, u32 svc) | |||
645 | return auth_domain_find(name); | 645 | return auth_domain_find(name); |
646 | } | 646 | } |
647 | 647 | ||
648 | static struct auth_ops svcauthops_gss; | ||
649 | |||
648 | int | 650 | int |
649 | svcauth_gss_register_pseudoflavor(u32 pseudoflavor, char * name) | 651 | svcauth_gss_register_pseudoflavor(u32 pseudoflavor, char * name) |
650 | { | 652 | { |
@@ -655,20 +657,18 @@ svcauth_gss_register_pseudoflavor(u32 pseudoflavor, char * name) | |||
655 | new = kmalloc(sizeof(*new), GFP_KERNEL); | 657 | new = kmalloc(sizeof(*new), GFP_KERNEL); |
656 | if (!new) | 658 | if (!new) |
657 | goto out; | 659 | goto out; |
658 | cache_init(&new->h.h); | 660 | kref_init(&new->h.ref); |
659 | new->h.name = kmalloc(strlen(name) + 1, GFP_KERNEL); | 661 | new->h.name = kmalloc(strlen(name) + 1, GFP_KERNEL); |
660 | if (!new->h.name) | 662 | if (!new->h.name) |
661 | goto out_free_dom; | 663 | goto out_free_dom; |
662 | strcpy(new->h.name, name); | 664 | strcpy(new->h.name, name); |
663 | new->h.flavour = RPC_AUTH_GSS; | 665 | new->h.flavour = &svcauthops_gss; |
664 | new->pseudoflavor = pseudoflavor; | 666 | new->pseudoflavor = pseudoflavor; |
665 | new->h.h.expiry_time = NEVER; | ||
666 | 667 | ||
667 | test = auth_domain_lookup(&new->h, 1); | 668 | test = auth_domain_lookup(name, &new->h); |
668 | if (test == &new->h) { | 669 | if (test != &new->h) { /* XXX Duplicate registration? */ |
669 | BUG_ON(atomic_dec_and_test(&new->h.h.refcnt)); | ||
670 | } else { /* XXX Duplicate registration? */ | ||
671 | auth_domain_put(&new->h); | 670 | auth_domain_put(&new->h); |
671 | /* dangling ref-count... */ | ||
672 | goto out; | 672 | goto out; |
673 | } | 673 | } |
674 | return 0; | 674 | return 0; |