Lines Matching defs:hn
144 static bool __add_pending_locked(struct handshake_net *hn,
149 hn->hn_pending++;
150 list_add_tail(&req->hr_list, &hn->hn_requests);
154 static void __remove_pending_locked(struct handshake_net *hn,
157 hn->hn_pending--;
167 static bool remove_pending(struct handshake_net *hn, struct handshake_req *req)
171 spin_lock(&hn->hn_lock);
173 __remove_pending_locked(hn, req);
176 spin_unlock(&hn->hn_lock);
181 struct handshake_req *handshake_req_next(struct handshake_net *hn, int class)
186 spin_lock(&hn->hn_lock);
187 list_for_each_entry(pos, &hn->hn_requests, hr_list) {
190 __remove_pending_locked(hn, pos);
194 spin_unlock(&hn->hn_lock);
226 struct handshake_net *hn;
245 hn = handshake_pernet(net);
246 if (!hn)
250 if (READ_ONCE(hn->hn_pending) >= hn->hn_pending_max)
253 spin_lock(&hn->hn_lock);
255 if (test_bit(HANDSHAKE_F_NET_DRAINING, &hn->hn_flags))
260 if (!__add_pending_locked(hn, req))
262 spin_unlock(&hn->hn_lock);
267 if (remove_pending(hn, req))
278 spin_unlock(&hn->hn_lock);
316 struct handshake_net *hn;
326 hn = handshake_pernet(net);
327 if (hn && remove_pending(hn, req)) {