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:37 +0300 |
commit | cce89f4f6911286500cf7be0363f46c9b0a12ce0 (patch) | |
tree | c60d648404ea213d2f3d657c64fb86b2243e6a89 /mm/slab_common.c | |
parent | 8a13a4cc80bb25c9eab2e7e56bab724fcfa55fce (diff) |
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>
Diffstat (limited to 'mm/slab_common.c')
-rw-r--r-- | mm/slab_common.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c index 8a85a19d90e..651a3c60847 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -125,11 +125,12 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size, size_t align } 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); } |