2
0

0001-zero-copy-fix-build-for-linux-6.4.patch 1.1 KB

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