mcctrl: use vmf_insert_pfn for kernel >= 4.18
vmf_insert_pfn got added as a wrapper around vm_insert_pfn in 4.17
1c8f422059ae5da ("mm: change return type to vm_fault_t") and totally
replaced the later in 4.20 ae2b01f37044c ("mm: remove vm_insert_pfn()")
Compare with 4.18 here specifically to avoid troubles when rhel
backports this change later, and avoid adding a rhel version check down
the road.
Change-Id: Ibf108e2fb6f1199f89cde6a7973f4eb55447260b
This commit is contained in:
@ -859,7 +859,13 @@ static int rus_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
|
||||
}
|
||||
}
|
||||
else
|
||||
error = vm_insert_pfn(vma, rva+(pix*PAGE_SIZE), pfn+pix);
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0)
|
||||
error = vmf_insert_pfn(vma, rva+(pix*PAGE_SIZE),
|
||||
pfn+pix);
|
||||
#else
|
||||
error = vm_insert_pfn(vma, rva+(pix*PAGE_SIZE),
|
||||
pfn+pix);
|
||||
#endif
|
||||
if (error) {
|
||||
#if 1 /* POSTK_DEBUG_TEMP_FIX_11 */ /* rus_vm_fault() multi-thread fix */
|
||||
printk("%s: vm_insert_pfn returned %d\n", __FUNCTION__, error);
|
||||
|
||||
Reference in New Issue
Block a user