X-Git-Url: http://git.samba.org/samba.git/?a=blobdiff_plain;f=mm%2Fslab.c;h=503317188926a8c84a54813aa9a8a5d4994d2ca6;hb=e07719502916a675023d9d31b9fd4370c7413b68;hp=2a31ee3c5814f192234385303a0d86cc77790580;hpb=fbd78afe34d9cc3a86aff7cc214d9f06e815e63e;p=sfrench%2Fcifs-2.6.git diff --git a/mm/slab.c b/mm/slab.c index 2a31ee3c5814..503317188926 100644 --- a/mm/slab.c +++ b/mm/slab.c @@ -2040,17 +2040,13 @@ __kmem_cache_create (struct kmem_cache *cachep, unsigned long flags) * unaligned accesses for some archs when redzoning is used, and makes * sure any on-slab bufctl's are also correctly aligned. */ - if (size & (BYTES_PER_WORD - 1)) { - size += (BYTES_PER_WORD - 1); - size &= ~(BYTES_PER_WORD - 1); - } + size = ALIGN(size, BYTES_PER_WORD); if (flags & SLAB_RED_ZONE) { ralign = REDZONE_ALIGN; /* If redzoning, ensure that the second redzone is suitably * aligned, by adjusting the object size accordingly. */ - size += REDZONE_ALIGN - 1; - size &= ~(REDZONE_ALIGN - 1); + size = ALIGN(size, REDZONE_ALIGN); } /* 3) caller mandated alignment */