1
From b32ce9509d4039e56f527e2874550eb2cf1a5648 Mon Sep 17 00:00:00 2001
2
From: Alberto Milone <alberto.milone@canonical.com>
3
Date: Thu, 9 Jan 2014 11:50:51 +0100
4
Subject: [PATCH 1/1] uvm: add support for Linux 3.12 (v2)
6
If CONFIG_UIDGID_STRICT_TYPE_CHECKS is enabled, kuid_t is a struct
7
with the uid_t val member, otherwise it's simply an alias for uid_t.
9
Despite the commit subject, this is not specific to Linux 3.12.
11
Thanks to Joseph Yasi for finding out the issue and suggesting a fix.
13
nvidia_uvm_linux.h | 10 ++++++++--
14
1 file changed, 8 insertions(+), 2 deletions(-)
16
diff --git a/nvidia_uvm_linux.h b/nvidia_uvm_linux.h
17
index e2b4620..0a38cbc 100644
18
--- a/nvidia_uvm_linux.h
19
+++ b/nvidia_uvm_linux.h
20
@@ -389,11 +389,17 @@ typedef void irqreturn_t;
21
// not require the RCU's read lock on current->cred.
24
+#ifdef CONFIG_UIDGID_STRICT_TYPE_CHECKS
25
+#define NV_KUID_TO_UID(value) (__kuid_val(value))
27
+#define NV_KUID_TO_UID(value) (value)
30
#if defined(NV_TASK_STRUCT_HAS_CRED)
31
#define NV_CURRENT_EUID() \
32
- (((typeof(*current->cred) __force __kernel *)current->cred)->euid)
33
+ NV_KUID_TO_UID(((typeof(*current->cred) __force __kernel *)current->cred)->euid)
35
-#define NV_CURRENT_EUID() (current->euid)
36
+#define NV_CURRENT_EUID() NV_KUID_TO_UID(current->euid)
39
#if !defined(VM_FAULT_NOPAGE)