fs: use kmem_cache_zalloc instead

Signed-off-by: Denis Cheng <crquan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Denis Cheng 2007-10-16 23:26:19 -07:00 committed by Linus Torvalds
parent 87400c0475
commit 4975e45ff6

View File

@ -102,12 +102,11 @@ struct file *get_empty_filp(void)
goto over;
}
f = kmem_cache_alloc(filp_cachep, GFP_KERNEL);
f = kmem_cache_zalloc(filp_cachep, GFP_KERNEL);
if (f == NULL)
goto fail;
percpu_counter_inc(&nr_files);
memset(f, 0, sizeof(*f));
if (security_file_alloc(f))
goto fail_sec;