aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-10-26 01:06:45 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-10-26 01:06:45 -0400
commit1f57389a38dc1e8be167ec601f39f78f0bed3a96 (patch)
tree5f33d00a046597ae33855cee13d17d77048ba712 /lib
parent077783f87708b24054452e5c07685ead2c28b1eb (diff)
parent6693e74a16ef563960764bd963f1048392135c3c (diff)
Merge branch 'master'
Diffstat (limited to 'lib')
-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