From 5a8130f2b186ac91190d1dcea875d66d08e6a1de Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Sun, 6 May 2007 14:50:08 -0700 Subject: [PATCH] get_unmapped_area handles MAP_FIXED on i386 Handle MAP_FIXED in i386 hugetlb_get_unmapped_area(), just call prepare_hugepage_range. Signed-off-by: Benjamin Herrenschmidt Acked-by: William Irwin Cc: Andi Kleen Cc: Adam Litke Cc: David Gibson Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- arch/i386/mm/hugetlbpage.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/i386/mm/hugetlbpage.c b/arch/i386/mm/hugetlbpage.c index 34728e4afe48..6272a4fd9e7c 100644 --- a/arch/i386/mm/hugetlbpage.c +++ b/arch/i386/mm/hugetlbpage.c @@ -367,6 +367,12 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, if (len > TASK_SIZE) return -ENOMEM; + if (flags & MAP_FIXED) { + if (prepare_hugepage_range(addr, len, pgoff)) + return -EINVAL; + return addr; + } + if (addr) { addr = ALIGN(addr, HPAGE_SIZE); vma = find_vma(mm, addr);