848 head = &hb1->chain;
849
850 plist_for_each_entry_safe(this, next, head, list) {
851 if (match_futex (&this->key, &key1)) {
852 wake_futex(this);
853 if (++ret >= nr_wake)
854 break;
855 }
856 }
857
858 if (op_ret > 0) {
859 head = &hb2->chain;
860
861 op_ret = 0;
862 plist_for_each_entry_safe(this, next, head, list) {
863 if (match_futex (&this->key, &key2)) {
864 wake_futex(this);
865 if (++op_ret >= nr_wake2)
866 break;
867 }
868 }
869 ret += op_ret;
870 }
871
872 spin_unlock(&hb1->lock);
873 if (hb1 != hb2)
874 spin_unlock(&hb2->lock);
875out:
876 futex_unlock_mm(fshared);
877
878 return ret;
879}
880
881
882
883
884
885static int futex_requeue(u32 __user *uaddr1, struct rw_semaphore *fshared,
886 u32 __user *uaddr2,
887 int nr_wake, int nr_requeue, u32 *cmpval)
888{