slab: initialize unused alien cache entry as NULL at alloc_alien_cache().

Comparing with existing code, it's a simpler way to use kzalloc_node()
to ensure that each unused alien cache entry is NULL.

CC: Eric Dumazet <[email protected]>
Acked-by: Andi Kleen <[email protected]>
Acked-by: Christoph Lameter <[email protected]>
Acked-by: Matt Mackall <[email protected]>
Signed-off-by: Haicheng Li <[email protected]>
Signed-off-by: Pekka Enberg <[email protected]>
This commit is contained in:
Haicheng Li 2010-01-06 15:25:23 +08:00 • committed by Pekka Enberg
commit f3186a9c51

View file

@ -983,13 +983,11 @@ static struct array_cache **alloc_alien_cache(int node, int limit, gfp_t gfp)
if (limit > 1)
limit = 12;
ac_ptr = kmalloc_node(memsize, gfp, node);
ac_ptr = kzalloc_node(memsize, gfp, node);
if (ac_ptr) {
for_each_node(i) {
if (i == node || !node_online(i)) {
ac_ptr[i] = NULL;
if (i == node || !node_online(i))
continue;
}
ac_ptr[i] = alloc_arraycache(node, limit, 0xbaadf00d, gfp);
if (!ac_ptr[i]) {
for (i--; i >= 0; i--)