/* Returns zero if a value is available, non-zero otherwise.  */
int smack_to_cipso(const char *smack, struct smack_cipso *cp)
/* Returns zero if a value is available, non-zero otherwise.  */
int smack_to_cipso(const char *smack, struct smack_cipso *cp)
{
	struct smack_known *kp;
	int found = 0;
	rcu_read_lock();
	list_for_each_entry_rcu(kp, &smack_known_list, list) {
		if (kp->smk_known == smack ||
		    strcmp(kp->smk_known, smack) == 0) {
			found = 1;
			break;
		}
	}
	rcu_read_unlock();
	if (found == 0 || kp->smk_cipso == NULL)
		return -ENOENT;
	memcpy(cp, kp->smk_cipso, sizeof(struct smack_cipso));
	return 0;
}