diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-25 18:47:03 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-25 18:47:03 -0500 |
commit | d414c104e26fd3b597f855cc29473a8b1527fb4c (patch) | |
tree | 021af0f439f2612f84a97ee14e20a9595def90d7 /arch/ia64/mm | |
parent | f6d43b93bd07cf3e430f426ee8f1330cb8d5d8c9 (diff) | |
parent | e31048af84e24c99136acaad99f9273b147f8444 (diff) |
Merge tag 'please-pull-vm_unwrapped' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux
Pull ia64 update from Tony Luck:
"ia64 vm patch series that was cooking in -mm tree"
* tag 'please-pull-vm_unwrapped' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux:
mm: use vm_unmapped_area() in hugetlbfs on ia64 architecture
mm: use vm_unmapped_area() on ia64 architecture
Diffstat (limited to 'arch/ia64/mm')
-rw-r--r-- | arch/ia64/mm/hugetlbpage.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c index 5ca674b74737..76069c18ee42 100644 --- a/arch/ia64/mm/hugetlbpage.c +++ b/arch/ia64/mm/hugetlbpage.c | |||
@@ -148,7 +148,7 @@ void hugetlb_free_pgd_range(struct mmu_gather *tlb, | |||
148 | unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len, | 148 | unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len, |
149 | unsigned long pgoff, unsigned long flags) | 149 | unsigned long pgoff, unsigned long flags) |
150 | { | 150 | { |
151 | struct vm_area_struct *vmm; | 151 | struct vm_unmapped_area_info info; |
152 | 152 | ||
153 | if (len > RGN_MAP_LIMIT) | 153 | if (len > RGN_MAP_LIMIT) |
154 | return -ENOMEM; | 154 | return -ENOMEM; |
@@ -165,16 +165,14 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, u | |||
165 | /* This code assumes that RGN_HPAGE != 0. */ | 165 | /* This code assumes that RGN_HPAGE != 0. */ |
166 | if ((REGION_NUMBER(addr) != RGN_HPAGE) || (addr & (HPAGE_SIZE - 1))) | 166 | if ((REGION_NUMBER(addr) != RGN_HPAGE) || (addr & (HPAGE_SIZE - 1))) |
167 | addr = HPAGE_REGION_BASE; | 167 | addr = HPAGE_REGION_BASE; |
168 | else | 168 | |
169 | addr = ALIGN(addr, HPAGE_SIZE); | 169 | info.flags = 0; |
170 | for (vmm = find_vma(current->mm, addr); ; vmm = vmm->vm_next) { | 170 | info.length = len; |
171 | /* At this point: (!vmm || addr < vmm->vm_end). */ | 171 | info.low_limit = addr; |
172 | if (REGION_OFFSET(addr) + len > RGN_MAP_LIMIT) | 172 | info.high_limit = HPAGE_REGION_BASE + RGN_MAP_LIMIT; |
173 | return -ENOMEM; | 173 | info.align_mask = PAGE_MASK & (HPAGE_SIZE - 1); |
174 | if (!vmm || (addr + len) <= vmm->vm_start) | 174 | info.align_offset = 0; |
175 | return addr; | 175 | return vm_unmapped_area(&info); |
176 | addr = ALIGN(vmm->vm_end, HPAGE_SIZE); | ||
177 | } | ||
178 | } | 176 | } |
179 | 177 | ||
180 | static int __init hugetlb_setup_sz(char *str) | 178 | static int __init hugetlb_setup_sz(char *str) |