Lines Matching refs:u
126 struct unix_sock *u = unix_sk(s); in unix_inflight() local
128 if (atomic_long_inc_return(&u->inflight) == 1) { in unix_inflight()
129 BUG_ON(!list_empty(&u->link)); in unix_inflight()
130 list_add_tail(&u->link, &gc_inflight_list); in unix_inflight()
132 BUG_ON(list_empty(&u->link)); in unix_inflight()
147 struct unix_sock *u = unix_sk(s); in unix_notinflight() local
149 BUG_ON(!atomic_long_read(&u->inflight)); in unix_notinflight()
150 BUG_ON(list_empty(&u->link)); in unix_notinflight()
152 if (atomic_long_dec_and_test(&u->inflight)) in unix_notinflight()
153 list_del_init(&u->link); in unix_notinflight()
180 struct unix_sock *u = unix_sk(sk); in scan_inflight() local
186 if (test_bit(UNIX_GC_CANDIDATE, &u->gc_flags)) { in scan_inflight()
189 func(u); in scan_inflight()
210 struct unix_sock *u; in scan_children() local
218 u = unix_sk(skb->sk); in scan_children()
223 BUG_ON(!list_empty(&u->link)); in scan_children()
224 list_add_tail(&u->link, &embryos); in scan_children()
229 u = list_entry(embryos.next, struct unix_sock, link); in scan_children()
230 scan_inflight(&u->sk, func, hitlist); in scan_children()
231 list_del_init(&u->link); in scan_children()
246 static void inc_inflight_move_tail(struct unix_sock *u) in inc_inflight_move_tail() argument
248 atomic_long_inc(&u->inflight); in inc_inflight_move_tail()
253 if (test_bit(UNIX_GC_MAYBE_CYCLE, &u->gc_flags)) in inc_inflight_move_tail()
254 list_move_tail(&u->link, &gc_candidates); in inc_inflight_move_tail()
273 struct unix_sock *u; in unix_gc() local
301 list_for_each_entry_safe(u, next, &gc_inflight_list, link) { in unix_gc()
305 total_refs = file_count(u->sk.sk_socket->file); in unix_gc()
306 inflight_refs = atomic_long_read(&u->inflight); in unix_gc()
311 list_move_tail(&u->link, &gc_candidates); in unix_gc()
312 __set_bit(UNIX_GC_CANDIDATE, &u->gc_flags); in unix_gc()
313 __set_bit(UNIX_GC_MAYBE_CYCLE, &u->gc_flags); in unix_gc()
320 list_for_each_entry(u, &gc_candidates, link) in unix_gc()
321 scan_children(&u->sk, dec_inflight, NULL); in unix_gc()
332 u = list_entry(cursor.next, struct unix_sock, link); in unix_gc()
335 list_move(&cursor, &u->link); in unix_gc()
337 if (atomic_long_read(&u->inflight) > 0) { in unix_gc()
338 list_move_tail(&u->link, ¬_cycle_list); in unix_gc()
339 __clear_bit(UNIX_GC_MAYBE_CYCLE, &u->gc_flags); in unix_gc()
340 scan_children(&u->sk, inc_inflight_move_tail, NULL); in unix_gc()
350 list_for_each_entry(u, &gc_candidates, link) in unix_gc()
351 scan_children(&u->sk, inc_inflight, &hitlist); in unix_gc()
357 u = list_entry(not_cycle_list.next, struct unix_sock, link); in unix_gc()
358 __clear_bit(UNIX_GC_CANDIDATE, &u->gc_flags); in unix_gc()
359 list_move_tail(&u->link, &gc_inflight_list); in unix_gc()