summaryrefslogtreecommitdiffstats
path: root/mm/slab_common.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2012-08-14 14:53:22 -0700
committerPekka Enberg <penberg@kernel.org>2012-08-16 09:36:05 +0300
commit455ce9eb1cfa083da0def023094190aeb133855a (patch)
tree0326a78991510a6079313981b55206244537e1ff /mm/slab_common.c
parent48f2474144ac708f1faad97e82a863ca8214b602 (diff)
downloadop-kernel-dev-455ce9eb1cfa083da0def023094190aeb133855a.zip
op-kernel-dev-455ce9eb1cfa083da0def023094190aeb133855a.tar.gz
mm/slab_common.c: cleanup
Eliminate an ifdef and a label by moving all the CONFIG_DEBUG_VM checking inside the locked region. Cc: Pekka Enberg <penberg@cs.helsinki.fi> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'mm/slab_common.c')
-rw-r--r--mm/slab_common.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/mm/slab_common.c b/mm/slab_common.c
index aa3ca5b..281600b 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -53,19 +53,17 @@ 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 out;
+ " failed\n", name);
+ goto oops;
}
-#endif
-
- get_online_cpus();
- mutex_lock(&slab_mutex);
-#ifdef CONFIG_DEBUG_VM
list_for_each_entry(s, &slab_caches, list) {
char tmp;
int res;
@@ -104,9 +102,6 @@ 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