diff options
author | Christoph Lameter <clameter@sgi.com> | 2007-07-17 07:03:29 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-17 13:23:01 -0400 |
commit | 81cda6626178cd55297831296ba8ecedbfd8b52d (patch) | |
tree | fa35a6a04db63080bbeb42f33f4b4a891b7fc96c /mm/slab.c | |
parent | ce15fea8274acca06daa1674322d37a7d3f0036b (diff) |
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>
Diffstat (limited to 'mm/slab.c')
-rw-r--r-- | mm/slab.c | 17 |
1 files changed, 0 insertions, 17 deletions
@@ -3590,23 +3590,6 @@ void *kmem_cache_alloc(struct kmem_cache *cachep, gfp_t flags) | |||
3590 | EXPORT_SYMBOL(kmem_cache_alloc); | 3590 | EXPORT_SYMBOL(kmem_cache_alloc); |
3591 | 3591 | ||
3592 | /** | 3592 | /** |
3593 | * kmem_cache_zalloc - Allocate an object. The memory is set to zero. | ||
3594 | * @cache: The cache to allocate from. | ||
3595 | * @flags: See kmalloc(). | ||
3596 | * | ||
3597 | * Allocate an object from this cache and set the allocated memory to zero. | ||
3598 | * The flags are only relevant if the cache has no available objects. | ||
3599 | */ | ||
3600 | void *kmem_cache_zalloc(struct kmem_cache *cache, gfp_t flags) | ||
3601 | { | ||
3602 | void *ret = __cache_alloc(cache, flags, __builtin_return_address(0)); | ||
3603 | if (ret) | ||
3604 | memset(ret, 0, obj_size(cache)); | ||
3605 | return ret; | ||
3606 | } | ||
3607 | EXPORT_SYMBOL(kmem_cache_zalloc); | ||
3608 | |||
3609 | /** | ||
3610 | * kmem_ptr_validate - check if an untrusted pointer might | 3593 | * kmem_ptr_validate - check if an untrusted pointer might |
3611 | * be a slab entry. | 3594 | * be a slab entry. |
3612 | * @cachep: the cache we're checking against | 3595 | * @cachep: the cache we're checking against |