summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-08-08 16:30:44 +0400
committerTakashi Iwai <tiwai@suse.de>2011-08-08 16:30:44 +0400
commit60b1ae0cd469825e4db0837f5f19c3a8084300c3 (patch)
tree563aafa40012d1bb8218987ffeb76c88743e18e5 /include/linux
parent0a2d31b62dba9b5b92a38c67c9cc42630513662a (diff)
parent8c285645ab3b05942124020b5f0b89d3b539823a (diff)
downloadlinux-60b1ae0cd469825e4db0837f5f19c3a8084300c3.tar.xz
Merge branch 'fix/asoc' into for-linus
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/cred.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/include/linux/cred.h b/include/linux/cred.h
index 48e82af1159b..98f46efbe2d2 100644
--- a/include/linux/cred.h
+++ b/include/linux/cred.h
@@ -265,10 +265,11 @@ static inline void put_cred(const struct cred *_cred)
/**
* current_cred - Access the current task's subjective credentials
*
- * Access the subjective credentials of the current task.
+ * Access the subjective credentials of the current task. RCU-safe,
+ * since nobody else can modify it.
*/
#define current_cred() \
- (current->cred)
+ (*(__force struct cred **)&current->cred)
/**
* __task_cred - Access a task's objective credentials
@@ -307,7 +308,7 @@ static inline void put_cred(const struct cred *_cred)
({ \
struct user_struct *__u; \
struct cred *__cred; \
- __cred = (struct cred *) current_cred(); \
+ __cred = current_cred(); \
__u = get_uid(__cred->user); \
__u; \
})
@@ -322,7 +323,7 @@ static inline void put_cred(const struct cred *_cred)
({ \
struct group_info *__groups; \
struct cred *__cred; \
- __cred = (struct cred *) current_cred(); \
+ __cred = current_cred(); \
__groups = get_group_info(__cred->group_info); \
__groups; \
})
@@ -341,7 +342,7 @@ static inline void put_cred(const struct cred *_cred)
#define current_cred_xxx(xxx) \
({ \
- current->cred->xxx; \
+ current_cred()->xxx; \
})
#define current_uid() (current_cred_xxx(uid))