]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/mmap: Combine multiple if statements in vma_merge() maple_v13_extras
authorLiam R. Howlett <Liam.Howlett@oracle.com>
Wed, 24 Aug 2022 19:37:56 +0000 (15:37 -0400)
committerLiam R. Howlett <Liam.Howlett@oracle.com>
Wed, 24 Aug 2022 19:42:41 +0000 (15:42 -0400)
commit3158d261908cd2ab406dddb4a53ebea0931a6809
treee123a03629a6b8d8d3abcdbcbbac2dcd20faf99b
parentfc53e340546613eedaf132d249fece95da430381
mm/mmap: Combine multiple if statements in vma_merge()

Currently vma_merge() searches from 0 upwards if there is no prev vma,
or from prev->vm_end if there is a prev vma.  The check for merging with
prev also checks if prev exists.  The ordering is not important at this
stage, so move the merging check above finding the next vma so that prev
can be checked only once.

Also start searching from vma_start as apposed to 0.  If there is no
previous then there won't be a vma before vma_start.  The code reads
more clearly this way.

Signed-off-by: Liam R. Howlett <Liam.Howlett@oracle.com>
mm/mmap.c