Skip to content
This repository has been archived by the owner on Dec 14, 2022. It is now read-only.

Commit

Permalink
Revert "mm/slab_common.c: cleanup"
Browse files Browse the repository at this point in the history
This reverts commit 455ce9e. Andrew
sent a better version.

Signed-off-by: Pekka Enberg <[email protected]>
  • Loading branch information
penberg committed Aug 16, 2012
1 parent e24fc41 commit b920536
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions mm/slab_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -102,6 +104,9 @@ 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);

Expand Down

0 comments on commit b920536

Please sign in to comment.