summaryrefslogtreecommitdiff
path: root/include/linux/pagemap.h
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2014-07-28 10:03:00 +0200
committerIngo Molnar <mingo@kernel.org>2014-07-28 10:03:00 +0200
commitca5bc6cd5de5b53eb8fd6fea39aa3fe2a1e8c3d9 (patch)
tree75beaae2d4b6bc654eb28994dd5906d8dcf5ef46 /include/linux/pagemap.h
parentc1221321b7c25b53204447cff9949a6d5a7ddddc (diff)
parentd8d28c8f00e84a72e8bee39a85835635417bee49 (diff)
Merge branch 'sched/urgent' into sched/core, to merge fixes before applying new changes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/linux/pagemap.h')
-rw-r--r--include/linux/pagemap.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 0a97b583ee8d..e1474ae18c88 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -399,6 +399,18 @@ static inline struct page *read_mapping_page(struct address_space *mapping,
}
/*
+ * Get the offset in PAGE_SIZE.
+ * (TODO: hugepage should have ->index in PAGE_SIZE)
+ */
+static inline pgoff_t page_to_pgoff(struct page *page)
+{
+ if (unlikely(PageHeadHuge(page)))
+ return page->index << compound_order(page);
+ else
+ return page->index << (PAGE_CACHE_SHIFT - PAGE_SHIFT);
+}
+
+/*
* Return byte-offset into filesystem object for page.
*/
static inline loff_t page_offset(struct page *page)