aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-10-27 20:56:43 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-10-27 20:56:43 -0400
commitcb650116a030dd5cf12f30651e29ceb990d42e4a (patch)
tree6cac1c4ea615d1a3893f82a4c950623b38421872 /lib
parent7bbaa75452c77cbaa016b987765c5d6c8b744587 (diff)
parent741b2252a5e14d6c60a913c77a6099abe73a854a (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 6415d053e2bf..d4df21debc4d 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -346,6 +346,19 @@ void idr_remove(struct idr *idp, int id)
346EXPORT_SYMBOL(idr_remove); 346EXPORT_SYMBOL(idr_remove);
347 347
348/** 348/**
349 * idr_destroy - release all cached layers within an idr tree
350 * idp: idr handle
351 */
352void idr_destroy(struct idr *idp)
353{
354 while (idp->id_free_cnt) {
355 struct idr_layer *p = alloc_layer(idp);
356 kmem_cache_free(idr_layer_cache, p);
357 }
358}
359EXPORT_SYMBOL(idr_destroy);
360
361/**
349 * idr_find - return pointer for given id 362 * idr_find - return pointer for given id
350 * @idp: idr handle 363 * @idp: idr handle
351 * @id: lookup key 364 * @id: lookup key