/* instantiate a key and link it into the target keyring atomically  */
int key_instantiate_and_link(struct key *key, const void *data, size_t datalen, struct key *keyring, struct key *authkey)
/* instantiate a key and link it into the target keyring atomically  */
int key_instantiate_and_link(struct key *key, const void *data, size_t datalen, struct key *keyring, struct key *authkey)
{
	int ret;
	if (keyring)
		down_write(&keyring->sem);
	ret = __key_instantiate_and_link(key, data, datalen, keyring, authkey);
	if (keyring)
		up_write(&keyring->sem);
	return ret;
}