aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorEzequiel Garcia <elezegarcia@gmail.com>2012-10-19 08:33:12 -0400
committerPekka Enberg <penberg@kernel.org>2012-10-31 02:52:15 -0400
commit242860a47a75b933a79a30f6a40bf4858f4a3ecc (patch)
tree2c6c098274ea1a335ecc9292551eda693ccbead5 /mm
parentfe74fe2bf293d061826f0d7afc2ca8456bdbb40e (diff)
mm/sl[aou]b: Move common kmem_cache_size() to slab.h
This function is identically defined in all three allocators and it's trivial to move it to slab.h Since now it's static, inline, header-defined function this patch also drops the EXPORT_SYMBOL tag. Cc: Pekka Enberg <penberg@kernel.org> Cc: Matt Mackall <mpm@selenic.com> Acked-by: Christoph Lameter <cl@linux.com> Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/slab.c6
-rw-r--r--mm/slob.c6
-rw-r--r--mm/slub.c9
3 files changed, 0 insertions, 21 deletions
diff --git a/mm/slab.c b/mm/slab.c
index 6d5c83c6ddd5..1f7fd5f51f87 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3969,12 +3969,6 @@ void kfree(const void *objp)
3969} 3969}
3970EXPORT_SYMBOL(kfree); 3970EXPORT_SYMBOL(kfree);
3971 3971
3972unsigned int kmem_cache_size(struct kmem_cache *cachep)
3973{
3974 return cachep->object_size;
3975}
3976EXPORT_SYMBOL(kmem_cache_size);
3977
3978/* 3972/*
3979 * This initializes kmem_list3 or resizes various caches for all nodes. 3973 * This initializes kmem_list3 or resizes various caches for all nodes.
3980 */ 3974 */
diff --git a/mm/slob.c b/mm/slob.c
index 287a88aa4a61..fffbc820774d 100644
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -604,12 +604,6 @@ void kmem_cache_free(struct kmem_cache *c, void *b)
604} 604}
605EXPORT_SYMBOL(kmem_cache_free); 605EXPORT_SYMBOL(kmem_cache_free);
606 606
607unsigned int kmem_cache_size(struct kmem_cache *c)
608{
609 return c->object_size;
610}
611EXPORT_SYMBOL(kmem_cache_size);
612
613int __kmem_cache_shutdown(struct kmem_cache *c) 607int __kmem_cache_shutdown(struct kmem_cache *c)
614{ 608{
615 /* No way to check for remaining objects */ 609 /* No way to check for remaining objects */
diff --git a/mm/slub.c b/mm/slub.c
index 35483e0ab6bc..deee7c754a7d 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3121,15 +3121,6 @@ error:
3121 return -EINVAL; 3121 return -EINVAL;
3122} 3122}
3123 3123
3124/*
3125 * Determine the size of a slab object
3126 */
3127unsigned int kmem_cache_size(struct kmem_cache *s)
3128{
3129 return s->object_size;
3130}
3131EXPORT_SYMBOL(kmem_cache_size);
3132
3133static void list_slab_objects(struct kmem_cache *s, struct page *page, 3124static void list_slab_objects(struct kmem_cache *s, struct page *page,
3134 const char *text) 3125 const char *text)
3135{ 3126{