diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2011-11-17 02:15:31 -0500 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2012-04-07 19:55:51 -0400 |
commit | c4a4d603796c727b9555867571f89483be9c565e (patch) | |
tree | ae3b47a7b8b35c866df53cb4b4a051d49a28904a /kernel/user_namespace.c | |
parent | 7e6bd8fadd1216f50468f965d0308f45e5109ced (diff) |
userns: Use cred->user_ns instead of cred->user->user_ns
Optimize performance and prepare for the removal of the user_ns reference
from user_struct. Remove the slow long walk through cred->user->user_ns and
instead go straight to cred->user_ns.
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'kernel/user_namespace.c')
-rw-r--r-- | kernel/user_namespace.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c index 3b906e98b1db..f084083a0fd3 100644 --- a/kernel/user_namespace.c +++ b/kernel/user_namespace.c | |||
@@ -90,7 +90,7 @@ uid_t user_ns_map_uid(struct user_namespace *to, const struct cred *cred, uid_t | |||
90 | { | 90 | { |
91 | struct user_namespace *tmp; | 91 | struct user_namespace *tmp; |
92 | 92 | ||
93 | if (likely(to == cred->user->user_ns)) | 93 | if (likely(to == cred->user_ns)) |
94 | return uid; | 94 | return uid; |
95 | 95 | ||
96 | 96 | ||
@@ -112,7 +112,7 @@ gid_t user_ns_map_gid(struct user_namespace *to, const struct cred *cred, gid_t | |||
112 | { | 112 | { |
113 | struct user_namespace *tmp; | 113 | struct user_namespace *tmp; |
114 | 114 | ||
115 | if (likely(to == cred->user->user_ns)) | 115 | if (likely(to == cred->user_ns)) |
116 | return gid; | 116 | return gid; |
117 | 117 | ||
118 | /* Is cred->user the creator of the target user_ns | 118 | /* Is cred->user the creator of the target user_ns |