aboutsummaryrefslogtreecommitdiffstats
path: root/include/sys/avl.h
diff options
context:
space:
mode:
authorJorgen Lundman <[email protected]>2020-06-04 01:49:32 +0900
committerGitHub <[email protected]>2020-06-03 09:49:32 -0700
commit081de9a86d14562a5817f388c2949c423dcd1ea0 (patch)
tree5e2414794b369f20ad90247b42542d9e8c834c13 /include/sys/avl.h
parent3bf3b164ee18b2897f9f8812f053704a10a1481d (diff)
Restore avl_update() calls and related functions
The macOS kmem implementation uses avl_update() and related functions. These same function exist in the Solaris AVL code but were removed because they were unused. Restore them. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Jorgen Lundman <[email protected]> Closes #10390
Diffstat (limited to 'include/sys/avl.h')
-rw-r--r--include/sys/avl.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/sys/avl.h b/include/sys/avl.h
index 6c4e7ed5c..ed3c6f86a 100644
--- a/include/sys/avl.h
+++ b/include/sys/avl.h
@@ -260,6 +260,17 @@ extern void avl_add(avl_tree_t *tree, void *node);
extern void avl_remove(avl_tree_t *tree, void *node);
/*
+ * Reinsert a node only if its order has changed relative to its nearest
+ * neighbors. To optimize performance avl_update_lt() checks only the previous
+ * node and avl_update_gt() checks only the next node. Use avl_update_lt() and
+ * avl_update_gt() only if you know the direction in which the order of the
+ * node may change.
+ */
+extern boolean_t avl_update(avl_tree_t *, void *);
+extern boolean_t avl_update_lt(avl_tree_t *, void *);
+extern boolean_t avl_update_gt(avl_tree_t *, void *);
+
+/*
* Swaps the contents of the two trees.
*/
extern void avl_swap(avl_tree_t *tree1, avl_tree_t *tree2);