681 return 0;
682}
683
684static int unlock_futex_pi(u32 __user *uaddr, u32 uval)
685{
686 u32 oldval;
687
688
689
690
691
692 oldval = cmpxchg_futex_value_locked(uaddr, uval, 0);
693
694 if (oldval == -EFAULT)
695 return oldval;
696 if (oldval != uval)
697 return -EAGAIN;
698
699 return 0;
700}
701
702
703
704
705static inline void
706double_lock_hb(struct futex_hash_bucket *hb1, struct futex_hash_bucket *hb2)
707{
708 if (hb1 <= hb2) {
709 spin_lock(&hb1->lock);
710 if (hb1 < hb2)
711 spin_lock_nested(&hb2->lock, SINGLE_DEPTH_NESTING);
712 } else {
713 spin_lock(&hb2->lock);
714 spin_lock_nested(&hb1->lock, SINGLE_DEPTH_NESTING);
715 }
716}
717
718
719
720
721