diff mbox series

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

Message ID 20210112161240.2024684-48-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/acct.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/kernel/acct.c b/kernel/acct.c
index f175df8f6aa4a..bcfe2cf7c7c0f 100644
--- a/kernel/acct.c
+++ b/kernel/acct.c
@@ -537,16 +537,14 @@  void acct_collect(long exitcode, int group_dead)
 	struct pacct_struct *pacct = &current->signal->pacct;
 	u64 utime, stime;
 	unsigned long vsize = 0;
+	MA_STATE(mas, &current->mm->mm_mt, 0, 0);
 
 	if (group_dead && current->mm) {
 		struct vm_area_struct *vma;
 
 		mmap_read_lock(current->mm);
-		vma = current->mm->mmap;
-		while (vma) {
+		mas_for_each(&mas, vma, -1)
 			vsize += vma->vm_end - vma->vm_start;
-			vma = vma->vm_next;
-		}
 		mmap_read_unlock(current->mm);
 	}