lkml.org 
[lkml]   [2021]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v4 41/66] fs/proc/base: Use maple tree iterators in place of linked list
    Date
    From: "Liam R. Howlett" <Liam.Howlett@Oracle.com>

    Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
    ---
    fs/proc/base.c | 5 ++++-
    1 file changed, 4 insertions(+), 1 deletion(-)

    diff --git a/fs/proc/base.c b/fs/proc/base.c
    index 13eda8de2998..ea17ee988158 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)
    --
    2.30.2
    \
     
     \ /
      Last update: 2021-12-01 15:36    [W:4.228 / U:0.092 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site