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