Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 60748
b: refs/heads/master
c: a0e1d1b
h: refs/heads/master
v: v3
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Jul 17, 2007
1 parent e65438b commit c2798f8
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 434e245ddd3f14aa8eef97cae16c71b863ab092a
refs/heads/master: a0e1d1be204612ee83b3afe8aa24c5d27e63d464
28 changes: 15 additions & 13 deletions trunk/mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -2192,12 +2192,13 @@ void kmem_cache_destroy(struct kmem_cache *s)
s->refcount--;
if (!s->refcount) {
list_del(&s->list);
up_write(&slub_lock);
if (kmem_cache_close(s))
WARN_ON(1);
sysfs_slab_remove(s);
kfree(s);
}
up_write(&slub_lock);
} else
up_write(&slub_lock);
}
EXPORT_SYMBOL(kmem_cache_destroy);

Expand Down Expand Up @@ -2679,25 +2680,26 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size,
*/
s->objsize = max(s->objsize, (int)size);
s->inuse = max_t(int, s->inuse, ALIGN(size, sizeof(void *)));
up_write(&slub_lock);
if (sysfs_slab_alias(s, name))
goto err;
} else {
s = kmalloc(kmem_size, GFP_KERNEL);
if (s && kmem_cache_open(s, GFP_KERNEL, name,
return s;
}
s = kmalloc(kmem_size, GFP_KERNEL);
if (s) {
if (kmem_cache_open(s, GFP_KERNEL, name,
size, align, flags, ctor)) {
if (sysfs_slab_add(s)) {
kfree(s);
goto err;
}
list_add(&s->list, &slab_caches);
} else
kfree(s);
up_write(&slub_lock);
if (sysfs_slab_add(s))
goto err;
return s;
}
kfree(s);
}
up_write(&slub_lock);
return s;

err:
up_write(&slub_lock);
if (flags & SLAB_PANIC)
panic("Cannot create slabcache %s\n", name);
else
Expand Down

0 comments on commit c2798f8

Please sign in to comment.