From: Benjamin Herrenschmidt Date: Sun, 6 May 2007 21:50:08 +0000 (-0700) Subject: get_unmapped_area handles MAP_FIXED on i386 X-Git-Tag: v2.6.22-rc1~934 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=5a8130f2b186ac91190d1dcea875d66d08e6a1de;p=linux-2.6-omap-h63xx.git 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 --- diff --git a/arch/i386/mm/hugetlbpage.c b/arch/i386/mm/hugetlbpage.c index 34728e4afe4..6272a4fd9e7 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);