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()
224 avl_tree_t avl; in drain_tree() local
230 avl_create(&avl, avl_compare, sizeof (int_node_t), in drain_tree()
248 if ((ret = avl_find(&avl, node, &avl_idx)) != NULL) { in drain_tree()
253 avl_insert(&avl, node, avl_idx); in drain_tree()
257 while (avl_numnodes(&avl) != 0) { in drain_tree()
260 ASSERT3U(avl_numnodes(&avl), ==, zfs_btree_numnodes(bt)); in drain_tree()
261 if (avl_numnodes(&avl) % 2 == 0) { in drain_tree()
262 node = avl_first(&avl); in drain_tree()
265 node = avl_last(&avl); in drain_tree()
270 avl_remove(&avl, node); in drain_tree()
272 if (avl_numnodes(&avl) == 0) { in drain_tree()
276 node = avl_first(&avl); in drain_tree()
279 node = avl_last(&avl); in drain_tree()
285 while ((node = avl_destroy_nodes(&avl, &avl_cookie)) != NULL) in drain_tree()
287 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()
326 void *ret = avl_find(&avl, node, &avl_idx); in stress_tree()
329 avl_insert(&avl, node, avl_idx); in stress_tree()
333 verify_node(&avl, bt, node); in stress_tree()
336 verify_node(&avl, bt, ret); in stress_tree()
338 avl_remove(&avl, ret); in stress_tree()
347 verify_contents(&avl, bt); in stress_tree()
361 while ((node = avl_destroy_nodes(&avl, &avl_cookie)) != NULL) in stress_tree()
363 avl_destroy(&avl); in stress_tree()