1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
diff -Naur a/kernel/conftest.sh b/kernel/conftest.sh
--- a/kernel/conftest.sh 2022-04-02 10:27:54.463179319 +0000
+++ b/kernel/conftest.sh 2022-04-02 10:27:54.553179467 +0000
@@ -1619,7 +1619,11 @@
CODE="
#include <linux/proc_fs.h>
void conftest_PDE_DATA(void) {
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0)
+ pde_data();
+ #else
PDE_DATA();
+ #endif
}"
compile_check_conftest "$CODE" "NV_PDE_DATA_PRESENT" "" "functions"
diff -Naur a/kernel/nv-linux.h b/kernel/nv-linux.h
--- a/kernel/nv-linux.h 2022-04-02 10:27:54.463179319 +0000
+++ b/kernel/nv-linux.h 2022-04-02 10:27:54.556512806 +0000
@@ -266,9 +266,9 @@
#endif
#ifdef CONFIG_PROC_FS
-#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#endif
+#include <linux/proc_fs.h>
#ifdef CONFIG_KDB
#include <linux/kdb.h>
@@ -2052,8 +2052,12 @@
})
#if defined(NV_PDE_DATA_PRESENT)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0)
# define NV_PDE_DATA(inode) PDE_DATA(inode)
#else
+# define NV_PDE_DATA(inode) pde_data(inode)
+#endif
+#else
# define NV_PDE_DATA(inode) PDE(inode)->data
#endif
diff -Naur a/kernel/uvm/conftest.sh b/kernel/uvm/conftest.sh
--- a/kernel/uvm/conftest.sh 2022-04-02 10:27:54.456512642 +0000
+++ b/kernel/uvm/conftest.sh 2022-04-02 10:27:54.556512806 +0000
@@ -1578,7 +1578,11 @@
CODE="
#include <linux/proc_fs.h>
void conftest_PDE_DATA(void) {
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0)
+ pde_data();
+ #else
PDE_DATA();
+ #endif
}"
compile_check_conftest "$CODE" "NV_PDE_DATA_PRESENT" "" "functions"
|