From e01745f66fd2b4b0035ce7e064f340faeb997675 Mon Sep 17 00:00:00 2001 From: Johanna A Date: Sat, 29 Oct 2016 10:01:01 +0200 Subject: [PATCH] Builds against 4.9 The function signature for get_user_pages() has changed in linux 4.9. --- kernel-modules/u2mfn/u2mfn.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kernel-modules/u2mfn/u2mfn.c b/kernel-modules/u2mfn/u2mfn.c index bbe1e60..b30d0d9 100644 --- a/kernel-modules/u2mfn/u2mfn.c +++ b/kernel-modules/u2mfn/u2mfn.c @@ -75,7 +75,10 @@ static long u2mfn_ioctl(struct file *f, unsigned int cmd, switch (cmd) { case U2MFN_GET_MFN_FOR_PAGE: down_read(¤t->mm->mmap_sem); -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0) + ret = get_user_pages + (data, 1, (FOLL_WRITE | FOLL_FORCE), &user_page, 0); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0) ret = get_user_pages (data, 1, 1, 0, &user_page, 0); #else