From: Benjamin Herrenschmidt Date: Sun, 6 May 2007 21:50:08 +0000 (-0700) Subject: get_unmapped_area handles MAP_FIXED on i386 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=5a8130f2b186ac91190d1dcea875d66d08e6a1de;p=openwrt%2Fstaging%2Fblogic.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 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);