lkml.org 
[lkml]   [2007]   [Sep]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[22/41] compound pages: Add new support functions
compound_pages(page)	-> Determines base pages of a compound page

compound_shift(page) -> Determine the page shift of a compound page

compound_size(page) -> Determine the size of a compound page

Signed-off-by: Christoph Lameter <clameter@sgi.com>
---
include/linux/mm.h | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/include/linux/mm.h b/include/linux/mm.h
index 1692dd6..6f3a8d6 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -363,6 +363,21 @@ static inline void set_compound_order(struct page *page, unsigned long order)
page[1].lru.prev = (void *)order;
}

+static inline int compound_pages(struct page *page)
+{
+ return 1 << compound_order(page);
+}
+
+static inline int compound_shift(struct page *page)
+{
+ return PAGE_SHIFT + compound_order(page);
+}
+
+static inline int compound_size(struct page *page)
+{
+ return PAGE_SIZE << compound_order(page);
+}
+
/*
* Multiple processes may "see" the same page. E.g. for untouched
* mappings of /dev/null, all processes see the same page full of
--
1.5.2.5
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-09-11 08:27    [W:0.255 / U:5.828 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site