Lines Matching defs:sosp

460 			struct socket *sosp;
465 sosp = soref(so->so_sp->ssp_socket);
467 sorele(sosp);
1339 struct socket *sosp;
1355 sosp = soref(so->so_sp->ssp_socket);
1357 sorele(sosp);
1383 /* Find sosp, the drain socket where data will be spliced into. */
1386 sosp = fp->f_data;
1388 if (sosp->so_proto->pr_usrreqs->pru_send !=
1396 if ((error = sblock(&sosp->so_snd, SBL_WAIT)) != 0) {
1400 sosplice_solock_pair(so, sosp);
1403 (sosp->so_options & SO_ACCEPTCONN)) {
1412 if ((sosp->so_state & (SS_ISCONNECTED|SS_ISCONNECTING)) == 0) {
1426 if (sosp->so_sp == NULL) {
1430 timeout_set_flags(&so_sp->ssp_idleto, soidle, sosp,
1432 task_set(&so_sp->ssp_task, sotask, sosp);
1434 sosp->so_sp = so_sp;
1436 if (so->so_sp->ssp_socket || sosp->so_sp->ssp_soback) {
1453 /* Splice so and sosp together. */
1455 mtx_enter(&sosp->so_snd.sb_mtx);
1456 so->so_sp->ssp_socket = sosp;
1457 sosp->so_sp->ssp_soback = so;
1458 mtx_leave(&sosp->so_snd.sb_mtx);
1461 sosplice_sounlock_pair(so, sosp);
1462 sbunlock(&sosp->so_snd);
1466 mtx_enter(&sosp->so_snd.sb_mtx);
1468 sosp->so_snd.sb_flags |= SB_SPLICE;
1469 mtx_leave(&sosp->so_snd.sb_mtx);
1478 sosplice_sounlock_pair(so, sosp);
1479 sbunlock(&sosp->so_snd);
1487 sounsplice(struct socket *so, struct socket *sosp, int freeing)
1492 mtx_enter(&sosp->so_snd.sb_mtx);
1494 sosp->so_snd.sb_flags &= ~SB_SPLICE;
1495 so->so_sp->ssp_socket = sosp->so_sp->ssp_soback = NULL;
1496 mtx_leave(&sosp->so_snd.sb_mtx);
1515 solock_shared(sosp);
1516 if (sowriteable(sosp))
1517 sowwakeup(sosp);
1518 sounlock_shared(sosp);
1529 struct socket *sosp;
1532 sosp = soref(so->so_sp->ssp_socket);
1534 sorele(sosp);
1568 struct socket *sosp = so->so_sp->ssp_socket;
1581 mtx_enter(&sosp->so_snd.sb_mtx);
1586 if (sosp->so_snd.sb_state & SS_CANTSENDMORE) {
1591 error = READ_ONCE(sosp->so_error);
1597 if ((sosp->so_state & SS_ISCONNECTED) == 0)
1609 space = sbspace_locked(sosp, &sosp->so_snd);
1619 if (space < sosp->so_snd.sb_lowat)
1623 sosp->so_snd.sb_state |= SS_ISSENDING;
1646 mtx_leave(&sosp->so_snd.sb_mtx);
1652 mtx_enter(&sosp->so_snd.sb_mtx);
1675 if (sosp->so_snd.sb_hiwat < m->m_pkthdr.len) {
1724 if (!maxreached && sosp->so_snd.sb_datacc > 0) {
1771 mtx_leave(&sosp->so_snd.sb_mtx);
1777 mtx_enter(&sosp->so_snd.sb_mtx);
1794 mtx_leave(&sosp->so_snd.sb_mtx);
1796 solock_shared(sosp);
1797 error = pru_send(sosp, m, NULL, NULL);
1798 sounlock_shared(sosp);
1800 mtx_enter(&sosp->so_snd.sb_mtx);
1803 if (sosp->so_snd.sb_state &
1820 mtx_leave(&sosp->so_snd.sb_mtx);
1822 solock_shared(sosp);
1823 error = pru_sendoob(sosp, o, NULL, NULL);
1824 sounlock_shared(sosp);
1826 mtx_enter(&sosp->so_snd.sb_mtx);
1829 if (sosp->so_snd.sb_state & SS_CANTSENDMORE)
1847 sosp->so_snd.sb_state &= ~SS_ISSENDING;
1849 mtx_leave(&sosp->so_snd.sb_mtx);
1851 solock_shared(sosp);
1852 error = pru_send(sosp, m, NULL, NULL);
1853 sounlock_shared(sosp);
1855 mtx_enter(&sosp->so_snd.sb_mtx);
1858 if (sosp->so_snd.sb_state & SS_CANTSENDMORE ||
1859 sosp->so_pcb == NULL)
1870 sosp->so_snd.sb_state &= ~SS_ISSENDING;
1879 (sosp->so_snd.sb_state & SS_CANTSENDMORE) ||
1883 mtx_leave(&sosp->so_snd.sb_mtx);
1890 soref(sosp);
1891 sounsplice(so, sosp, 0);
1892 sorele(sosp);