mm: move the copy_one_pte() pte_present check into the caller
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 23 Sep 2020 17:04:16 +0000 (10:04 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 23 Sep 2020 17:04:16 +0000 (10:04 -0700)
commit79a1971c5f14ea3a6e2b0c4caf73a1760db7cab8
tree00732ad2a4f3d064385759e8a5c1191ef0d9917b
parentdf3a57d1f6072d07978bafa7dbd9904cdf8f3e13
mm: move the copy_one_pte() pte_present check into the caller

This completes the split of the non-present and present pte cases by
moving the check for the source pte being present into the single
caller, which also means that we clearly separate out the very different
return value case for a non-present pte.

The present pte case currently always succeeds.

This is a pure code re-organization with no semantic change: the intent
is to make it much easier to add a new return case to the present pte
case for when we do early COW at page table copy time.

This was split out from the previous commit simply to make it easy to
visually see that there were no semantic changes from this code
re-organization.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/memory.c