diff options
author | Christoph Lameter <clameter@sgi.com> | 2008-02-16 02:45:25 -0500 |
---|---|---|
committer | Christoph Lameter <clameter@sgi.com> | 2008-03-03 15:22:31 -0500 |
commit | d8b42bf54be18b5d0bad941b3a1d3e8f022651a7 (patch) | |
tree | 50c43281c981a82f0f1742fcc84919e35270e9f8 /mm | |
parent | ae20bfda6813387af18c7fdbc0f8b1fa7be2d05b (diff) |
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 <penberg@cs.helsinki.fi>
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/slub.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -2130,6 +2130,14 @@ static int calculate_sizes(struct kmem_cache *s) | |||
2130 | unsigned long align = s->align; | 2130 | unsigned long align = s->align; |
2131 | 2131 | ||
2132 | /* | 2132 | /* |
2133 | * Round up object size to the next word boundary. We can only | ||
2134 | * place the free pointer at word boundaries and this determines | ||
2135 | * the possible location of the free pointer. | ||
2136 | */ | ||
2137 | size = ALIGN(size, sizeof(void *)); | ||
2138 | |||
2139 | #ifdef CONFIG_SLUB_DEBUG | ||
2140 | /* | ||
2133 | * Determine if we can poison the object itself. If the user of | 2141 | * Determine if we can poison the object itself. If the user of |
2134 | * the slab may touch the object after free or before allocation | 2142 | * the slab may touch the object after free or before allocation |
2135 | * then we should never poison the object itself. | 2143 | * then we should never poison the object itself. |
@@ -2140,14 +2148,7 @@ static int calculate_sizes(struct kmem_cache *s) | |||
2140 | else | 2148 | else |
2141 | s->flags &= ~__OBJECT_POISON; | 2149 | s->flags &= ~__OBJECT_POISON; |
2142 | 2150 | ||
2143 | /* | ||
2144 | * Round up object size to the next word boundary. We can only | ||
2145 | * place the free pointer at word boundaries and this determines | ||
2146 | * the possible location of the free pointer. | ||
2147 | */ | ||
2148 | size = ALIGN(size, sizeof(void *)); | ||
2149 | 2151 | ||
2150 | #ifdef CONFIG_SLUB_DEBUG | ||
2151 | /* | 2152 | /* |
2152 | * If we are Redzoning then check if there is some space between the | 2153 | * If we are Redzoning then check if there is some space between the |
2153 | * end of the object and the free pointer. If not then add an | 2154 | * end of the object and the free pointer. If not then add an |