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--;
169 static bool remove_pending(struct handshake_net *hn, struct handshake_req *req)
173 spin_lock_bh(&hn->hn_lock);
174 if (!test_bit(HANDSHAKE_F_NET_DRAINING, &hn->hn_flags) &&
176 __remove_pending_locked(hn, req);
179 spin_unlock_bh(&hn->hn_lock);
186 * @hn: per-net handshake state
195 struct handshake_req *handshake_req_next(struct handshake_net *hn, int class)
200 spin_lock_bh(&hn->hn_lock);
201 list_for_each_entry(pos, &hn->hn_requests, hr_list) {
204 __remove_pending_locked(hn, pos);
215 spin_unlock_bh(&hn->hn_lock);
254 struct handshake_net *hn;
281 hn = handshake_pernet(net);
282 if (!hn)
286 if (READ_ONCE(hn->hn_pending) >= hn->hn_pending_max)
289 spin_lock_bh(&hn->hn_lock);
291 if (test_bit(HANDSHAKE_F_NET_DRAINING, &hn->hn_flags))
296 if (!__add_pending_locked(hn, req))
298 spin_unlock_bh(&hn->hn_lock);
303 if (remove_pending(hn, req))
311 spin_unlock_bh(&hn->hn_lock);
355 struct handshake_net *hn;
365 hn = handshake_pernet(net);
366 if (hn && remove_pending(hn, req)) {