Commit 669afa4e authored by Tiwei Bie's avatar Tiwei Bie Committed by Richard Weinberger

um: Remove the redundant newpage check in update_pte_range

The two checks have been identical since commit ef714f15 ("um:
remove force_flush_all from fork_handler"). And the inner one isn't
necessary anymore.
Signed-off-by: default avatarTiwei Bie <tiwei.btw@antgroup.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent 2fcd16fb
...@@ -82,16 +82,12 @@ static inline int update_pte_range(pmd_t *pmd, unsigned long addr, ...@@ -82,16 +82,12 @@ static inline int update_pte_range(pmd_t *pmd, unsigned long addr,
(x ? UM_PROT_EXEC : 0)); (x ? UM_PROT_EXEC : 0));
if (pte_newpage(*pte)) { if (pte_newpage(*pte)) {
if (pte_present(*pte)) { if (pte_present(*pte)) {
if (pte_newpage(*pte)) { __u64 offset;
__u64 offset; unsigned long phys = pte_val(*pte) & PAGE_MASK;
unsigned long phys = int fd = phys_mapping(phys, &offset);
pte_val(*pte) & PAGE_MASK;
int fd = phys_mapping(phys, &offset); ret = ops->mmap(ops->mm_idp, addr, PAGE_SIZE,
prot, fd, offset);
ret = ops->mmap(ops->mm_idp, addr,
PAGE_SIZE, prot, fd,
offset);
}
} else } else
ret = ops->unmap(ops->mm_idp, addr, PAGE_SIZE); ret = ops->unmap(ops->mm_idp, addr, PAGE_SIZE);
} else if (pte_newprot(*pte)) } else if (pte_newprot(*pte))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment