aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mm.h
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2007-05-06 17:49:41 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-07 15:12:54 -0400
commitb49af68ff9fc5d6e0d96704a1843968b91cc73c6 (patch)
treeeb5e6d9425a9069cdfc45b09a1d0f61f1419d2c2 /include/linux/mm.h
parent6d7779538f765963ced45a3fa4bed7ba8d2c277d (diff)
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>
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r--include/linux/mm.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 695b90437bbc..4670ebd1f622 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -286,6 +286,12 @@ static inline void get_page(struct page *page)
286 atomic_inc(&page->_count); 286 atomic_inc(&page->_count);
287} 287}
288 288
289static inline struct page *virt_to_head_page(const void *x)
290{
291 struct page *page = virt_to_page(x);
292 return compound_head(page);
293}
294
289/* 295/*
290 * Setup the page count before being freed into the page allocator for 296 * Setup the page count before being freed into the page allocator for
291 * the first time (boot or memory hotplug) 297 * the first time (boot or memory hotplug)