Skip to content

Commit 6d1c7cc

Browse files
walken-googletorvalds
authored andcommitted
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]>
1 parent 182dcfd commit 6d1c7cc

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

arch/alpha/kernel/osf_sys.c

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,17 +1300,15 @@ static unsigned long
13001300
arch_get_unmapped_area_1(unsigned long addr, unsigned long len,
13011301
unsigned long limit)
13021302
{
1303-
struct vm_area_struct *vma = find_vma(current->mm, addr);
1304-
1305-
while (1) {
1306-
/* At this point: (!vma || addr < vma->vm_end). */
1307-
if (limit - len < addr)
1308-
return -ENOMEM;
1309-
if (!vma || addr + len <= vma->vm_start)
1310-
return addr;
1311-
addr = vma->vm_end;
1312-
vma = vma->vm_next;
1313-
}
1303+
struct vm_unmapped_area_info info;
1304+
1305+
info.flags = 0;
1306+
info.length = len;
1307+
info.low_limit = addr;
1308+
info.high_limit = limit;
1309+
info.align_mask = 0;
1310+
info.align_offset = 0;
1311+
return vm_unmapped_area(&info);
13141312
}
13151313

13161314
unsigned long

0 commit comments

Comments
 (0)