summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorPekka Enberg <penberg@kernel.org>2012-08-16 10:12:18 +0300
committerPekka Enberg <penberg@kernel.org>2012-08-16 10:12:18 +0300
commitb920536aa0a4fd178b2957774adfe409027fe55b (patch)
treeab9070a88d519e93b1f547d9aaa63e48d460cbea /mm
parente24fc410f58cc7851188a6e996dc6ce5c4259eb4 (diff)
downloadop-kernel-dev-b920536aa0a4fd178b2957774adfe409027fe55b.zip
op-kernel-dev-b920536aa0a4fd178b2957774adfe409027fe55b.tar.gz
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.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c
index 281600b..aa3ca5b 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
{
struct kmem_cache *s = NULL;
- get_online_cpus();
- mutex_lock(&slab_mutex);
-
#ifdef CONFIG_DEBUG_VM
if (!name || in_interrupt() || size < sizeof(void *) ||
size > KMALLOC_MAX_SIZE) {
printk(KERN_ERR "kmem_cache_create(%s) integrity check"
- " failed\n", name);
- goto oops;
+ " failed\n", name);
+ goto out;
}
+#endif
+
+ get_online_cpus();
+ mutex_lock(&slab_mutex);
+#ifdef CONFIG_DEBUG_VM
list_for_each_entry(s, &slab_caches, list) {
char tmp;
int res;
@@ -102,6 +104,9 @@ oops:
mutex_unlock(&slab_mutex);
put_online_cpus();
+#ifdef CONFIG_DEBUG_VM
+out:
+#endif
if (!s && (flags & SLAB_PANIC))
panic("kmem_cache_create: Failed to create slab '%s'\n", name);
OpenPOWER on IntegriCloud