mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
mm: use vm_unmapped_area() on alpha architecture
Update the alpha arch_get_unmapped_area function to make use of vm_unmapped_area() instead of implementing a brute force search. Signed-off-by: Michel Lespinasse <[email protected]> Acked-by: Rik van Riel <[email protected]> Cc: Richard Henderson <[email protected]> Cc: Ivan Kokshaysky <[email protected]> Cc: Matt Turner <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
182dcfd648
commit
6d1c7ccae9
1 changed files with 9 additions and 11 deletions
|
|
@ -1300,17 +1300,15 @@ static unsigned long
|
|||
arch_get_unmapped_area_1(unsigned long addr, unsigned long len,
|
||||
unsigned long limit)
|
||||
{
|
||||
struct vm_area_struct *vma = find_vma(current->mm, addr);
|
||||
struct vm_unmapped_area_info info;
|
||||
|
||||
while (1) {
|
||||
/* At this point: (!vma || addr < vma->vm_end). */
|
||||
if (limit - len < addr)
|
||||
return -ENOMEM;
|
||||
if (!vma || addr + len <= vma->vm_start)
|
||||
return addr;
|
||||
addr = vma->vm_end;
|
||||
vma = vma->vm_next;
|
||||
}
|
||||
info.flags = 0;
|
||||
info.length = len;
|
||||
info.low_limit = addr;
|
||||
info.high_limit = limit;
|
||||
info.align_mask = 0;
|
||||
info.align_offset = 0;
|
||||
return vm_unmapped_area(&info);
|
||||
}
|
||||
|
||||
unsigned long
|
||||
|
|
|
|||
Loading…
Reference in a new issue