diff --git a/sys/cam/ctl/ctl_ha.c b/sys/cam/ctl/ctl_ha.c --- a/sys/cam/ctl/ctl_ha.c +++ b/sys/cam/ctl/ctl_ha.c @@ -164,17 +164,17 @@ report = 1; } if (so) { - SOCKBUF_LOCK(&so->so_rcv); + SOCK_RECVBUF_LOCK(so); soupcall_clear(so, SO_RCV); while (softc->ha_receiving) { wakeup(&softc->ha_receiving); - msleep(&softc->ha_receiving, SOCKBUF_MTX(&so->so_rcv), + msleep(&softc->ha_receiving, SOCK_RECVBUF_MTX(so), 0, "ha_rx exit", 0); } - SOCKBUF_UNLOCK(&so->so_rcv); - SOCKBUF_LOCK(&so->so_snd); + SOCK_RECVBUF_UNLOCK(so); + SOCK_SENDBUF_LOCK(so); soupcall_clear(so, SO_SND); - SOCKBUF_UNLOCK(&so->so_snd); + SOCK_SENDBUF_UNLOCK(so); softc->ha_so = NULL; if (softc->ha_connect) pause("reconnect", hz / 2); @@ -218,7 +218,7 @@ next = wire_hdr.length; else next = sizeof(wire_hdr); - SOCKBUF_LOCK(&so->so_rcv); + SOCK_RECVBUF_LOCK(so); while (sbavail(&so->so_rcv) < next || softc->ha_disconnect) { if (softc->ha_connected == 0 || softc->ha_disconnect || so->so_error || @@ -226,10 +226,10 @@ goto errout; } so->so_rcv.sb_lowat = next; - msleep(&softc->ha_receiving, SOCKBUF_MTX(&so->so_rcv), + msleep(&softc->ha_receiving, SOCK_RECVBUF_MTX(so), 0, "-", 0); } - SOCKBUF_UNLOCK(&so->so_rcv); + SOCK_RECVBUF_UNLOCK(so); if (wire_hdr.length == 0) { iov.iov_base = &wire_hdr; @@ -246,7 +246,7 @@ if (error != 0) { printf("%s: header receive error %d\n", __func__, error); - SOCKBUF_LOCK(&so->so_rcv); + SOCK_RECVBUF_LOCK(so); goto errout; } } else { @@ -259,7 +259,7 @@ errout: softc->ha_receiving = 0; wakeup(&softc->ha_receiving); - SOCKBUF_UNLOCK(&so->so_rcv); + SOCK_RECVBUF_UNLOCK(so); ctl_ha_conn_wake(softc); kthread_exit(); } @@ -280,13 +280,13 @@ break; } } - SOCKBUF_LOCK(&so->so_snd); + SOCK_SENDBUF_LOCK(so); if (sbspace(&so->so_snd) < softc->ha_sending->m_pkthdr.len) { so->so_snd.sb_lowat = softc->ha_sending->m_pkthdr.len; - SOCKBUF_UNLOCK(&so->so_snd); + SOCK_SENDBUF_UNLOCK(so); break; } - SOCKBUF_UNLOCK(&so->so_snd); + SOCK_SENDBUF_UNLOCK(so); error = sosend(softc->ha_so, NULL, NULL, softc->ha_sending, NULL, MSG_DONTWAIT, curthread); softc->ha_sending = NULL; @@ -309,14 +309,14 @@ if (error) printf("%s: soreserve failed %d\n", __func__, error); - SOCKBUF_LOCK(&so->so_rcv); + SOCK_RECVBUF_LOCK(so); so->so_rcv.sb_lowat = sizeof(struct ha_msg_wire); soupcall_set(so, SO_RCV, ctl_ha_rupcall, softc); - SOCKBUF_UNLOCK(&so->so_rcv); - SOCKBUF_LOCK(&so->so_snd); + SOCK_RECVBUF_UNLOCK(so); + SOCK_SENDBUF_LOCK(so); so->so_snd.sb_lowat = sizeof(struct ha_msg_wire); soupcall_set(so, SO_SND, ctl_ha_supcall, softc); - SOCKBUF_UNLOCK(&so->so_snd); + SOCK_SENDBUF_UNLOCK(so); bzero(&opt, sizeof(struct sockopt)); opt.sopt_dir = SOPT_SET;