Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.26-rc1 /lib/idr.c

Filename:/lib/idr.c
Lines Added:5
Lines Deleted:7
Also changed in: (Previous) 2.6.25-git20  2.6.25-git19  2.6.25-git18  2.6.25-git17  2.6.25-git16  2.6.25-git15 
(Following) 2.6.26-rc2  2.6.26-rc3  2.6.26-rc4  2.6.26-rc5  2.6.26-rc6  2.6.26-rc7 

Location
[  2.6.26-rc1
  [  lib
     o  idr.c

Patch

diff --git a/lib/idr.c b/lib/idr.c
index afbb0b1..7a02e17 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -385,8 +385,8 @@ void idr_remove(struct idr *idp, int id)
    while (idp->id_free_cnt >= IDR_FREE_MAX) {
       p = alloc_layer(idp);
       kmem_cache_free(idr_layer_cache, p);
-      return;
    }
+   return;
 }
 EXPORT_SYMBOL(idr_remove);
 
@@ -585,12 +585,11 @@ static void idr_cache_ctor(struct kmem_cache *idr_layer_cache, void *idr_layer)
    memset(idr_layer, 0, sizeof(struct idr_layer));
 }
 
-static  int init_id_cache(void)
+void __init idr_init_cache(void)
 {
-   if (!idr_layer_cache)
-      idr_layer_cache = kmem_cache_create("idr_layer_cache",
-         sizeof(struct idr_layer), 0, 0, idr_cache_ctor);
-   return 0;
+   idr_layer_cache = kmem_cache_create("idr_layer_cache",
+            sizeof(struct idr_layer), 0, SLAB_PANIC,
+            idr_cache_ctor);
 }
 
 /**
@@ -602,7 +601,6 @@ static  int init_id_cache(void)
  */
 void idr_init(struct idr *idp)
 {
-   init_id_cache();
    memset(idp, 0, sizeof(struct idr));
    spin_lock_init(&idp->lock);
 }


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.