]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/mmap: Combine multiple if statements in vma_merge() maple_v6.0-rc1_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>
Fri, 26 Aug 2022 17:57:56 +0000 (13:57 -0400)
commit32e7bd70d9092c9117a06305e9eba9a6a0c6caef
treec2081253ac611a3b4ea441d1780de68ed3df90ce
parent7dbb9266c71aeee8e681faed71d4d9cfc55282db
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