From: Christoph Lameter Date: Sat, 16 Feb 2008 07:45:25 +0000 (-0800) Subject: slub: Rearrange #ifdef CONFIG_SLUB_DEBUG in calculate_sizes() X-Git-Tag: v2.6.25-rc4~107^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d8b42bf54be18b5d0bad941b3a1d3e8f022651a7;p=platform%2Fkernel%2Flinux-3.10.git slub: Rearrange #ifdef CONFIG_SLUB_DEBUG in calculate_sizes() Group SLUB_DEBUG code together to reduce the number of #ifdefs. Move some debug checks under the #ifdef. Reviewed-by: Pekka Enberg Signed-off-by: Christoph Lameter --- diff --git a/mm/slub.c b/mm/slub.c index 09b5dc8..72f5f4e 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -2130,6 +2130,14 @@ static int calculate_sizes(struct kmem_cache *s) unsigned long align = s->align; /* + * Round up object size to the next word boundary. We can only + * place the free pointer at word boundaries and this determines + * the possible location of the free pointer. + */ + size = ALIGN(size, sizeof(void *)); + +#ifdef CONFIG_SLUB_DEBUG + /* * Determine if we can poison the object itself. If the user of * the slab may touch the object after free or before allocation * then we should never poison the object itself. @@ -2140,14 +2148,7 @@ static int calculate_sizes(struct kmem_cache *s) else s->flags &= ~__OBJECT_POISON; - /* - * Round up object size to the next word boundary. We can only - * place the free pointer at word boundaries and this determines - * the possible location of the free pointer. - */ - size = ALIGN(size, sizeof(void *)); -#ifdef CONFIG_SLUB_DEBUG /* * If we are Redzoning then check if there is some space between the * end of the object and the free pointer. If not then add an