summaryrefslogtreecommitdiff
path: root/lib/idr.c
diff options
context:
space:
mode:
authorKyle McMartin <kyle@parisc-linux.org>2005-10-26 23:28:40 -0400
committerKyle McMartin <kyle@parisc-linux.org>2005-10-26 23:28:40 -0400
commite0f998930eb67c49f2862c58a45262ad0bc03eca (patch)
treed2bc6cbe11a00a05f96da01b1d4ac27adaabd546 /lib/idr.c
parent6958ae318bb1af5e0b77968384700fb184fb8893 (diff)
parent7a4ed937aa44acdeb8c6ba671509dc7b54b09d3a (diff)
downloadlinux-3.10-e0f998930eb67c49f2862c58a45262ad0bc03eca.tar.gz
linux-3.10-e0f998930eb67c49f2862c58a45262ad0bc03eca.tar.bz2
linux-3.10-e0f998930eb67c49f2862c58a45262ad0bc03eca.zip
Auto-update from upstream
Diffstat (limited to 'lib/idr.c')
-rw-r--r--lib/idr.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/idr.c b/lib/idr.c
index 6415d053e2b..d4df21debc4 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -346,6 +346,19 @@ void idr_remove(struct idr *idp, int id)
EXPORT_SYMBOL(idr_remove);
/**
+ * idr_destroy - release all cached layers within an idr tree
+ * idp: idr handle
+ */
+void idr_destroy(struct idr *idp)
+{
+ while (idp->id_free_cnt) {
+ struct idr_layer *p = alloc_layer(idp);
+ kmem_cache_free(idr_layer_cache, p);
+ }
+}
+EXPORT_SYMBOL(idr_destroy);
+
+/**
* idr_find - return pointer for given id
* @idp: idr handle
* @id: lookup key