Print this page
6091 avl_add doesn't assert on non-debug builds
Reviewed by: Andy Stormont <astormont@racktopsystems.com>
*** 23,32 ****
--- 23,33 ----
* Use is subject to license terms.
*/
/*
* Copyright (c) 2014 by Delphix. All rights reserved.
+ * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
*/
/*
* AVL - generic AVL tree implementation for kernel use
*
*** 633,650 ****
avl_index_t where;
/*
* This is unfortunate. We want to call panic() here, even for
* non-DEBUG kernels. In userland, however, we can't depend on anything
! * in libc or else the rtld build process gets confused. So, all we can
! * do in userland is resort to a normal ASSERT().
*/
if (avl_find(tree, new_node, &where) != NULL)
#ifdef _KERNEL
panic("avl_find() succeeded inside avl_add()");
#else
! ASSERT(0);
#endif
avl_insert(tree, new_node, where);
}
/*
--- 634,654 ----
avl_index_t where;
/*
* This is unfortunate. We want to call panic() here, even for
* non-DEBUG kernels. In userland, however, we can't depend on anything
! * in libc or else the rtld build process gets confused.
! * Thankfully, rtld provides us with its own assfail() so we can use
! * that here. We use assfail() directly to get a nice error message
! * in the core - much like what panic() does for crashdumps.
*/
if (avl_find(tree, new_node, &where) != NULL)
#ifdef _KERNEL
panic("avl_find() succeeded inside avl_add()");
#else
! (void) assfail("avl_find() succeeded inside avl_add()",
! __FILE__, __LINE__);
#endif
avl_insert(tree, new_node, where);
}
/*