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(list_empty(&u->link)); in unix_notinflight()
151 if (atomic_long_dec_and_test(&u->inflight)) in unix_notinflight()
152 list_del_init(&u->link); in unix_notinflight()
179 struct unix_sock *u = unix_sk(sk); in scan_inflight() local
185 if (test_bit(UNIX_GC_CANDIDATE, &u->gc_flags)) { in scan_inflight()
188 func(u); in scan_inflight()
209 struct unix_sock *u; in scan_children() local
217 u = unix_sk(skb->sk); in scan_children()
222 BUG_ON(!list_empty(&u->link)); in scan_children()
223 list_add_tail(&u->link, &embryos); in scan_children()
228 u = list_entry(embryos.next, struct unix_sock, link); in scan_children()
229 scan_inflight(&u->sk, func, hitlist); in scan_children()
230 list_del_init(&u->link); in scan_children()
245 static void inc_inflight_move_tail(struct unix_sock *u) in inc_inflight_move_tail() argument
247 atomic_long_inc(&u->inflight); in inc_inflight_move_tail()
252 if (test_bit(UNIX_GC_MAYBE_CYCLE, &u->gc_flags)) in inc_inflight_move_tail()
253 list_move_tail(&u->link, &gc_candidates); in inc_inflight_move_tail()
272 struct unix_sock *u; in unix_gc() local
300 list_for_each_entry_safe(u, next, &gc_inflight_list, link) { in unix_gc()
304 total_refs = file_count(u->sk.sk_socket->file); in unix_gc()
305 inflight_refs = atomic_long_read(&u->inflight); in unix_gc()
310 list_move_tail(&u->link, &gc_candidates); in unix_gc()
311 __set_bit(UNIX_GC_CANDIDATE, &u->gc_flags); in unix_gc()
312 __set_bit(UNIX_GC_MAYBE_CYCLE, &u->gc_flags); in unix_gc()
319 list_for_each_entry(u, &gc_candidates, link) in unix_gc()
320 scan_children(&u->sk, dec_inflight, NULL); in unix_gc()
331 u = list_entry(cursor.next, struct unix_sock, link); in unix_gc()
334 list_move(&cursor, &u->link); in unix_gc()
336 if (atomic_long_read(&u->inflight) > 0) { in unix_gc()
337 list_move_tail(&u->link, ¬_cycle_list); in unix_gc()
338 __clear_bit(UNIX_GC_MAYBE_CYCLE, &u->gc_flags); in unix_gc()
339 scan_children(&u->sk, inc_inflight_move_tail, NULL); in unix_gc()
348 u = list_entry(not_cycle_list.next, struct unix_sock, link); in unix_gc()
349 __clear_bit(UNIX_GC_CANDIDATE, &u->gc_flags); in unix_gc()
350 list_move_tail(&u->link, &gc_inflight_list); in unix_gc()
358 list_for_each_entry(u, &gc_candidates, link) in unix_gc()
359 scan_children(&u->sk, inc_inflight, &hitlist); in unix_gc()