diff --git a/kernel/src/net/socket/ip/datagram/mod.rs b/kernel/src/net/socket/ip/datagram/mod.rs index 7d5e92436..ed05c934c 100644 --- a/kernel/src/net/socket/ip/datagram/mod.rs +++ b/kernel/src/net/socket/ip/datagram/mod.rs @@ -3,7 +3,7 @@ use core::sync::atomic::{AtomicBool, Ordering}; use aster_bigtcp::wire::IpEndpoint; -use ostd::sync::WriteIrqDisabled; +use ostd::sync::PreemptDisabled; use takeable::Takeable; use self::{bound::BoundDatagram, unbound::UnboundDatagram}; @@ -49,7 +49,7 @@ impl OptionSet { pub struct DatagramSocket { options: RwLock, - inner: RwLock, WriteIrqDisabled>, + inner: RwLock, PreemptDisabled>, nonblocking: AtomicBool, pollee: Pollee, } diff --git a/kernel/src/net/socket/ip/stream/listen.rs b/kernel/src/net/socket/ip/stream/listen.rs index ba503eb38..d83c7a695 100644 --- a/kernel/src/net/socket/ip/stream/listen.rs +++ b/kernel/src/net/socket/ip/stream/listen.rs @@ -3,7 +3,7 @@ use aster_bigtcp::{ errors::tcp::ListenError, iface::BindPortConfig, socket::UnboundTcpSocket, wire::IpEndpoint, }; -use ostd::sync::WriteIrqDisabled; +use ostd::sync::PreemptDisabled; use super::{connected::ConnectedStream, StreamObserver}; use crate::{ @@ -18,7 +18,7 @@ pub struct ListenStream { /// A bound socket held to ensure the TCP port cannot be released bound_socket: BoundTcpSocket, /// Backlog sockets listening at the local endpoint - backlog_sockets: RwLock, WriteIrqDisabled>, + backlog_sockets: RwLock, PreemptDisabled>, } impl ListenStream { diff --git a/kernel/src/net/socket/ip/stream/mod.rs b/kernel/src/net/socket/ip/stream/mod.rs index 1723bf713..95086c674 100644 --- a/kernel/src/net/socket/ip/stream/mod.rs +++ b/kernel/src/net/socket/ip/stream/mod.rs @@ -8,7 +8,7 @@ use connecting::{ConnResult, ConnectingStream}; use init::InitStream; use listen::ListenStream; use options::{Congestion, MaxSegment, NoDelay, WindowClamp}; -use ostd::sync::{PreemptDisabled, RwLockReadGuard, RwLockWriteGuard, WriteIrqDisabled}; +use ostd::sync::{PreemptDisabled, RwLockReadGuard, RwLockWriteGuard}; use takeable::Takeable; use util::TcpOptionSet; @@ -46,7 +46,7 @@ pub use self::util::CongestionControl; pub struct StreamSocket { options: RwLock, - state: RwLock, WriteIrqDisabled>, + state: RwLock, PreemptDisabled>, is_nonblocking: AtomicBool, pollee: Pollee, } @@ -109,7 +109,7 @@ impl StreamSocket { /// Ensures that the socket state is up to date and obtains a read lock on it. /// /// For a description of what "up-to-date" means, see [`Self::update_connecting`]. - fn read_updated_state(&self) -> RwLockReadGuard, WriteIrqDisabled> { + fn read_updated_state(&self) -> RwLockReadGuard, PreemptDisabled> { loop { let state = self.state.read(); match state.as_ref() { @@ -125,7 +125,7 @@ impl StreamSocket { /// Ensures that the socket state is up to date and obtains a write lock on it. /// /// For a description of what "up-to-date" means, see [`Self::update_connecting`]. - fn write_updated_state(&self) -> RwLockWriteGuard, WriteIrqDisabled> { + fn write_updated_state(&self) -> RwLockWriteGuard, PreemptDisabled> { self.update_connecting().1 } @@ -142,7 +142,7 @@ impl StreamSocket { &self, ) -> ( RwLockWriteGuard, - RwLockWriteGuard, WriteIrqDisabled>, + RwLockWriteGuard, PreemptDisabled>, ) { // Hold the lock in advance to avoid race conditions. let mut options = self.options.write();