* 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. */
| 101 | * leave the reference count alone and return FALSE. |
| 102 | */ |
| 103 | static __inline bool |
| 104 | tcp_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. |
no test coverage detected