From: Liam R. Howlett Date: Mon, 4 Jan 2021 19:44:16 +0000 (-0500) Subject: fs/binfmt_elf: Use maple tree iterators for fill_files_note() X-Git-Tag: howlett/maple_spf/20210120~30 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=606a53abded8fa0655535c13c77d95d37b9d9c32;p=users%2Fjedix%2Flinux-maple.git fs/binfmt_elf: Use maple tree iterators for fill_files_note() Signed-off-by: Liam R. Howlett --- diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 950bc177238a..ab1d7f0b48ea 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -1609,6 +1609,7 @@ static int fill_files_note(struct memelfnote *note) user_long_t *data; user_long_t *start_end_ofs; char *name_base, *name_curpos; + MA_STATE(mas, &mm->mm_mt, 0, 0); /* *Estimated* file count and total data size needed */ count = mm->map_count; @@ -1633,7 +1634,7 @@ static int fill_files_note(struct memelfnote *note) name_base = name_curpos = ((char *)data) + names_ofs; remaining = size - names_ofs; count = 0; - for (vma = mm->mmap; vma != NULL; vma = vma->vm_next) { + mas_for_each(&mas, vma, ULONG_MAX) { struct file *file; const char *filename;