summaryrefslogtreecommitdiff
path: root/kernel/user.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2011-11-17 11:20:58 +0400
committerEric W. Biederman <ebiederm@xmission.com>2012-04-08 03:55:54 +0400
commitd0bd6594e286bd6145e04e19e8d3fa2e902cb800 (patch)
treeec512935f5cf2b4ae95927a47e96ad716159fb04 /kernel/user.c
parent6f9ac6d93a0916de09d11b0a247ade8f4347728b (diff)
downloadlinux-d0bd6594e286bd6145e04e19e8d3fa2e902cb800.tar.xz
userns: Deprecate and rename the user_namespace reference in the user_struct
With a user_ns reference in struct cred the only user of the user namespace reference in struct user_struct is to keep the uid hash table alive. The user_namespace reference in struct user_struct will be going away soon, and I have removed all of the references. Rename the field from user_ns to _user_ns so that the compiler can verify nothing follows the user struct to the user namespace anymore. Acked-by: Serge Hallyn <serge.hallyn@canonical.com> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Diffstat (limited to 'kernel/user.c')
-rw-r--r--kernel/user.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/user.c b/kernel/user.c
index 71dd2363ab0f..d65fec0615a0 100644
--- a/kernel/user.c
+++ b/kernel/user.c
@@ -58,7 +58,7 @@ struct user_struct root_user = {
.files = ATOMIC_INIT(0),
.sigpending = ATOMIC_INIT(0),
.locked_shm = 0,
- .user_ns = &init_user_ns,
+ ._user_ns = &init_user_ns,
};
/*
@@ -72,7 +72,7 @@ static void uid_hash_insert(struct user_struct *up, struct hlist_head *hashent)
static void uid_hash_remove(struct user_struct *up)
{
hlist_del_init(&up->uidhash_node);
- put_user_ns(up->user_ns);
+ put_user_ns(up->_user_ns); /* It is safe to free the uid hash table now */
}
static struct user_struct *uid_hash_find(uid_t uid, struct hlist_head *hashent)
@@ -153,7 +153,7 @@ struct user_struct *alloc_uid(struct user_namespace *ns, uid_t uid)
new->uid = uid;
atomic_set(&new->__count, 1);
- new->user_ns = get_user_ns(ns);
+ new->_user_ns = get_user_ns(ns);
/*
* Before adding this, check whether we raced