1From 592017c3a910a3905b1925aee88c4674e9a596b7 Mon Sep 17 00:00:00 2001 2From: Gaurav Jain <gaurav.jain@nxp.com> 3Date: Tue, 30 May 2023 17:09:42 +0530 4Subject: [PATCH] zero copy: Fix build for Linux 6.4 5 6get_user_pages_remote api prototype is changed in kernel. 7struct vm_area_struct **vmas argument is removed. 8Migrate to the new API. 9 10Signed-off-by: Gaurav Jain <gaurav.jain@nxp.com> 11 12Upstream: https://github.com/cryptodev-linux/cryptodev-linux/commit/592017c3a910a3905b1925aee88c4674e9a596b7 13Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> 14--- 15 zc.c | 6 +++++- 16 1 file changed, 5 insertions(+), 1 deletion(-) 17 18diff --git a/zc.c b/zc.c 19index fdf7da17..6637945a 100644 20--- a/zc.c 21+++ b/zc.c 22@@ -80,10 +80,14 @@ int __get_userbuf(uint8_t __user *addr, uint32_t len, int write, 23 ret = get_user_pages_remote(task, mm, 24 (unsigned long)addr, pgcount, write ? FOLL_WRITE : 0, 25 pg, NULL, NULL); 26-#else 27+#elif (LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)) 28 ret = get_user_pages_remote(mm, 29 (unsigned long)addr, pgcount, write ? FOLL_WRITE : 0, 30 pg, NULL, NULL); 31+#else 32+ ret = get_user_pages_remote(mm, 33+ (unsigned long)addr, pgcount, write ? FOLL_WRITE : 0, 34+ pg, NULL); 35 #endif 36 #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 8, 0)) 37 up_read(&mm->mmap_sem); 38