summaryrefslogtreecommitdiffstats
path: root/kernel/user.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/user.c')
-rw-r--r--kernel/user.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/user.c b/kernel/user.c
index 36288d840675..5f65ef195259 100644
--- a/kernel/user.c
+++ b/kernel/user.c
@@ -96,7 +96,7 @@ static DEFINE_SPINLOCK(uidhash_lock);
96 96
97/* root_user.__count is 1, for init task cred */ 97/* root_user.__count is 1, for init task cred */
98struct user_struct root_user = { 98struct user_struct root_user = {
99 .__count = ATOMIC_INIT(1), 99 .__count = REFCOUNT_INIT(1),
100 .processes = ATOMIC_INIT(1), 100 .processes = ATOMIC_INIT(1),
101 .sigpending = ATOMIC_INIT(0), 101 .sigpending = ATOMIC_INIT(0),
102 .locked_shm = 0, 102 .locked_shm = 0,
@@ -123,7 +123,7 @@ static struct user_struct *uid_hash_find(kuid_t uid, struct hlist_head *hashent)
123 123
124 hlist_for_each_entry(user, hashent, uidhash_node) { 124 hlist_for_each_entry(user, hashent, uidhash_node) {
125 if (uid_eq(user->uid, uid)) { 125 if (uid_eq(user->uid, uid)) {
126 atomic_inc(&user->__count); 126 refcount_inc(&user->__count);
127 return user; 127 return user;
128 } 128 }
129 } 129 }
@@ -170,7 +170,7 @@ void free_uid(struct user_struct *up)
170 return; 170 return;
171 171
172 local_irq_save(flags); 172 local_irq_save(flags);
173 if (atomic_dec_and_lock(&up->__count, &uidhash_lock)) 173 if (refcount_dec_and_lock(&up->__count, &uidhash_lock))
174 free_user(up, flags); 174 free_user(up, flags);
175 else 175 else
176 local_irq_restore(flags); 176 local_irq_restore(flags);
@@ -191,7 +191,7 @@ struct user_struct *alloc_uid(kuid_t uid)
191 goto out_unlock; 191 goto out_unlock;
192 192
193 new->uid = uid; 193 new->uid = uid;
194 atomic_set(&new->__count, 1); 194 refcount_set(&new->__count, 1);
195 ratelimit_state_init(&new->ratelimit, HZ, 100); 195 ratelimit_state_init(&new->ratelimit, HZ, 100);
196 ratelimit_set_flags(&new->ratelimit, RATELIMIT_MSG_ON_RELEASE); 196 ratelimit_set_flags(&new->ratelimit, RATELIMIT_MSG_ON_RELEASE);
197 197