]> Pileus Git - ~andy/linux/blobdiff - mm/slob.c
drm/i915: prepare load-detect pipe code for dpms changes
[~andy/linux] / mm / slob.c
index d63923d549eccce5f7ace02c7417fe613a054b5a..45d4ca79933a84eec7e9e824f5d3117f3dc4dc64 100644 (file)
--- a/mm/slob.c
+++ b/mm/slob.c
@@ -59,6 +59,8 @@
 
 #include <linux/kernel.h>
 #include <linux/slab.h>
+#include "slab.h"
+
 #include <linux/mm.h>
 #include <linux/swap.h> /* struct reclaim_state */
 #include <linux/cache.h>
@@ -516,7 +518,7 @@ struct kmem_cache *__kmem_cache_create(const char *name, size_t size,
 
        if (c) {
                c->name = name;
-               c->size = c->object_size;
+               c->size = size;
                if (flags & SLAB_DESTROY_BY_RCU) {
                        /* leave room for rcu footer at the end of object */
                        c->size += sizeof(struct slob_rcu);
@@ -531,6 +533,7 @@ struct kmem_cache *__kmem_cache_create(const char *name, size_t size,
                        c->align = align;
 
                kmemleak_alloc(c, sizeof(struct kmem_cache), 1, GFP_KERNEL);
+               c->refcount = 1;
        }
        return c;
 }
@@ -616,19 +619,12 @@ int kmem_cache_shrink(struct kmem_cache *d)
 }
 EXPORT_SYMBOL(kmem_cache_shrink);
 
-static unsigned int slob_ready __read_mostly;
-
-int slab_is_available(void)
-{
-       return slob_ready;
-}
-
 void __init kmem_cache_init(void)
 {
-       slob_ready = 1;
+       slab_state = UP;
 }
 
 void __init kmem_cache_init_late(void)
 {
-       /* Nothing to do */
+       slab_state = FULL;
 }