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

Function in_pcbref

freebsd/netinet/in_pcb.c:1652–1659  ·  view source on GitHub ↗

* in_pcbref() bumps the reference count on an inpcb in order to maintain * stability of an inpcb pointer despite the inpcb lock being released. This * is used in TCP when the inpcbinfo lock needs to be acquired or upgraded, * but where the inpcb lock may already held, or when acquiring a reference * via a pcbgroup. * * in_pcbref() should be used only to provide brief memory stability, and

Source from the content-addressed store, hash-verified

1650 * using in_pcbrele().
1651 */
1652void
1653in_pcbref(struct inpcb *inp)
1654{
1655
1656 KASSERT(inp->inp_refcount > 0, ("%s: refcount 0", __func__));
1657
1658 refcount_acquire(&inp->inp_refcount);
1659}
1660
1661/*
1662 * Drop a refcount on an inpcb elevated using in_pcbref(); because a call to

Callers 13

udp_appendFunction · 0.85
in_pcblookup_groupFunction · 0.85
tcp_twstartFunction · 0.85
tcp_tw_2msl_scanFunction · 0.85
tcp_log_tcpcbfiniFunction · 0.85
hpts_sane_pace_insertFunction · 0.85
hpts_sane_input_insertFunction · 0.85
tcp_newtcpcbFunction · 0.85
inp_join_groupFunction · 0.85
in6_pcblookup_groupFunction · 0.85
in6p_join_groupFunction · 0.85
udp6_appendFunction · 0.85

Calls 1

refcount_acquireFunction · 0.85

Tested by

no test coverage detected