]> err.no Git - linux-2.6/commitdiff
get_unmapped_area handles MAP_FIXED on sparc64
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Sun, 6 May 2007 21:50:10 +0000 (14:50 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 7 May 2007 19:12:56 +0000 (12:12 -0700)
Handle MAP_FIXED in hugetlb_get_unmapped_area on sparc64 by just using
prepare_hugepage_range()

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: William Irwin <bill.irwin@oracle.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/sparc64/mm/hugetlbpage.c

index 00677b5e1d7d0c15f0e82eec83e18ac07d900400..e224a94e6a1b609916f4ad3aa589f7a934f4fff1 100644 (file)
@@ -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);