From fcb8996728fb59eddf84678df7cb213b2c9a2e26 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Tue, 31 Jul 2012 16:45:02 -0700 Subject: 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 Cc: Rik van Riel Cc: Andrew Morton Signed-off-by: Ben Hutchings --- include/linux/highmem.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/linux') diff --git a/include/linux/highmem.h b/include/linux/highmem.h index 3a93f73a8acc..52e96204b3e7 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 -- cgit v1.2.3