Lines Matching refs:avl

89 verify_contents(avl_tree_t *avl, zfs_btree_t *bt)  in verify_contents()  argument
99 ASSERT3U(avl_numnodes(avl), ==, zfs_btree_numnodes(bt)); in verify_contents()
101 node = avl_first(avl); in verify_contents()
104 node = avl_last(avl); in verify_contents()
112 node = AVL_NEXT(avl, node); in verify_contents()
115 node = AVL_PREV(avl, node); in verify_contents()
121 verify_node(avl_tree_t *avl, zfs_btree_t *bt, int_node_t *node) in verify_node() argument
129 ASSERT3U(avl_numnodes(avl), ==, zfs_btree_numnodes(bt)); in verify_node()
136 if ((inp = AVL_NEXT(avl, node)) != NULL) { in verify_node()
145 if ((inp = AVL_PREV(avl, node)) != NULL) { in verify_node()
223 avl_tree_t avl; in drain_tree() local
229 avl_create(&avl, avl_compare, sizeof (int_node_t), in drain_tree()
247 if (avl_find(&avl, node, &avl_idx) != NULL) { in drain_tree()
252 avl_insert(&avl, node, avl_idx); in drain_tree()
256 while (avl_numnodes(&avl) != 0) { in drain_tree()
259 ASSERT3U(avl_numnodes(&avl), ==, zfs_btree_numnodes(bt)); in drain_tree()
260 if (avl_numnodes(&avl) % 2 == 0) { in drain_tree()
261 node = avl_first(&avl); in drain_tree()
264 node = avl_last(&avl); in drain_tree()
269 avl_remove(&avl, node); in drain_tree()
271 if (avl_numnodes(&avl) == 0) { in drain_tree()
275 node = avl_first(&avl); in drain_tree()
278 node = avl_last(&avl); in drain_tree()
284 while ((node = avl_destroy_nodes(&avl, &avl_cookie)) != NULL) in drain_tree()
286 avl_destroy(&avl); in drain_tree()
302 avl_tree_t avl; in stress_tree() local
312 avl_create(&avl, avl_compare, sizeof (int_node_t), in stress_tree()
330 void *ret = avl_find(&avl, node, &avl_idx); in stress_tree()
333 avl_insert(&avl, node, avl_idx); in stress_tree()
337 verify_node(&avl, bt, node); in stress_tree()
340 verify_node(&avl, bt, ret); in stress_tree()
342 avl_remove(&avl, ret); in stress_tree()
351 verify_contents(&avl, bt); in stress_tree()
365 while ((node = avl_destroy_nodes(&avl, &avl_cookie)) != NULL) in stress_tree()
367 avl_destroy(&avl); in stress_tree()