From: Liam R. Howlett Date: Mon, 4 Jan 2021 19:46:23 +0000 (-0500) Subject: fs/proc/base: Use maple tree iterators in place of linked list X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=453a24fef5e1bb02260752bb541c59e8292413df;p=users%2Fjedix%2Flinux-maple.git fs/proc/base: Use maple tree iterators in place of linked list Signed-off-by: Liam R. Howlett --- diff --git a/fs/proc/base.c b/fs/proc/base.c index d654ce7150fd..a62851782aa5 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -2323,6 +2323,7 @@ proc_map_files_readdir(struct file *file, struct dir_context *ctx) GENRADIX(struct map_files_info) fa; struct map_files_info *p; int ret; + MA_STATE(mas, NULL, 0, 0); genradix_init(&fa); @@ -2350,6 +2351,7 @@ proc_map_files_readdir(struct file *file, struct dir_context *ctx) } nr_files = 0; + mas.tree = &mm->mm_mt; /* * We need two passes here: @@ -2361,7 +2363,8 @@ proc_map_files_readdir(struct file *file, struct dir_context *ctx) * routine might require mmap_lock taken in might_fault(). */ - for (vma = mm->mmap, pos = 2; vma; vma = vma->vm_next) { + pos = 2; + mas_for_each(&mas, vma, ULONG_MAX) { if (!vma->vm_file) continue; if (++pos <= ctx->pos)