usr/src/uts/common/fs/zfs/spa_misc.c
/*
 * Lookup the named spa_t in the AVL tree.  The spa_namespace_lock must be held.
 * Returns NULL if no matching spa_t is found.
 */
Lookup the named spa_t in the AVL tree.  The spa_namespace_lock must be held.
Returns NULL if no matching spa_t is found.
Lookup the named spa_t in the AVL tree . The spa_namespace_lock must be held . Returns NULL if no matching spa_t is found .
spa_t *
spa_lookup(const char *name)
{
	static spa_t search;	
	spa_t *spa;
	avl_index_t where;
	char *cp;
	ASSERT(MUTEX_HELD(&spa_namespace_lock));
	(void) strlcpy(search.spa_name, name, sizeof (search.spa_name));
	cp = strpbrk(search.spa_name, "/@#");
	if (cp != NULL)
		*cp = '\0';
	spa = avl_find(&spa_namespace_avl, &search, &where);
	return (spa);
}
spa_t * spa_lookup ( const char * name ) { static spa_t search ; spa_t * spa ; avl_index_t where ; char * cp ; ASSERT ( MUTEX_HELD ( & spa_namespace_lock ) ) ; ( void ) strlcpy ( search . spa_name , name , sizeof ( search . spa_name ) ) ; cp = strpbrk ( search . spa_name , " " ) ; if ( cp != NULL ) * cp = ' \0 ' ; spa = avl_find ( & spa_namespace_avl , & search , & where ) ; return ( spa ) ; }
Lookup the named spa_t in the AVL tree.
Lookup the named spa_t in the AVL tree .
/* spa_t is large; don't allocate on stack */ /*
	 * If it's a full dataset name, figure out the pool name and
	 * just use that.
	 */