KEYS: Announce key type (un)registration
Announce the (un)registration of a key type in the core key code rather than in the callers. Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Mimi Zohar <zohar@us.ibm.com>
This commit is contained in:
parent
9f7ce8e249
commit
1eb1bcf5bf
|
@ -249,9 +249,6 @@ static int __init init_dns_resolver(void)
|
||||||
struct key *keyring;
|
struct key *keyring;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
printk(KERN_NOTICE "Registering the %s key type\n",
|
|
||||||
key_type_dns_resolver.name);
|
|
||||||
|
|
||||||
/* create an override credential set with a special thread keyring in
|
/* create an override credential set with a special thread keyring in
|
||||||
* which DNS requests are cached
|
* which DNS requests are cached
|
||||||
*
|
*
|
||||||
|
@ -301,8 +298,6 @@ static void __exit exit_dns_resolver(void)
|
||||||
key_revoke(dns_resolver_cache->thread_keyring);
|
key_revoke(dns_resolver_cache->thread_keyring);
|
||||||
unregister_key_type(&key_type_dns_resolver);
|
unregister_key_type(&key_type_dns_resolver);
|
||||||
put_cred(dns_resolver_cache);
|
put_cred(dns_resolver_cache);
|
||||||
printk(KERN_NOTICE "Unregistered %s key type\n",
|
|
||||||
key_type_dns_resolver.name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module_init(init_dns_resolver)
|
module_init(init_dns_resolver)
|
||||||
|
|
|
@ -980,6 +980,8 @@ int register_key_type(struct key_type *ktype)
|
||||||
|
|
||||||
/* store the type */
|
/* store the type */
|
||||||
list_add(&ktype->link, &key_types_list);
|
list_add(&ktype->link, &key_types_list);
|
||||||
|
|
||||||
|
pr_notice("Key type %s registered\n", ktype->name);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
@ -1002,6 +1004,7 @@ void unregister_key_type(struct key_type *ktype)
|
||||||
list_del_init(&ktype->link);
|
list_del_init(&ktype->link);
|
||||||
downgrade_write(&key_types_sem);
|
downgrade_write(&key_types_sem);
|
||||||
key_gc_keytype(ktype);
|
key_gc_keytype(ktype);
|
||||||
|
pr_notice("Key type %s unregistered\n", ktype->name);
|
||||||
up_read(&key_types_sem);
|
up_read(&key_types_sem);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(unregister_key_type);
|
EXPORT_SYMBOL(unregister_key_type);
|
||||||
|
|
Loading…
Reference in New Issue