From a8ea530d7d75006558944a564effd23b49a51f8a Mon Sep 17 00:00:00 2001 From: "Pratyush Yadav (Google)" Date: Sat, 1 Aug 2026 10:48:20 +0200 Subject: kho: allow destroying KHO radix tree Add kho_radix_destroy_tree() which allows destroying the radix tree and freeing all its pages. This is will be used by the upcoming scratch extension mechanism. It creates a radix tree to track free blocks and then frees them after telling memblock about them. Reviewed-by: Pasha Tatashin Signed-off-by: Pratyush Yadav (Google) Link: https://patch.msgid.link/20260801084833.1897543-12-pratyush@kernel.org Signed-off-by: Mike Rapoport (Microsoft) --- include/linux/kho_radix_tree.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/linux') diff --git a/include/linux/kho_radix_tree.h b/include/linux/kho_radix_tree.h index 60c1246a9101..b7532aff35d8 100644 --- a/include/linux/kho_radix_tree.h +++ b/include/linux/kho_radix_tree.h @@ -58,6 +58,7 @@ int kho_radix_add_key(struct kho_radix_tree *tree, unsigned long key); void kho_radix_del_key(struct kho_radix_tree *tree, unsigned long key); int kho_radix_walk_tree(struct kho_radix_tree *tree, const struct kho_radix_walk_cb *cb, void *data); +void kho_radix_destroy_tree(struct kho_radix_tree *tree); #else /* #ifdef CONFIG_KEXEC_HANDOVER */ @@ -75,6 +76,8 @@ static inline int kho_radix_walk_tree(struct kho_radix_tree *tree, return -EOPNOTSUPP; } +static inline void kho_radix_destroy_tree(struct kho_radix_tree *tree) { } + #endif /* #ifdef CONFIG_KEXEC_HANDOVER */ #endif /* _LINUX_KHO_RADIX_TREE_H */ -- cgit v1.2.3