aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2012-07-31 16:45:02 -0700
committerBen Hutchings <ben@decadent.org.uk>2013-01-03 03:32:57 +0000
commitfcb8996728fb59eddf84678df7cb213b2c9a2e26 (patch)
tree24e4c053d05194db2235cf872a5ef950e888c93b /include
parent26e5f795726ed11feff7125d727377a3eb231403 (diff)
mm: add kmap_to_page()
This is extracted from Mel Gorman's commit 5a178119b0fb ('mm: add support for direct_IO to highmem pages') upstream. Required to backport commit b9cdc88df8e6 ('virtio: 9p: correctly pass physical address to userspace for high pages'). Cc: Mel Gorman <mgorman@suse.de> Cc: Rik van Riel <riel@redhat.com> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'include')
-rw-r--r--include/linux/highmem.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 3a93f73a8ac..52e96204b3e 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -38,10 +38,17 @@ extern unsigned long totalhigh_pages;
void kmap_flush_unused(void);
+struct page *kmap_to_page(void *addr);
+
#else /* CONFIG_HIGHMEM */
static inline unsigned int nr_free_highpages(void) { return 0; }
+static inline struct page *kmap_to_page(void *addr)
+{
+ return virt_to_page(addr);
+}
+
#define totalhigh_pages 0UL
#ifndef ARCH_HAS_KMAP