mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-04 02:16:45 +07:00
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>
This commit is contained in:
parent
48f2474144
commit
455ce9eb1c
@ -53,19 +53,17 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size, size_t align
|
||||
{
|
||||
struct kmem_cache *s = NULL;
|
||||
|
||||
#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;
|
||||
}
|
||||
#endif
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
list_for_each_entry(s, &slab_caches, list) {
|
||||
char tmp;
|
||||
int res;
|
||||
@ -104,9 +102,6 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size, size_t align
|
||||
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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user