mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
[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>
This commit is contained in:
parent
3e7b191980
commit
efc36aa560
6 changed files with 78 additions and 142 deletions
|
@ -645,6 +645,8 @@ find_gss_auth_domain(struct gss_ctx *ctx, u32 svc)
|
|||
return auth_domain_find(name);
|
||||
}
|
||||
|
||||
static struct auth_ops svcauthops_gss;
|
||||
|
||||
int
|
||||
svcauth_gss_register_pseudoflavor(u32 pseudoflavor, char * name)
|
||||
{
|
||||
|
@ -655,20 +657,18 @@ svcauth_gss_register_pseudoflavor(u32 pseudoflavor, char * name)
|
|||
new = kmalloc(sizeof(*new), GFP_KERNEL);
|
||||
if (!new)
|
||||
goto out;
|
||||
cache_init(&new->h.h);
|
||||
kref_init(&new->h.ref);
|
||||
new->h.name = kmalloc(strlen(name) + 1, GFP_KERNEL);
|
||||
if (!new->h.name)
|
||||
goto out_free_dom;
|
||||
strcpy(new->h.name, name);
|
||||
new->h.flavour = RPC_AUTH_GSS;
|
||||
new->h.flavour = &svcauthops_gss;
|
||||
new->pseudoflavor = pseudoflavor;
|
||||
new->h.h.expiry_time = NEVER;
|
||||
|
||||
test = auth_domain_lookup(&new->h, 1);
|
||||
if (test == &new->h) {
|
||||
BUG_ON(atomic_dec_and_test(&new->h.h.refcnt));
|
||||
} else { /* XXX Duplicate registration? */
|
||||
test = auth_domain_lookup(name, &new->h);
|
||||
if (test != &new->h) { /* XXX Duplicate registration? */
|
||||
auth_domain_put(&new->h);
|
||||
/* dangling ref-count... */
|
||||
goto out;
|
||||
}
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue