summaryrefslogtreecommitdiffstats
path: root/include/linux/mm.h
diff options
context:
space:
mode:
authorChristoph Lameter2008-02-05 07:28:34 +0100
committerLinus Torvalds2008-02-05 18:44:14 +0100
commit9e2779fa281cfda13ac060753d674bbcaa23367e (patch)
treee2af17d69b71e0f8b3f00fe949cb8abfba4298ed /include/linux/mm.h
parenti386: Resolve dependency of asm-i386/pgtable.h on highmem.h (diff)
downloadkernel-qcow2-linux-9e2779fa281cfda13ac060753d674bbcaa23367e.tar.gz
kernel-qcow2-linux-9e2779fa281cfda13ac060753d674bbcaa23367e.tar.xz
kernel-qcow2-linux-9e2779fa281cfda13ac060753d674bbcaa23367e.zip
is_vmalloc_addr(): Check if an address is within the vmalloc boundaries
Checking if an address is a vmalloc address is done in a couple of places. Define a common version in mm.h and replace the other checks. Again the include structures suck. The definition of VMALLOC_START and VMALLOC_END is not available in vmalloc.h since highmem.c cannot be included there. Signed-off-by: Christoph Lameter <clameter@sgi.com> Cc: Nick Piggin <nickpiggin@yahoo.com.au> 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.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index a862a96952e0..f28a0338574f 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -235,6 +235,14 @@ static inline int get_page_unless_zero(struct page *page)
struct page *vmalloc_to_page(const void *addr);
unsigned long vmalloc_to_pfn(const void *addr);
+/* Determine if an address is within the vmalloc range */
+static inline int is_vmalloc_addr(const void *x)
+{
+ unsigned long addr = (unsigned long)x;
+
+ return addr >= VMALLOC_START && addr < VMALLOC_END;
+}
+
static inline struct page *compound_head(struct page *page)
{
if (unlikely(PageTail(page)))