FreeBSD/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c
/*
 * Discard any pending errors from the spa_t.  Called when unloading a faulted
 * pool, as the errors encountered during the open cannot be synced to disk.
 */
Discard any pending errors from the spa_t.  Called when unloading a faulted
pool, as the errors encountered during the open cannot be synced to disk.
Discard any pending errors from the spa_t . Called when unloading a faulted pool as the errors encountered during the open cannot be synced to disk .
void
spa_errlog_drain(spa_t *spa)
{
	spa_error_entry_t *se;
	void *cookie;
	mutex_enter(&spa->spa_errlist_lock);
	cookie = NULL;
	while ((se = avl_destroy_nodes(&spa->spa_errlist_last,
	    &cookie)) != NULL)
		kmem_free(se, sizeof (spa_error_entry_t));
	cookie = NULL;
	while ((se = avl_destroy_nodes(&spa->spa_errlist_scrub,
	    &cookie)) != NULL)
		kmem_free(se, sizeof (spa_error_entry_t));
	mutex_exit(&spa->spa_errlist_lock);
}
void spa_errlog_drain ( spa_t * spa ) { spa_error_entry_t * se ; void * cookie ; mutex_enter ( & spa -> spa_errlist_lock ) ; cookie = NULL ; while ( ( se = avl_destroy_nodes ( & spa -> spa_errlist_last , & cookie ) ) != NULL ) kmem_free ( se , sizeof ( spa_error_entry_t ) ) ; cookie = NULL ; while ( ( se = avl_destroy_nodes ( & spa -> spa_errlist_scrub , & cookie ) ) != NULL ) kmem_free ( se , sizeof ( spa_error_entry_t ) ) ; mutex_exit ( & spa -> spa_errlist_lock ) ; }
Discard any pending errors from the spa_t.
Discard any pending errors from the spa_t .