/* Description: Searches for a valid DOI definition and if one is found it is returned to the caller. Otherwise NULL is returned. The caller must ensure that rcu_read_lock() is held while accessing the returned definition and the DOI definition reference count is decremented when the caller is done.  */
struct cipso_v4_doi* cipso_v4_doi_getdef(u32 doi)
/* Description: Searches for a valid DOI definition and if one is found it is returned to the caller. Otherwise NULL is returned. The caller must ensure that rcu_read_lock() is held while accessing the returned definition and the DOI definition reference count is decremented when the caller is done.  */
struct cipso_v4_doi* cipso_v4_doi_getdef(u32 doi)
{
	struct cipso_v4_doi *doi_def;
	rcu_read_lock();
	doi_def = cipso_v4_doi_search(doi);
	if (doi_def == NULL)
		goto doi_getdef_return;
	if (!atomic_inc_not_zero(&doi_def->refcount))
		doi_def = NULL;
doi_getdef_return:
	rcu_read_unlock();
	return doi_def;
}