Commit ce0a568d authored by Anna-Maria Gleixner's avatar Anna-Maria Gleixner Committed by Linus Torvalds

userns: use irqsave variant of refcount_dec_and_lock()

The irqsave variant of refcount_dec_and_lock handles irqsave/restore when
taking/releasing the spin lock.  With this variant the call of
local_irq_save/restore is no longer required.

[ s@atomic_dec_and_lock@refcount_dec_and_lock@g]
Link: default avatarAnna-Maria Gleixner <>
Signed-off-by: default avatarSebastian Andrzej Siewior <>
Acked-by: default avatarPeter Zijlstra (Intel) <>
Cc: "Eric W. Biederman" <>
Cc: Ingo Molnar <>
Cc: Thomas Gleixner <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent fc371912
......@@ -169,11 +169,8 @@ void free_uid(struct user_struct *up)
if (!up)
if (refcount_dec_and_lock(&up->__count, &uidhash_lock))
if (refcount_dec_and_lock_irqsave(&up->__count, &uidhash_lock, &flags))
free_user(up, flags);
struct user_struct *alloc_uid(kuid_t uid)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment