diff options
author | Christoph Lameter <cl@linux-foundation.org> | 2010-07-09 21:07:13 +0200 |
---|---|---|
committer | Pekka Enberg <penberg@cs.helsinki.fi> | 2010-07-16 10:13:07 +0200 |
commit | f5b801ac38a9612b380ee9a75ab1861f0594e79f (patch) | |
tree | c43a34bfec58e91f1aa46e95462977e24b390a37 /mm | |
parent | slub: Check kasprintf results in kmem_cache_init() (diff) | |
download | linux-f5b801ac38a9612b380ee9a75ab1861f0594e79f.tar.xz linux-f5b801ac38a9612b380ee9a75ab1861f0594e79f.zip |
slub: Allow removal of slab caches during boot
If a slab cache is removed before we have setup sysfs then simply skip over
the sysfs handling.
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Roland Dreier <rdreier@cisco.com>
Acked-by: David Rientjes <rientjes@google.com>
Signed-off-by: Christoph Lameter <cl@linux-foundation.org>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/slub.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/mm/slub.c b/mm/slub.c index 8655be5b7404..b89a7c99b2fa 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -4507,6 +4507,13 @@ static int sysfs_slab_add(struct kmem_cache *s) static void sysfs_slab_remove(struct kmem_cache *s) { + if (slab_state < SYSFS) + /* + * Sysfs has not been setup yet so no need to remove the + * cache from sysfs. + */ + return; + kobject_uevent(&s->kobj, KOBJ_REMOVE); kobject_del(&s->kobj); kobject_put(&s->kobj); |