diff mbox series

[v2,51/70] kernel/sys: Use maple tree iterators instead of linked list

Message ID 20210112161240.2024684-52-Liam.Howlett@Oracle.com (mailing list archive)
State New, archived
Headers show
Series RFC mm: Introducing the Maple Tree | expand

Commit Message

Liam R. Howlett Jan. 12, 2021, 4:12 p.m. UTC
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
---
 kernel/sys.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/kernel/sys.c b/kernel/sys.c
index a730c03ee607c..fe061c54a5a46 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1858,9 +1858,10 @@  static int prctl_set_mm_exe_file(struct mm_struct *mm, unsigned int fd)
 	err = -EBUSY;
 	if (exe_file) {
 		struct vm_area_struct *vma;
+		MA_STATE(mas, &mm->mm_mt, 0, 0);
 
 		mmap_read_lock(mm);
-		for (vma = mm->mmap; vma; vma = vma->vm_next) {
+		mas_for_each(&mas, vma, ULONG_MAX) {
 			if (!vma->vm_file)
 				continue;
 			if (path_equal(&vma->vm_file->f_path,