Commit e51bfd0a authored by Marcin Slusarz's avatar Marcin Slusarz Committed by Christoph Lameter

slab: avoid double initialization & do initialization in 1 place

- alloc_slabmgmt: initialize all slab fields in 1 place
- slab->nodeid was initialized twice: in alloc_slabmgmt
  and immediately after it in cache_grow
Signed-off-by: default avatarMarcin Slusarz <marcin.slusarz@gmail.com>
CC: Christoph Lameter <clameter@sgi.com>
Reviewed-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: default avatarChristoph Lameter <clameter@sgi.com>
parent e760e716
...@@ -2630,6 +2630,7 @@ static struct slab *alloc_slabmgmt(struct kmem_cache *cachep, void *objp, ...@@ -2630,6 +2630,7 @@ static struct slab *alloc_slabmgmt(struct kmem_cache *cachep, void *objp,
slabp->colouroff = colour_off; slabp->colouroff = colour_off;
slabp->s_mem = objp + colour_off; slabp->s_mem = objp + colour_off;
slabp->nodeid = nodeid; slabp->nodeid = nodeid;
slabp->free = 0;
return slabp; return slabp;
} }
...@@ -2683,7 +2684,6 @@ static void cache_init_objs(struct kmem_cache *cachep, ...@@ -2683,7 +2684,6 @@ static void cache_init_objs(struct kmem_cache *cachep,
slab_bufctl(slabp)[i] = i + 1; slab_bufctl(slabp)[i] = i + 1;
} }
slab_bufctl(slabp)[i - 1] = BUFCTL_END; slab_bufctl(slabp)[i - 1] = BUFCTL_END;
slabp->free = 0;
} }
static void kmem_flagcheck(struct kmem_cache *cachep, gfp_t flags) static void kmem_flagcheck(struct kmem_cache *cachep, gfp_t flags)
...@@ -2816,7 +2816,6 @@ static int cache_grow(struct kmem_cache *cachep, ...@@ -2816,7 +2816,6 @@ static int cache_grow(struct kmem_cache *cachep,
if (!slabp) if (!slabp)
goto opps1; goto opps1;
slabp->nodeid = nodeid;
slab_map_pages(cachep, slabp, objp); slab_map_pages(cachep, slabp, objp);
cache_init_objs(cachep, slabp); cache_init_objs(cachep, slabp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment