summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorChristoph Lameter <cl@linux.com>2013-01-10 19:12:17 +0000
committerPekka Enberg <penberg@kernel.org>2013-02-01 12:32:07 +0200
commit9425c58e5445277699ff3c2a87bac1cfebc1b48d (patch)
tree1158c67347c53ed09cd289687abf02a5c986daee /include/linux
parent95a05b428cc675694321c8f762591984f3fd2b1e (diff)
downloadlwn-9425c58e5445277699ff3c2a87bac1cfebc1b48d.tar.gz
lwn-9425c58e5445277699ff3c2a87bac1cfebc1b48d.zip
slab: Common definition for the array of kmalloc caches
Have a common definition fo the kmalloc cache arrays in SLAB and SLUB Acked-by: Glauber Costa <glommer@parallels.com> Signed-off-by: Christoph Lameter <cl@linux.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/slab.h5
-rw-r--r--include/linux/slab_def.h3
-rw-r--r--include/linux/slub_def.h6
3 files changed, 5 insertions, 9 deletions
diff --git a/include/linux/slab.h b/include/linux/slab.h
index c01780540054..f2327a898a85 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -206,6 +206,11 @@ struct kmem_cache {
#define KMALLOC_MIN_SIZE (1 << KMALLOC_SHIFT_LOW)
#endif
+extern struct kmem_cache *kmalloc_caches[KMALLOC_SHIFT_HIGH + 1];
+#ifdef CONFIG_ZONE_DMA
+extern struct kmem_cache *kmalloc_dma_caches[KMALLOC_SHIFT_HIGH + 1];
+#endif
+
/*
* Figure out which kmalloc slab an allocation of a certain size
* belongs to.
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h
index 4ff50e8d1a2c..113ec080313f 100644
--- a/include/linux/slab_def.h
+++ b/include/linux/slab_def.h
@@ -102,9 +102,6 @@ struct kmem_cache {
*/
};
-extern struct kmem_cache *kmalloc_caches[PAGE_SHIFT + MAX_ORDER];
-extern struct kmem_cache *kmalloc_dma_caches[PAGE_SHIFT + MAX_ORDER];
-
void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
void *__kmalloc(size_t size, gfp_t flags);
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index 032028ef9a34..3701896f7f8a 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -123,12 +123,6 @@ struct kmem_cache {
#endif
/*
- * We keep the general caches in an array of slab caches that are used for
- * 2^x bytes of allocations.
- */
-extern struct kmem_cache *kmalloc_caches[KMALLOC_SHIFT_HIGH + 1];
-
-/*
* Find the slab cache for a given combination of allocation flags and size.
*
* This ought to end up with a global pointer to the right cache