Skip to content

Commit 4b1d892

Browse files
ozbenhLinus Torvalds
authored andcommitted
get_unmapped_area doesn't need hugetlbfs hacks anymore
Remove the hugetlbfs specific hacks in toplevel get_unmapped_area() now that all archs and hugetlbfs itself do the right thing for both cases. 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>
1 parent 06abdfb commit 4b1d892

1 file changed

Lines changed: 0 additions & 16 deletions

File tree

‎mm/mmap.c‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1382,22 +1382,6 @@ get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
13821382
if (addr & ~PAGE_MASK)
13831383
return -EINVAL;
13841384

1385-
if (file && is_file_hugepages(file)) {
1386-
/*
1387-
* Check if the given range is hugepage aligned, and
1388-
* can be made suitable for hugepages.
1389-
*/
1390-
ret = prepare_hugepage_range(addr, len, pgoff);
1391-
} else {
1392-
/*
1393-
* Ensure that a normal request is not falling in a
1394-
* reserved hugepage range. For some archs like IA-64,
1395-
* there is a separate region for hugepages.
1396-
*/
1397-
ret = is_hugepage_only_range(current->mm, addr, len);
1398-
}
1399-
if (ret)
1400-
return -EINVAL;
14011385
return addr;
14021386
}
14031387

0 commit comments

Comments
 (0)