diff options
author | Christoph Lameter <cl@linux.com> | 2012-09-04 19:38:33 -0400 |
---|---|---|
committer | Pekka Enberg <penberg@kernel.org> | 2012-09-05 05:00:35 -0400 |
commit | 7c9adf5a5471647f392169ef19d3e81dcfa76045 (patch) | |
tree | 4e32d1875e45eafd4c4c9f2caedcf3419479c0b8 /mm/slub.c | |
parent | 686d550d222e8f83f6e709debbedf9d8ef77aec7 (diff) |
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/slub.c')
-rw-r--r-- | mm/slub.c | 2 |
1 files changed, 0 insertions, 2 deletions
@@ -3975,7 +3975,6 @@ struct kmem_cache *__kmem_cache_create(const char *name, size_t size, | |||
3975 | size, align, flags, ctor)) { | 3975 | size, align, flags, ctor)) { |
3976 | int r; | 3976 | int r; |
3977 | 3977 | ||
3978 | list_add(&s->list, &slab_caches); | ||
3979 | mutex_unlock(&slab_mutex); | 3978 | mutex_unlock(&slab_mutex); |
3980 | r = sysfs_slab_add(s); | 3979 | r = sysfs_slab_add(s); |
3981 | mutex_lock(&slab_mutex); | 3980 | mutex_lock(&slab_mutex); |
@@ -3983,7 +3982,6 @@ struct kmem_cache *__kmem_cache_create(const char *name, size_t size, | |||
3983 | if (!r) | 3982 | if (!r) |
3984 | return s; | 3983 | return s; |
3985 | 3984 | ||
3986 | list_del(&s->list); | ||
3987 | kmem_cache_close(s); | 3985 | kmem_cache_close(s); |
3988 | } | 3986 | } |
3989 | kmem_cache_free(kmem_cache, s); | 3987 | kmem_cache_free(kmem_cache, s); |