diff options
Diffstat (limited to 'lib/idr.c')
| -rw-r--r-- | lib/idr.c | 12 |
1 files changed, 5 insertions, 7 deletions
| @@ -385,8 +385,8 @@ void idr_remove(struct idr *idp, int id) | |||
| 385 | while (idp->id_free_cnt >= IDR_FREE_MAX) { | 385 | while (idp->id_free_cnt >= IDR_FREE_MAX) { |
| 386 | p = alloc_layer(idp); | 386 | p = alloc_layer(idp); |
| 387 | kmem_cache_free(idr_layer_cache, p); | 387 | kmem_cache_free(idr_layer_cache, p); |
| 388 | return; | ||
| 389 | } | 388 | } |
| 389 | return; | ||
| 390 | } | 390 | } |
| 391 | EXPORT_SYMBOL(idr_remove); | 391 | EXPORT_SYMBOL(idr_remove); |
| 392 | 392 | ||
| @@ -585,12 +585,11 @@ static void idr_cache_ctor(struct kmem_cache *idr_layer_cache, void *idr_layer) | |||
| 585 | memset(idr_layer, 0, sizeof(struct idr_layer)); | 585 | memset(idr_layer, 0, sizeof(struct idr_layer)); |
| 586 | } | 586 | } |
| 587 | 587 | ||
| 588 | static int init_id_cache(void) | 588 | void __init idr_init_cache(void) |
| 589 | { | 589 | { |
| 590 | if (!idr_layer_cache) | 590 | idr_layer_cache = kmem_cache_create("idr_layer_cache", |
| 591 | idr_layer_cache = kmem_cache_create("idr_layer_cache", | 591 | sizeof(struct idr_layer), 0, SLAB_PANIC, |
| 592 | sizeof(struct idr_layer), 0, 0, idr_cache_ctor); | 592 | idr_cache_ctor); |
| 593 | return 0; | ||
| 594 | } | 593 | } |
| 595 | 594 | ||
| 596 | /** | 595 | /** |
| @@ -602,7 +601,6 @@ static int init_id_cache(void) | |||
| 602 | */ | 601 | */ |
| 603 | void idr_init(struct idr *idp) | 602 | void idr_init(struct idr *idp) |
| 604 | { | 603 | { |
| 605 | init_id_cache(); | ||
| 606 | memset(idp, 0, sizeof(struct idr)); | 604 | memset(idp, 0, sizeof(struct idr)); |
| 607 | spin_lock_init(&idp->lock); | 605 | spin_lock_init(&idp->lock); |
| 608 | } | 606 | } |
