#include <linux/types.h>
#include <linux/bitops.h>
+#include <linux/init.h>
#if BITS_PER_LONG == 32
# define IDR_BITS 5
void ida_destroy(struct ida *ida);
void ida_init(struct ida *ida);
+void __init idr_init_cache(void);
+
#endif /* __IDR_H__ */
#include <linux/kthread.h>
#include <linux/sched.h>
#include <linux/signal.h>
+#include <linux/idr.h>
#include <asm/io.h>
#include <asm/bugs.h>
enable_debug_pagealloc();
cpu_hotplug_init();
kmem_cache_init();
+ idr_init_cache();
setup_per_cpu_pageset();
numa_policy_init();
if (late_time_init)
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);
}
/**
*/
void idr_init(struct idr *idp)
{
- init_id_cache();
memset(idp, 0, sizeof(struct idr));
spin_lock_init(&idp->lock);
}