diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2007-05-06 17:50:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-07 15:12:57 -0400 |
commit | 036e08568cbee4b16e14551e9f004c3d490d6271 (patch) | |
tree | d5dff4ed1a4ed417f36291f9e79eca8ba703c8b3 /fs/hugetlbfs | |
parent | 11300a64d08ebce03e30cac8eb58e8ce008e4bb7 (diff) |
get_unmapped_area handles MAP_FIXED in hugetlbfs
Generic hugetlb_get_unmapped_area() now handles MAP_FIXED by just calling
prepare_hugepage_range()
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: William Irwin <bill.irwin@oracle.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: David Howells <dhowells@redhat.com>
Cc: Andi Kleen <ak@suse.de>
Cc: "Luck, Tony" <tony.luck@intel.com>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Grant Grundler <grundler@parisc-linux.org>
Cc: Matthew Wilcox <willy@debian.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Adam Litke <agl@us.ibm.com>
Cc: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/hugetlbfs')
-rw-r--r-- | fs/hugetlbfs/inode.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 8e1b7825e2f3..fe625cd1719a 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/backing-dev.h> | 22 | #include <linux/backing-dev.h> |
23 | #include <linux/hugetlb.h> | 23 | #include <linux/hugetlb.h> |
24 | #include <linux/pagevec.h> | 24 | #include <linux/pagevec.h> |
25 | #include <linux/mman.h> | ||
25 | #include <linux/quotaops.h> | 26 | #include <linux/quotaops.h> |
26 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
27 | #include <linux/dnotify.h> | 28 | #include <linux/dnotify.h> |
@@ -112,6 +113,12 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, | |||
112 | if (len > TASK_SIZE) | 113 | if (len > TASK_SIZE) |
113 | return -ENOMEM; | 114 | return -ENOMEM; |
114 | 115 | ||
116 | if (flags & MAP_FIXED) { | ||
117 | if (prepare_hugepage_range(addr, len, pgoff)) | ||
118 | return -EINVAL; | ||
119 | return addr; | ||
120 | } | ||
121 | |||
115 | if (addr) { | 122 | if (addr) { |
116 | addr = ALIGN(addr, HPAGE_SIZE); | 123 | addr = ALIGN(addr, HPAGE_SIZE); |
117 | vma = find_vma(mm, addr); | 124 | vma = find_vma(mm, addr); |