]> 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>
Tue, 28 Mar 2023 23:25:05 +0000 (16:25 -0700)
commita7b7437d2841fc54277d21fa5d17f29010c83b4b
tree16dd66441d75ce02fe09ac8b6b33bfba064b0d60
parent7923c3cf59b38ff899b43e927f21a7a4886b9adc
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