Is there a 'radix_tree_destroy()' interface in radix-tree?

From: zhp
Date: Tue Jan 13 2009 - 10:58:33 EST


Hi, all,

I am now writing a kernel module for Linux, and need to use the
radix-tree implementation in kernel. (include/linux/radix-tree.h &
lib/radix-tree.c). However, I do not find any interface for me to
destroy the tree, i.e. remove all non-root nodes in the tree, and free
all of my elements inserted in the tree before (of course, the free_fn
should be passed in by the user).

Is there such an interface for lib users? If not, who can tell me what
should I do to perform such a destroy task without dirty work? It is
almost impossible for me to "lookup an element to check whether it's
in the tree, delete it if yes", because all possible keys are very
very large.

Also, I think it will be very useful for the kernel radix-tree module
if it provide such an interface:

radix_tree_destroy(struct radix_tree_root *rtree,
rtree_free_node_fn free_fn)

How about adding such an interface as a patch if I finally have to do
the dirty work?

Thanks.
zhp
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/