diff options
| author | Christoph Lameter <cl@linux-foundation.org> | 2010-07-09 15:07:13 -0400 |
|---|---|---|
| committer | Pekka Enberg <penberg@cs.helsinki.fi> | 2010-07-16 04:13:07 -0400 |
| commit | f5b801ac38a9612b380ee9a75ab1861f0594e79f (patch) | |
| tree | c43a34bfec58e91f1aa46e95462977e24b390a37 | |
| parent | d7278bd7d1aab5c6d35fd271eeb860548f0bd0bb (diff) | |
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>
| -rw-r--r-- | mm/slub.c | 7 |
1 files changed, 7 insertions, 0 deletions
| @@ -4507,6 +4507,13 @@ static int sysfs_slab_add(struct kmem_cache *s) | |||
| 4507 | 4507 | ||
| 4508 | static void sysfs_slab_remove(struct kmem_cache *s) | 4508 | static void sysfs_slab_remove(struct kmem_cache *s) |
| 4509 | { | 4509 | { |
| 4510 | if (slab_state < SYSFS) | ||
| 4511 | /* | ||
| 4512 | * Sysfs has not been setup yet so no need to remove the | ||
| 4513 | * cache from sysfs. | ||
| 4514 | */ | ||
| 4515 | return; | ||
| 4516 | |||
| 4510 | kobject_uevent(&s->kobj, KOBJ_REMOVE); | 4517 | kobject_uevent(&s->kobj, KOBJ_REMOVE); |
| 4511 | kobject_del(&s->kobj); | 4518 | kobject_del(&s->kobj); |
| 4512 | kobject_put(&s->kobj); | 4519 | kobject_put(&s->kobj); |
