aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slab_common.c
diff options
context:
space:
mode:
authorChristoph Lameter <cl@linux.com>2012-07-06 16:25:11 -0400
committerPekka Enberg <penberg@kernel.org>2012-07-09 05:13:35 -0400
commit97d06609158e61f6bdf538c4a6788e2de492236f (patch)
treefa3f57ff3e2d3f4f866d84dd9d634ade43941be8 /mm/slab_common.c
parent039363f38bfe5f6281e9eae5e0518b11577d9d50 (diff)
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/slab_common.c')
-rw-r--r--mm/slab_common.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c
index 80412beb67cc..ca1aaf69a1f5 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -16,6 +16,10 @@
16#include <asm/tlbflush.h> 16#include <asm/tlbflush.h>
17#include <asm/page.h> 17#include <asm/page.h>
18 18
19#include "slab.h"
20
21enum slab_state slab_state;
22
19/* 23/*
20 * kmem_cache_create - Create a cache. 24 * kmem_cache_create - Create a cache.
21 * @name: A string which is used in /proc/slabinfo to identify this cache. 25 * @name: A string which is used in /proc/slabinfo to identify this cache.
@@ -66,3 +70,8 @@ out:
66 return s; 70 return s;
67} 71}
68EXPORT_SYMBOL(kmem_cache_create); 72EXPORT_SYMBOL(kmem_cache_create);
73
74int slab_is_available(void)
75{
76 return slab_state >= UP;
77}