mcctrl syscall: compat for newer zap_vma_ptes

newer version of this function no longer return an error on the basis
that "no-one checks what it returns anyway"........

See linux 4.18's 27d036e33237e ("mm: Remove return value of zap_vma_ptes()")

Change-Id: I8fb9f060e3e145cc2db21738585c9ee7f1445f74
This commit is contained in:
Dominique Martinet
2018-10-25 11:14:26 +09:00
parent 3a90521489
commit 6581f9b4b2

View File

@ -2085,7 +2085,9 @@ int mcctrl_clear_pte_range(uintptr_t start, uintptr_t len)
struct vm_area_struct *vma;
uintptr_t addr;
uintptr_t end;
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 18, 0)
int error;
#endif
int ret;
ret = 0;
@ -2105,6 +2107,9 @@ int mcctrl_clear_pte_range(uintptr_t start, uintptr_t len)
end = vma->vm_end;
}
if (addr < end) {
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0)
zap_vma_ptes(vma, addr, end-addr);
#else
error = zap_vma_ptes(vma, addr, end-addr);
if (error) {
mcctrl_zap_page_range(vma, addr, end-addr, NULL);
@ -2113,6 +2118,7 @@ int mcctrl_clear_pte_range(uintptr_t start, uintptr_t len)
if (ret == 0) {
ret = error;
}
#endif
}
addr = end;
}