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

Function sballoc

freebsd/kern/uipc_sockbuf.c:264–290  ·  view source on GitHub ↗

* Adjust sockbuf state reflecting allocation of m. */

Source from the content-addressed store, hash-verified

262 * Adjust sockbuf state reflecting allocation of m.
263 */
264void
265sballoc(struct sockbuf *sb, struct mbuf *m)
266{
267
268 SOCKBUF_LOCK_ASSERT(sb);
269
270 sb->sb_ccc += m->m_len;
271
272 if (sb->sb_fnrdy == NULL) {
273 if (m->m_flags & M_NOTREADY)
274 sb->sb_fnrdy = m;
275 else
276 sb->sb_acc += m->m_len;
277 } else
278 m->m_flags |= M_BLOCKED;
279
280 if (m->m_type != MT_DATA && m->m_type != MT_OOBDATA)
281 sb->sb_ctl += m->m_len;
282
283 sb->sb_mbcnt += MSIZE;
284 sb->sb_mcnt += 1;
285
286 if (m->m_flags & M_EXT) {
287 sb->sb_mbcnt += m->m_ext.ext_size;
288 sb->sb_ccnt += 1;
289 }
290}
291
292/*
293 * Adjust sockbuf state reflecting freeing of m.

Callers 4

sbappendrecord_lockedFunction · 0.85
sbappendcontrol_lockedFunction · 0.85
sbcompressFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected