aboutsummaryrefslogtreecommitdiffstats
path: root/include
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 /include
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 'include')
-rw-r--r--include/linux/slab.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 83d1a1454b7e..743a10415122 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -128,7 +128,6 @@ struct kmem_cache *kmem_cache_create(const char *, size_t, size_t,
128void kmem_cache_destroy(struct kmem_cache *); 128void kmem_cache_destroy(struct kmem_cache *);
129int kmem_cache_shrink(struct kmem_cache *); 129int kmem_cache_shrink(struct kmem_cache *);
130void kmem_cache_free(struct kmem_cache *, void *); 130void kmem_cache_free(struct kmem_cache *, void *);
131unsigned int kmem_cache_size(struct kmem_cache *);
132 131
133/* 132/*
134 * Please use this macro to create slab caches. Simply specify the 133 * Please use this macro to create slab caches. Simply specify the
@@ -388,6 +387,14 @@ static inline void *kzalloc_node(size_t size, gfp_t flags, int node)
388 return kmalloc_node(size, flags | __GFP_ZERO, node); 387 return kmalloc_node(size, flags | __GFP_ZERO, node);
389} 388}
390 389
390/*
391 * Determine the size of a slab object
392 */
393static inline unsigned int kmem_cache_size(struct kmem_cache *s)
394{
395 return s->object_size;
396}
397
391void __init kmem_cache_init_late(void); 398void __init kmem_cache_init_late(void);
392 399
393#endif /* _LINUX_SLAB_H */ 400#endif /* _LINUX_SLAB_H */