summaryrefslogtreecommitdiff
blob: 7c9e60d30b8645d0184a745a0328ce8326e8e4a7 (plain)
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
--- 1/usr/src/nv/nv-linux.h
+++ 1/usr/src/nv/nv-linux.h
@@ -668,10 +668,10 @@
                         0, 0, NULL, NULL);                      \
     }
 #elif (NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT == 5)
-#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type)            \
+#define NV_KMEM_CACHE_CREATE(kmem_cache, name, type, flags)     \
     {                                                           \
         kmem_cache = kmem_cache_create(name, sizeof(type),      \
-                        0, 0, NULL);                            \
+                        0, flags, NULL);                        \
     }
 #else
 #error "NV_KMEM_CACHE_CREATE_ARGUMENT_COUNT value unrecognized!"
--- 1/usr/src/nv/nv.c
+++ 1/usr/src/nv/nv.c
@@ -389,7 +389,11 @@
 
 /* character driver entry points */
 
+#ifndef __no_const
 static struct file_operations nv_fops = {
+#else
+static file_operations_no_const nv_fops = {
+#endif
     .owner     = THIS_MODULE,
     .poll      = nv_kern_poll,
 #if defined(NV_FILE_OPERATIONS_HAS_IOCTL)
@@ -1377,7 +1381,7 @@
     NV_SPIN_LOCK_INIT(&km_lock);
 #endif
 
-    NV_KMEM_CACHE_CREATE(nv_stack_t_cache, "nv_stack_t", nv_stack_t);
+    NV_KMEM_CACHE_CREATE(nv_stack_t_cache, "nv_stack_t", nv_stack_t, SLAB_USERCOPY);
     if (nv_stack_t_cache == NULL)
     {
         nv_printf(NV_DBG_ERRORS, "NVRM: stack cache allocation failed!\n");
@@ -1499,7 +1503,7 @@
     }
 #endif
 
-    NV_KMEM_CACHE_CREATE(nv_pte_t_cache, "nv_pte_t", nv_pte_t);
+    NV_KMEM_CACHE_CREATE(nv_pte_t_cache, "nv_pte_t", nv_pte_t, 0);
     if (nv_pte_t_cache == NULL)
     {
         rc = -ENOMEM;