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

Function sbappendrecord_locked

freebsd/kern/uipc_sockbuf.c:1102–1128  ·  view source on GitHub ↗

* As above, except the mbuf chain begins a new record. */

Source from the content-addressed store, hash-verified

1100 * As above, except the mbuf chain begins a new record.
1101 */
1102void
1103sbappendrecord_locked(struct sockbuf *sb, struct mbuf *m0)
1104{
1105 struct mbuf *m;
1106
1107 SOCKBUF_LOCK_ASSERT(sb);
1108
1109 if (m0 == NULL)
1110 return;
1111 m_clrprotoflags(m0);
1112 /*
1113 * Put the first mbuf on the queue. Note this permits zero length
1114 * records.
1115 */
1116 sballoc(sb, m0);
1117 SBLASTRECORDCHK(sb);
1118 SBLINKRECORD(sb, m0);
1119 sb->sb_mbtail = m0;
1120 m = m0->m_next;
1121 m0->m_next = 0;
1122 if (m && (m0->m_flags & M_EOR)) {
1123 m0->m_flags &= ~M_EOR;
1124 m->m_flags |= M_EOR;
1125 }
1126 /* always call sbcompress() so it can do SBLASTMBUFCHK() */
1127 sbcompress(sb, m, m0);
1128}
1129
1130/*
1131 * As above, except the mbuf chain begins a new record.

Callers 2

sbappend_lockedFunction · 0.85
sbappendrecordFunction · 0.85

Calls 3

sballocFunction · 0.85
sbcompressFunction · 0.85
m_clrprotoflagsFunction · 0.50

Tested by

no test coverage detected