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

Function tcp_pcap_take_cluster_reference

freebsd/netinet/tcp_pcap.c:103–112  ·  view source on GitHub ↗

* If we are below the maximum allowed cluster references, * increment the reference count and return TRUE. Otherwise, * leave the reference count alone and return FALSE. */

Source from the content-addressed store, hash-verified

101 * leave the reference count alone and return FALSE.
102 */
103static __inline bool
104tcp_pcap_take_cluster_reference(void)
105{
106 if (atomic_fetchadd_int(&tcp_pcap_clusters_referenced_cur, 1) >=
107 tcp_pcap_clusters_referenced_max) {
108 atomic_add_int(&tcp_pcap_clusters_referenced_cur, -1);
109 return FALSE;
110 }
111 return TRUE;
112}
113
114/*
115 * For all the external entries in m, apply the given adjustment.

Callers 1

tcp_pcap_addFunction · 0.85

Calls 1

atomic_fetchadd_intFunction · 0.50

Tested by

no test coverage detected