mm/sl[aou]b: Move kmem_cache refcounting to common code
Get rid of the refcount stuff in the allocators and do that part of
kmem_cache management in the common code.
Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
diff --git a/mm/slab_common.c b/mm/slab_common.c
index 8a85a19..651a3c6 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -125,11 +125,12 @@
}
err = __kmem_cache_create(s, flags);
- if (!err)
+ if (!err) {
+ s->refcount = 1;
list_add(&s->list, &slab_caches);
- else {
+ } else {
kfree(s->name);
kmem_cache_free(kmem_cache, s);
}