Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 28934
b: refs/heads/master
c: ddc2e81
h: refs/heads/master
v: v3
  • Loading branch information
Pekka Enberg authored and Linus Torvalds committed Jun 23, 2006
1 parent f346063 commit 941a826
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 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: 8d3c138b77f195ca0eee6fb639ae73f5ea9edb6b
refs/heads/master: ddc2e812d592457747c4367fb73edcaa8e1e49ff
13 changes: 4 additions & 9 deletions trunk/mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@ static inline struct kmem_cache *page_get_cache(struct page *page)
{
if (unlikely(PageCompound(page)))
page = (struct page *)page_private(page);
BUG_ON(!PageSlab(page));
return (struct kmem_cache *)page->lru.next;
}

Expand All @@ -604,6 +605,7 @@ static inline struct slab *page_get_slab(struct page *page)
{
if (unlikely(PageCompound(page)))
page = (struct page *)page_private(page);
BUG_ON(!PageSlab(page));
return (struct slab *)page->lru.prev;
}

Expand Down Expand Up @@ -2669,15 +2671,6 @@ static void *cache_free_debugcheck(struct kmem_cache *cachep, void *objp,
kfree_debugcheck(objp);
page = virt_to_page(objp);

if (page_get_cache(page) != cachep) {
printk(KERN_ERR "mismatch in kmem_cache_free: expected "
"cache %p, got %p\n",
page_get_cache(page), cachep);
printk(KERN_ERR "%p is %s.\n", cachep, cachep->name);
printk(KERN_ERR "%p is %s.\n", page_get_cache(page),
page_get_cache(page)->name);
WARN_ON(1);
}
slabp = page_get_slab(page);

if (cachep->flags & SLAB_RED_ZONE) {
Expand Down Expand Up @@ -3393,6 +3386,8 @@ void kmem_cache_free(struct kmem_cache *cachep, void *objp)
{
unsigned long flags;

BUG_ON(virt_to_cache(objp) != cachep);

local_irq_save(flags);
__cache_free(cachep, objp);
local_irq_restore(flags);
Expand Down

0 comments on commit 941a826

Please sign in to comment.