Lines Matching full:tree

2  * IOVA tree implementation based on GTree.
13 #include "qemu/iova-tree.h"
16 GTree *tree; member
49 * @next: The next mapping in the tree. Can be NULL to signal the last one
79 iova_tree->tree = g_tree_new_full(iova_tree_compare, NULL, g_free, NULL); in iova_tree_new()
84 const DMAMap *iova_tree_find(const IOVATree *tree, const DMAMap *map) in iova_tree_find() argument
86 return g_tree_lookup(tree->tree, map); in iova_tree_find()
108 const DMAMap *iova_tree_find_iova(const IOVATree *tree, const DMAMap *map) in iova_tree_find_iova() argument
114 g_tree_foreach(tree->tree, iova_tree_find_address_iterator, &args); in iova_tree_find_iova()
124 int iova_tree_insert(IOVATree *tree, const DMAMap *map) in iova_tree_insert() argument
133 if (iova_tree_find(tree, map)) { in iova_tree_insert()
139 iova_tree_insert_internal(tree->tree, new); in iova_tree_insert()
144 void iova_tree_remove(IOVATree *tree, DMAMap map) in iova_tree_remove() argument
148 while ((overlap = iova_tree_find(tree, &map))) { in iova_tree_remove()
149 g_tree_remove(tree->tree, overlap); in iova_tree_remove()
191 * Foreach dma node in the tree, compare if there is a hole with its previous
213 int iova_tree_alloc_map(IOVATree *tree, DMAMap *map, hwaddr iova_begin, in iova_tree_alloc_map() argument
236 g_tree_foreach(tree->tree, iova_tree_alloc_traverse, &args); in iova_tree_alloc_map()
239 * Either tree is empty or the last hole is still not checked. in iova_tree_alloc_map()
252 return iova_tree_insert(tree, map); in iova_tree_alloc_map()
255 void iova_tree_destroy(IOVATree *tree) in iova_tree_destroy() argument
257 g_tree_destroy(tree->tree); in iova_tree_destroy()
258 g_free(tree); in iova_tree_destroy()