MCPcopy Create free account
hub / github.com/F-Stack/f-stack / unp_gc_scan

Function unp_gc_scan

freebsd/kern/uipc_usrreq.c:2607–2636  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2605}
2606
2607static void
2608unp_gc_scan(struct unpcb *unp, void (*op)(struct filedescent **, int))
2609{
2610 struct socket *so, *soa;
2611
2612 so = unp->unp_socket;
2613 SOCK_LOCK(so);
2614 if (SOLISTENING(so)) {
2615 /*
2616 * Mark all sockets in our accept queue.
2617 */
2618 TAILQ_FOREACH(soa, &so->sol_comp, so_list) {
2619 if (sotounpcb(soa)->unp_gcflag & UNPGC_IGNORE_RIGHTS)
2620 continue;
2621 SOCKBUF_LOCK(&soa->so_rcv);
2622 unp_scan(soa->so_rcv.sb_mb, op);
2623 SOCKBUF_UNLOCK(&soa->so_rcv);
2624 }
2625 } else {
2626 /*
2627 * Mark all sockets we reference with RIGHTS.
2628 */
2629 if ((unp->unp_gcflag & UNPGC_IGNORE_RIGHTS) == 0) {
2630 SOCKBUF_LOCK(&so->so_rcv);
2631 unp_scan(so->so_rcv.sb_mb, op);
2632 SOCKBUF_UNLOCK(&so->so_rcv);
2633 }
2634 }
2635 SOCK_UNLOCK(so);
2636}
2637
2638static int unp_recycled;
2639SYSCTL_INT(_net_local, OID_AUTO, recycled, CTLFLAG_RD, &unp_recycled, 0,

Callers 1

unp_gcFunction · 0.85

Calls 1

unp_scanFunction · 0.85

Tested by

no test coverage detected