Add virt_to_head_page and consolidate code in slab and slub

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Christoph Lameter
2007-05-06 14:49:41 -07:00
committed by Linus Torvalds
parent 6d7779538f
commit b49af68ff9
3 changed files with 14 additions and 11 deletions

View File

@ -286,6 +286,12 @@ static inline void get_page(struct page *page)
atomic_inc(&page->_count);
}
static inline struct page *virt_to_head_page(const void *x)
{
struct page *page = virt_to_page(x);
return compound_head(page);
}
/*
* Setup the page count before being freed into the page allocator for
* the first time (boot or memory hotplug)