]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/mmap/vma_merge: set mid to NULL if not applicable
authorVlastimil Babka <vbabka@suse.cz>
Thu, 9 Mar 2023 11:12:54 +0000 (12:12 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Wed, 5 Apr 2023 23:02:26 +0000 (16:02 -0700)
commitdd0b7b5db54e16cb39fd7dece498468088d0342d
tree1c130d522ba5d9f34cc8ea246d514dbe1f589283
parent008bafffb75df127186d8cb80a067010124c7678
mm/mmap/vma_merge: set mid to NULL if not applicable

There are several places where we test if 'mid' is really the area NNNN in
the diagram and the tests have two variants and are non-obvious to follow.
Instead, set 'mid' to NULL up-front if it's not the NNNN area, and
simplify the tests.

Also update the description in comment accordingly.

Link: https://lkml.kernel.org/r/20230309111258.24079-7-vbabka@suse.cz
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: Lorenzo Stoakes <lstoakes@gmail.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/mmap.c