diff options
author | Christoph Lameter <cl@linux.com> | 2012-07-06 16:25:10 -0400 |
---|---|---|
committer | Pekka Enberg <penberg@kernel.org> | 2012-07-09 05:13:30 -0400 |
commit | 039363f38bfe5f6281e9eae5e0518b11577d9d50 (patch) | |
tree | 11aa16feccb68b035aa9e9f390a54e57fa2ffd83 /include/linux/slab.h | |
parent | 068ce415bea9e2b96bde76dc1bf6e672a89903ee (diff) |
mm, sl[aou]b: Extract common code for kmem_cache_create()
Kmem_cache_create() does a variety of sanity checks but those
vary depending on the allocator. Use the strictest tests and put them into
a slab_common file. Make the tests conditional on CONFIG_DEBUG_VM.
This patch has the effect of adding sanity checks for SLUB and SLOB
under CONFIG_DEBUG_VM and removes the checks in SLAB for !CONFIG_DEBUG_VM.
Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'include/linux/slab.h')
-rw-r--r-- | include/linux/slab.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/slab.h b/include/linux/slab.h index 0dd2dfa7bec..0cb7c7eb041 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -130,6 +130,10 @@ int kmem_cache_shrink(struct kmem_cache *); | |||
130 | void kmem_cache_free(struct kmem_cache *, void *); | 130 | void kmem_cache_free(struct kmem_cache *, void *); |
131 | unsigned int kmem_cache_size(struct kmem_cache *); | 131 | unsigned int kmem_cache_size(struct kmem_cache *); |
132 | 132 | ||
133 | /* Slab internal function */ | ||
134 | struct kmem_cache *__kmem_cache_create(const char *, size_t, size_t, | ||
135 | unsigned long, | ||
136 | void (*)(void *)); | ||
133 | /* | 137 | /* |
134 | * Please use this macro to create slab caches. Simply specify the | 138 | * Please use this macro to create slab caches. Simply specify the |
135 | * name of the structure and maybe some flags that are listed above. | 139 | * name of the structure and maybe some flags that are listed above. |