提交 6d1c7cca 编写于 作者: M Michel Lespinasse 提交者: Linus Torvalds

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: NMichel Lespinasse <walken@google.com>
Acked-by: NRik van Riel <riel@redhat.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Matt Turner <mattst88@gmail.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 182dcfd6
...@@ -1300,17 +1300,15 @@ static unsigned long ...@@ -1300,17 +1300,15 @@ static unsigned long
arch_get_unmapped_area_1(unsigned long addr, unsigned long len, arch_get_unmapped_area_1(unsigned long addr, unsigned long len,
unsigned long limit) unsigned long limit)
{ {
struct vm_area_struct *vma = find_vma(current->mm, addr); struct vm_unmapped_area_info info;
while (1) { info.flags = 0;
/* At this point: (!vma || addr < vma->vm_end). */ info.length = len;
if (limit - len < addr) info.low_limit = addr;
return -ENOMEM; info.high_limit = limit;
if (!vma || addr + len <= vma->vm_start) info.align_mask = 0;
return addr; info.align_offset = 0;
addr = vma->vm_end; return vm_unmapped_area(&info);
vma = vma->vm_next;
}
} }
unsigned long unsigned long
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册