From 5a83961a88c5d9bc1d1888a748e90f853ce85843 Mon Sep 17 00:00:00 2001 From: "M. Vefa Bicakci" Date: Sat, 17 Aug 2019 03:45:22 -0400 Subject: [PATCH] u2mfn: Make compatible with kernel versions >= 5.3.y --- kernel-modules/u2mfn/u2mfn.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kernel-modules/u2mfn/u2mfn.c b/kernel-modules/u2mfn/u2mfn.c index 1209dc5..bf69761 100644 --- a/kernel-modules/u2mfn/u2mfn.c +++ b/kernel-modules/u2mfn/u2mfn.c @@ -54,10 +54,17 @@ static inline unsigned long VIRT_TO_MFN(void *addr) } #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,3,0) +static int u2mfn_get_mfn(pte_t *pte, unsigned long addr, void *data) { + *((unsigned long *) data) = pfn_to_mfn(pte_pfn(*pte)); + return 0; +} +#else static int u2mfn_get_mfn(pte_t *pte, pgtable_t token, unsigned long addr, void *data) { *((unsigned long *) data) = pfn_to_mfn(pte_pfn(*pte)); return 0; } +#endif /// User virtual address to mfn translator /**