aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mm.h
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2008-02-05 01:28:34 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-05 12:44:14 -0500
commit9e2779fa281cfda13ac060753d674bbcaa23367e (patch)
treee2af17d69b71e0f8b3f00fe949cb8abfba4298ed /include/linux/mm.h
parent0b7a96114bd5991d355a1f1c1d3d9c0c9d9c1cfc (diff)
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)
235struct page *vmalloc_to_page(const void *addr); 235struct page *vmalloc_to_page(const void *addr);
236unsigned long vmalloc_to_pfn(const void *addr); 236unsigned long vmalloc_to_pfn(const void *addr);
237 237
238/* Determine if an address is within the vmalloc range */
239static inline int is_vmalloc_addr(const void *x)
240{
241 unsigned long addr = (unsigned long)x;
242
243 return addr >= VMALLOC_START && addr < VMALLOC_END;
244}
245
238static inline struct page *compound_head(struct page *page) 246static inline struct page *compound_head(struct page *page)
239{ 247{
240 if (unlikely(PageTail(page))) 248 if (unlikely(PageTail(page)))