diff options
Diffstat (limited to 'lib/idr.c')
-rw-r--r-- | lib/idr.c | 10 |
1 files changed, 2 insertions, 8 deletions
@@ -121,7 +121,7 @@ int idr_pre_get(struct idr *idp, gfp_t gfp_mask) | |||
121 | { | 121 | { |
122 | while (idp->id_free_cnt < IDR_FREE_MAX) { | 122 | while (idp->id_free_cnt < IDR_FREE_MAX) { |
123 | struct idr_layer *new; | 123 | struct idr_layer *new; |
124 | new = kmem_cache_alloc(idr_layer_cache, gfp_mask); | 124 | new = kmem_cache_zalloc(idr_layer_cache, gfp_mask); |
125 | if (new == NULL) | 125 | if (new == NULL) |
126 | return (0); | 126 | return (0); |
127 | move_to_free_list(idp, new); | 127 | move_to_free_list(idp, new); |
@@ -623,16 +623,10 @@ void *idr_replace(struct idr *idp, void *ptr, int id) | |||
623 | } | 623 | } |
624 | EXPORT_SYMBOL(idr_replace); | 624 | EXPORT_SYMBOL(idr_replace); |
625 | 625 | ||
626 | static void idr_cache_ctor(void *idr_layer) | ||
627 | { | ||
628 | memset(idr_layer, 0, sizeof(struct idr_layer)); | ||
629 | } | ||
630 | |||
631 | void __init idr_init_cache(void) | 626 | void __init idr_init_cache(void) |
632 | { | 627 | { |
633 | idr_layer_cache = kmem_cache_create("idr_layer_cache", | 628 | idr_layer_cache = kmem_cache_create("idr_layer_cache", |
634 | sizeof(struct idr_layer), 0, SLAB_PANIC, | 629 | sizeof(struct idr_layer), 0, SLAB_PANIC, NULL); |
635 | idr_cache_ctor); | ||
636 | } | 630 | } |
637 | 631 | ||
638 | /** | 632 | /** |