From 081de9a86d14562a5817f388c2949c423dcd1ea0 Mon Sep 17 00:00:00 2001 From: Jorgen Lundman Date: Thu, 4 Jun 2020 01:49:32 +0900 Subject: 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 Signed-off-by: Jorgen Lundman Closes #10390 --- include/sys/avl.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/sys/avl.h') 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 @@ -259,6 +259,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. */ -- cgit v1.2.3