mm/sl[aou]b: Get rid of __kmem_cache_destroy
[platform/adaptation/renesas_rcar/renesas_kernel.git] / mm / slob.c
index 45d4ca7..50f6053 100644 (file)
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -538,15 +538,6 @@ struct kmem_cache *__kmem_cache_create(const char *name, size_t size,
        return c;
 }
 
-void kmem_cache_destroy(struct kmem_cache *c)
-{
-       kmemleak_free(c);
-       if (c->flags & SLAB_DESTROY_BY_RCU)
-               rcu_barrier();
-       slob_free(c, sizeof(struct kmem_cache));
-}
-EXPORT_SYMBOL(kmem_cache_destroy);
-
 void *kmem_cache_alloc_node(struct kmem_cache *c, gfp_t flags, int node)
 {
        void *b;
@@ -613,14 +604,28 @@ unsigned int kmem_cache_size(struct kmem_cache *c)
 }
 EXPORT_SYMBOL(kmem_cache_size);
 
+int __kmem_cache_shutdown(struct kmem_cache *c)
+{
+       /* No way to check for remaining objects */
+       return 0;
+}
+
 int kmem_cache_shrink(struct kmem_cache *d)
 {
        return 0;
 }
 EXPORT_SYMBOL(kmem_cache_shrink);
 
+struct kmem_cache kmem_cache_boot = {
+       .name = "kmem_cache",
+       .size = sizeof(struct kmem_cache),
+       .flags = SLAB_PANIC,
+       .align = ARCH_KMALLOC_MINALIGN,
+};
+
 void __init kmem_cache_init(void)
 {
+       kmem_cache = &kmem_cache_boot;
        slab_state = UP;
 }