]> git.baikalelectronics.ru Git - kernel.git/commit
mm/mmap: not necessary to check mapping separately
authorWei Yang <richard.weiyang@linux.alibaba.com>
Tue, 13 Oct 2020 23:54:04 +0000 (16:54 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 14 Oct 2020 01:38:31 +0000 (18:38 -0700)
commit549d3ca3d4949a8aed8b9fbaeedca751fdfff452
tree9747f34858417c3cdbeb1188020e3820f55f63e0
parent1163438837e9d4b2b33471354fa4f089e6dd78e2
mm/mmap: not necessary to check mapping separately

*root* with type of struct rb_root_cached is an element of *mapping*
with type of struct address_space. This implies when we have a valid
*root* it must be a part of valid *mapping*.

So we can merge these two checks together to make the code more easy to
read and to save some cpu cycles.

Signed-off-by: Wei Yang <richard.weiyang@linux.alibaba.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Link: https://lkml.kernel.org/r/20200913133631.37781-1-richard.weiyang@linux.alibaba.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/mmap.c