diff options
author | Christoph Lameter <cl@linux.com> | 2012-09-04 23:38:33 +0000 |
---|---|---|
committer | Pekka Enberg <penberg@kernel.org> | 2012-09-05 12:00:35 +0300 |
commit | 7c9adf5a5471647f392169ef19d3e81dcfa76045 (patch) | |
tree | 4e32d1875e45eafd4c4c9f2caedcf3419479c0b8 /mm/slob.c | |
parent | 686d550d222e8f83f6e709debbedf9d8ef77aec7 (diff) | |
download | linux-7c9adf5a5471647f392169ef19d3e81dcfa76045.tar.gz linux-7c9adf5a5471647f392169ef19d3e81dcfa76045.tar.bz2 linux-7c9adf5a5471647f392169ef19d3e81dcfa76045.zip |
mm/sl[aou]b: Move list_add() to slab_common.c
Move the code to append the new kmem_cache to the list of slab caches to
the kmem_cache_create code in the shared code.
This is possible now since the acquisition of the mutex was moved into
kmem_cache_create().
Acked-by: David Rientjes <rientjes@google.com>
Reviewed-by: Glauber Costa <glommer@parallels.com>
Reviewed-by: Joonsoo Kim <js1304@gmail.com>
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 | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mm/slob.c b/mm/slob.c index 45d4ca79933a..5225d28f2694 100644 --- a/mm/slob.c +++ b/mm/slob.c @@ -540,6 +540,10 @@ struct kmem_cache *__kmem_cache_create(const char *name, size_t size, void kmem_cache_destroy(struct kmem_cache *c) { + mutex_lock(&slab_mutex); + list_del(&c->list); + mutex_unlock(&slab_mutex); + kmemleak_free(c); if (c->flags & SLAB_DESTROY_BY_RCU) rcu_barrier(); |