From: Benjamin Herrenschmidt Date: Sun, 6 May 2007 21:50:10 +0000 (-0700) Subject: get_unmapped_area handles MAP_FIXED on sparc64 X-Git-Tag: v2.6.22-rc1~931 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=ac35ee484df361e1aed89873a458900693effdbe;p=linux-2.6-omap-h63xx.git get_unmapped_area handles MAP_FIXED on sparc64 Handle MAP_FIXED in hugetlb_get_unmapped_area on sparc64 by just using prepare_hugepage_range() Signed-off-by: Benjamin Herrenschmidt Acked-by: William Irwin Cc: "David S. Miller" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/sparc64/mm/hugetlbpage.c b/arch/sparc64/mm/hugetlbpage.c index 00677b5e1d7..e224a94e6a1 100644 --- a/arch/sparc64/mm/hugetlbpage.c +++ b/arch/sparc64/mm/hugetlbpage.c @@ -175,6 +175,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);