diff options
author | Christoph Lameter <cl@linux.com> | 2012-11-28 16:23:16 +0000 |
---|---|---|
committer | Pekka Enberg <penberg@kernel.org> | 2012-12-11 12:14:28 +0200 |
commit | 4590685546a374fb0f60682ce0e3a6fd48911d46 (patch) | |
tree | 1287ce1e1633067f8bf2cf9f93f1d6fe8a1f8908 /mm/slob.c | |
parent | 2f9baa9fcf8d0a204ca129a671d6086cc100faab (diff) | |
download | linux-3.10-4590685546a374fb0f60682ce0e3a6fd48911d46.tar.gz linux-3.10-4590685546a374fb0f60682ce0e3a6fd48911d46.tar.bz2 linux-3.10-4590685546a374fb0f60682ce0e3a6fd48911d46.zip |
mm/sl[aou]b: Common alignment code
Extract the code to do object alignment from the allocators.
Do the alignment calculations in slab_common so that the
__kmem_cache_create functions of the allocators do not have
to deal with alignment.
Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'mm/slob.c')
-rw-r--r-- | mm/slob.c | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/mm/slob.c b/mm/slob.c index 87e16c4d914..795bab7d391 100644 --- a/mm/slob.c +++ b/mm/slob.c @@ -123,7 +123,6 @@ static inline void clear_slob_page_free(struct page *sp) #define SLOB_UNIT sizeof(slob_t) #define SLOB_UNITS(size) (((size) + SLOB_UNIT - 1)/SLOB_UNIT) -#define SLOB_ALIGN L1_CACHE_BYTES /* * struct slob_rcu is inserted at the tail of allocated slob blocks, which @@ -527,20 +526,11 @@ EXPORT_SYMBOL(ksize); int __kmem_cache_create(struct kmem_cache *c, unsigned long flags) { - size_t align = c->size; - if (flags & SLAB_DESTROY_BY_RCU) { /* leave room for rcu footer at the end of object */ c->size += sizeof(struct slob_rcu); } c->flags = flags; - /* ignore alignment unless it's forced */ - c->align = (flags & SLAB_HWCACHE_ALIGN) ? SLOB_ALIGN : 0; - if (c->align < ARCH_SLAB_MINALIGN) - c->align = ARCH_SLAB_MINALIGN; - if (c->align < align) - c->align = align; - return 0; } |