mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
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 <[email protected]> Reviewed-by: Glauber Costa <[email protected]> Reviewed-by: Joonsoo Kim <[email protected]> Signed-off-by: Christoph Lameter <[email protected]> Signed-off-by: Pekka Enberg <[email protected]>
This commit is contained in:
parent
686d550d22
commit
7c9adf5a54
4 changed files with 16 additions and 4 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in a new issue