mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-11-28 22:57:37 +00:00
41 lines
1.1 KiB
Diff
41 lines
1.1 KiB
Diff
|
From cdbe7ee5978704c788e91170467fe0db064650fe Mon Sep 17 00:00:00 2001
|
||
|
From: moonman <moonman.ca@gmail.com>
|
||
|
Date: Mon, 30 May 2016 03:23:17 -0600
|
||
|
Subject: [PATCH] fix build error on linux >= 4.6.0
|
||
|
|
||
|
---
|
||
|
zc.c | 12 ++++++++++--
|
||
|
1 file changed, 10 insertions(+), 2 deletions(-)
|
||
|
|
||
|
diff --git a/zc.c b/zc.c
|
||
|
index 29b0501..eabfab7 100644
|
||
|
--- a/zc.c
|
||
|
+++ b/zc.c
|
||
|
@@ -59,8 +59,12 @@ int __get_userbuf(uint8_t __user *addr, uint32_t len, int write,
|
||
|
}
|
||
|
|
||
|
down_read(&mm->mmap_sem);
|
||
|
- ret = get_user_pages(task, mm,
|
||
|
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
|
||
|
+ ret = get_user_pages((unsigned long)addr, pgcount, write, 0, pg, NULL);
|
||
|
+#else
|
||
|
+ ret = get_user_pages(task, mm,
|
||
|
(unsigned long)addr, pgcount, write, 0, pg, NULL);
|
||
|
+#endif
|
||
|
up_read(&mm->mmap_sem);
|
||
|
if (ret != pgcount)
|
||
|
return -EINVAL;
|
||
|
@@ -119,7 +123,11 @@ void release_user_pages(struct csession *ses)
|
||
|
else
|
||
|
ses->readonly_pages--;
|
||
|
|
||
|
- page_cache_release(ses->pages[i]);
|
||
|
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0))
|
||
|
+ put_page(ses->pages[i]);
|
||
|
+#else
|
||
|
+ page_cache_release(ses->pages[i]);
|
||
|
+#endif
|
||
|
}
|
||
|
ses->used_pages = 0;
|
||
|
}
|