mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: zhp <zhpsub@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: Is there a 'radix_tree_destroy()' interface in radix-tree?
Date: Tue, 13 Jan 2009 23:57:52 +0800	[thread overview]
Message-ID: <337eb86f0901130757k7d31ec5p82d6405e69549fef@mail.gmail.com> (raw)

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

                 reply	other threads:[~2009-01-13 15:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=337eb86f0901130757k7d31ec5p82d6405e69549fef@mail.gmail.com \
    --to=zhpsub@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®