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

Function m_clget

freebsd/kern/kern_mbuf.c:1306–1324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1304 */
1305
1306int
1307m_clget(struct mbuf *m, int how)
1308{
1309
1310 KASSERT((m->m_flags & M_EXT) == 0, ("%s: mbuf %p has M_EXT",
1311 __func__, m));
1312 m->m_ext.ext_buf = (char *)NULL;
1313 uma_zalloc_arg(zone_clust, m, how);
1314 /*
1315 * On a cluster allocation failure, drain the packet zone and retry,
1316 * we might be able to loosen a few clusters up on the drain.
1317 */
1318 if ((how & M_NOWAIT) && (m->m_ext.ext_buf == NULL)) {
1319 uma_zone_reclaim(zone_pack, UMA_RECLAIM_DRAIN);
1320 uma_zalloc_arg(zone_clust, m, how);
1321 }
1322 MBUF_PROBE2(m__clget, m, how);
1323 return (m->m_flags & M_EXT);
1324}
1325
1326/*
1327 * m_cljget() is different from m_clget() as it can allocate clusters without

Callers

nothing calls this directly

Calls 2

uma_zalloc_argFunction · 0.85
uma_zone_reclaimFunction · 0.85

Tested by

no test coverage detected