aboutsummaryrefslogtreecommitdiffstats
path: root/mm/slab.c
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2007-07-17 07:03:29 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-17 13:23:01 -0400
commit81cda6626178cd55297831296ba8ecedbfd8b52d (patch)
treefa35a6a04db63080bbeb42f33f4b4a891b7fc96c /mm/slab.c
parentce15fea8274acca06daa1674322d37a7d3f0036b (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.c17
1 files changed, 0 insertions, 17 deletions
diff --git a/mm/slab.c b/mm/slab.c
index 1a88fded7f19..35056394139b 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -3590,23 +3590,6 @@ void *kmem_cache_alloc(struct kmem_cache *cachep, gfp_t flags)
3590EXPORT_SYMBOL(kmem_cache_alloc); 3590EXPORT_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 */
3600void *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}
3607EXPORT_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