mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-08 07:35:04 +00:00
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>
This commit is contained in:
parent
fe74fe2bf2
commit
242860a47a
4 changed files with 8 additions and 22 deletions
|
@ -128,7 +128,6 @@ struct kmem_cache *kmem_cache_create(const char *, size_t, size_t,
|
||||||
void kmem_cache_destroy(struct kmem_cache *);
|
void kmem_cache_destroy(struct kmem_cache *);
|
||||||
int kmem_cache_shrink(struct kmem_cache *);
|
int kmem_cache_shrink(struct kmem_cache *);
|
||||||
void kmem_cache_free(struct kmem_cache *, void *);
|
void kmem_cache_free(struct kmem_cache *, void *);
|
||||||
unsigned int kmem_cache_size(struct kmem_cache *);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Please use this macro to create slab caches. Simply specify the
|
* 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)
|
||||||
return kmalloc_node(size, flags | __GFP_ZERO, node);
|
return kmalloc_node(size, flags | __GFP_ZERO, node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Determine the size of a slab object
|
||||||
|
*/
|
||||||
|
static inline unsigned int kmem_cache_size(struct kmem_cache *s)
|
||||||
|
{
|
||||||
|
return s->object_size;
|
||||||
|
}
|
||||||
|
|
||||||
void __init kmem_cache_init_late(void);
|
void __init kmem_cache_init_late(void);
|
||||||
|
|
||||||
#endif /* _LINUX_SLAB_H */
|
#endif /* _LINUX_SLAB_H */
|
||||||
|
|
|
@ -3969,12 +3969,6 @@ void kfree(const void *objp)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(kfree);
|
EXPORT_SYMBOL(kfree);
|
||||||
|
|
||||||
unsigned int kmem_cache_size(struct kmem_cache *cachep)
|
|
||||||
{
|
|
||||||
return cachep->object_size;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(kmem_cache_size);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This initializes kmem_list3 or resizes various caches for all nodes.
|
* This initializes kmem_list3 or resizes various caches for all nodes.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -604,12 +604,6 @@ void kmem_cache_free(struct kmem_cache *c, void *b)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(kmem_cache_free);
|
EXPORT_SYMBOL(kmem_cache_free);
|
||||||
|
|
||||||
unsigned int kmem_cache_size(struct kmem_cache *c)
|
|
||||||
{
|
|
||||||
return c->object_size;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(kmem_cache_size);
|
|
||||||
|
|
||||||
int __kmem_cache_shutdown(struct kmem_cache *c)
|
int __kmem_cache_shutdown(struct kmem_cache *c)
|
||||||
{
|
{
|
||||||
/* No way to check for remaining objects */
|
/* No way to check for remaining objects */
|
||||||
|
|
|
@ -3121,15 +3121,6 @@ error:
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Determine the size of a slab object
|
|
||||||
*/
|
|
||||||
unsigned int kmem_cache_size(struct kmem_cache *s)
|
|
||||||
{
|
|
||||||
return s->object_size;
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(kmem_cache_size);
|
|
||||||
|
|
||||||
static void list_slab_objects(struct kmem_cache *s, struct page *page,
|
static void list_slab_objects(struct kmem_cache *s, struct page *page,
|
||||||
const char *text)
|
const char *text)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue