mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-20 05:31:15 +00:00
Slab allocators: Cleanup zeroing allocations
It becomes now easy to support the zeroing allocs with generic inline functions in slab.h. Provide inline definitions to allow the continued use of kzalloc, kmem_cache_zalloc etc but remove other definitions of zeroing functions from the slab allocators and util.c. Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
ce15fea827
commit
81cda66261
7 changed files with 46 additions and 126 deletions
14
mm/util.c
14
mm/util.c
|
@ -5,20 +5,6 @@
|
|||
#include <asm/uaccess.h>
|
||||
|
||||
/**
|
||||
* __kzalloc - allocate memory. The memory is set to zero.
|
||||
* @size: how many bytes of memory are required.
|
||||
* @flags: the type of memory to allocate.
|
||||
*/
|
||||
void *__kzalloc(size_t size, gfp_t flags)
|
||||
{
|
||||
void *ret = kmalloc_track_caller(size, flags);
|
||||
if (ret)
|
||||
memset(ret, 0, size);
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL(__kzalloc);
|
||||
|
||||
/*
|
||||
* kstrdup - allocate space for and copy an existing string
|
||||
*
|
||||
* @s: the string to duplicate
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue