diff options
author | Christoph Lameter <cl@linux.com> | 2012-07-06 15:25:11 -0500 |
---|---|---|
committer | Pekka Enberg <penberg@kernel.org> | 2012-07-09 12:13:35 +0300 |
commit | 97d06609158e61f6bdf538c4a6788e2de492236f (patch) | |
tree | fa3f57ff3e2d3f4f866d84dd9d634ade43941be8 /mm/slob.c | |
parent | 039363f38bfe5f6281e9eae5e0518b11577d9d50 (diff) | |
download | linux-3.10-97d06609158e61f6bdf538c4a6788e2de492236f.tar.gz linux-3.10-97d06609158e61f6bdf538c4a6788e2de492236f.tar.bz2 linux-3.10-97d06609158e61f6bdf538c4a6788e2de492236f.zip |
mm, sl[aou]b: Common definition for boot state of the slab allocators
All allocators have some sort of support for the bootstrap status.
Setup a common definition for the boot states and make all slab
allocators use that definition.
Reviewed-by: Glauber Costa <glommer@parallels.com>
Reviewed-by: Joonsoo Kim <js1304@gmail.com>
Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'mm/slob.c')
-rw-r--r-- | mm/slob.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/mm/slob.c b/mm/slob.c index d63923d549e..0111e0dece9 100644 --- a/mm/slob.c +++ b/mm/slob.c @@ -59,6 +59,8 @@ #include <linux/kernel.h> #include <linux/slab.h> +#include "slab.h" + #include <linux/mm.h> #include <linux/swap.h> /* struct reclaim_state */ #include <linux/cache.h> @@ -531,6 +533,7 @@ struct kmem_cache *__kmem_cache_create(const char *name, size_t size, c->align = align; kmemleak_alloc(c, sizeof(struct kmem_cache), 1, GFP_KERNEL); + c->refcount = 1; } return c; } @@ -616,19 +619,12 @@ int kmem_cache_shrink(struct kmem_cache *d) } EXPORT_SYMBOL(kmem_cache_shrink); -static unsigned int slob_ready __read_mostly; - -int slab_is_available(void) -{ - return slob_ready; -} - void __init kmem_cache_init(void) { - slob_ready = 1; + slab_state = UP; } void __init kmem_cache_init_late(void) { - /* Nothing to do */ + slab_state = FULL; } |