* Following replacement or removal of the first mbuf on the first mbuf chain * of a socket buffer, push necessary state changes back into the socket * buffer so that other consumers see the values consistently. 'nextrecord' * is the callers locally stored value of the original value of * sb->sb_mb->m_nextpkt which must be restored when the lead mbuf changes. * NOTE: 'nextrecord' may be NULL.
| 1862 | * NOTE: 'nextrecord' may be NULL. |
| 1863 | */ |
| 1864 | static __inline void |
| 1865 | sockbuf_pushsync(struct sockbuf *sb, struct mbuf *nextrecord) |
| 1866 | { |
| 1867 | |
| 1868 | SOCKBUF_LOCK_ASSERT(sb); |
| 1869 | /* |
| 1870 | * First, update for the new value of nextrecord. If necessary, make |
| 1871 | * it the first record. |
| 1872 | */ |
| 1873 | if (sb->sb_mb != NULL) |
| 1874 | sb->sb_mb->m_nextpkt = nextrecord; |
| 1875 | else |
| 1876 | sb->sb_mb = nextrecord; |
| 1877 | |
| 1878 | /* |
| 1879 | * Now update any dependent socket buffer fields to reflect the new |
| 1880 | * state. This is an expanded inline of SB_EMPTY_FIXUP(), with the |
| 1881 | * addition of a second clause that takes care of the case where |
| 1882 | * sb_mb has been updated, but remains the last record. |
| 1883 | */ |
| 1884 | if (sb->sb_mb == NULL) { |
| 1885 | sb->sb_mbtail = NULL; |
| 1886 | sb->sb_lastrecord = NULL; |
| 1887 | } else if (sb->sb_mb->m_nextpkt == NULL) |
| 1888 | sb->sb_lastrecord = sb->sb_mb; |
| 1889 | } |
| 1890 | |
| 1891 | /* |
| 1892 | * Implement receive operations on a socket. We depend on the way that |
no outgoing calls
no test coverage detected