diff options
author | Christoph Lameter <clameter@sgi.com> | 2008-02-05 06:28:34 (GMT) |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-05 17:44:14 (GMT) |
commit | 9e2779fa281cfda13ac060753d674bbcaa23367e (patch) | |
tree | e2af17d69b71e0f8b3f00fe949cb8abfba4298ed /include/linux/mm.h | |
parent | 0b7a96114bd5991d355a1f1c1d3d9c0c9d9c1cfc (diff) | |
download | linux-fsl-qoriq-9e2779fa281cfda13ac060753d674bbcaa23367e.tar.xz |
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.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index a862a96..f28a033 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))) |