diff options
author | Pekka Enberg <penberg@kernel.org> | 2012-08-16 03:12:18 -0400 |
---|---|---|
committer | Pekka Enberg <penberg@kernel.org> | 2012-08-16 03:12:18 -0400 |
commit | b920536aa0a4fd178b2957774adfe409027fe55b (patch) | |
tree | ab9070a88d519e93b1f547d9aaa63e48d460cbea /mm | |
parent | e24fc410f58cc7851188a6e996dc6ce5c4259eb4 (diff) |
Revert "mm/slab_common.c: cleanup"
This reverts commit 455ce9eb1cfa083da0def023094190aeb133855a. Andrew
sent a better version.
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/slab_common.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c index 281600b30100..aa3ca5bb01b5 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c | |||
@@ -53,17 +53,19 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size, size_t align | |||
53 | { | 53 | { |
54 | struct kmem_cache *s = NULL; | 54 | struct kmem_cache *s = NULL; |
55 | 55 | ||
56 | get_online_cpus(); | ||
57 | mutex_lock(&slab_mutex); | ||
58 | |||
59 | #ifdef CONFIG_DEBUG_VM | 56 | #ifdef CONFIG_DEBUG_VM |
60 | if (!name || in_interrupt() || size < sizeof(void *) || | 57 | if (!name || in_interrupt() || size < sizeof(void *) || |
61 | size > KMALLOC_MAX_SIZE) { | 58 | size > KMALLOC_MAX_SIZE) { |
62 | printk(KERN_ERR "kmem_cache_create(%s) integrity check" | 59 | printk(KERN_ERR "kmem_cache_create(%s) integrity check" |
63 | " failed\n", name); | 60 | " failed\n", name); |
64 | goto oops; | 61 | goto out; |
65 | } | 62 | } |
63 | #endif | ||
64 | |||
65 | get_online_cpus(); | ||
66 | mutex_lock(&slab_mutex); | ||
66 | 67 | ||
68 | #ifdef CONFIG_DEBUG_VM | ||
67 | list_for_each_entry(s, &slab_caches, list) { | 69 | list_for_each_entry(s, &slab_caches, list) { |
68 | char tmp; | 70 | char tmp; |
69 | int res; | 71 | int res; |
@@ -102,6 +104,9 @@ oops: | |||
102 | mutex_unlock(&slab_mutex); | 104 | mutex_unlock(&slab_mutex); |
103 | put_online_cpus(); | 105 | put_online_cpus(); |
104 | 106 | ||
107 | #ifdef CONFIG_DEBUG_VM | ||
108 | out: | ||
109 | #endif | ||
105 | if (!s && (flags & SLAB_PANIC)) | 110 | if (!s && (flags & SLAB_PANIC)) |
106 | panic("kmem_cache_create: Failed to create slab '%s'\n", name); | 111 | panic("kmem_cache_create: Failed to create slab '%s'\n", name); |
107 | 112 | ||