火花 2 周之前
父節點
當前提交
95f5e0807e

+ 1 - 0
kernel/src/namespaces/syscall.rs

@@ -37,6 +37,7 @@ impl Syscall {
         Ok(check)
     }
 
+    #[allow(unused)]
     pub fn sys_setns(_fd: i32, flags: u64) -> Result<usize, SystemError> {
         let check = check_unshare_flags(flags)?;
 

+ 3 - 0
kernel/src/net/socket/buffer.rs

@@ -30,10 +30,12 @@ impl Buffer {
         return self.metadata.buf_size - self.read_buffer.lock().len() == 0;
     }
 
+    #[allow(unused)]
     pub fn is_write_buf_empty(&self) -> bool {
         return self.write_buffer.lock().is_empty();
     }
 
+    #[allow(unused)]
     pub fn is_write_buf_full(&self) -> bool {
         return self.write_buffer.lock().len() >= self.metadata.buf_size;
     }
@@ -60,6 +62,7 @@ impl Buffer {
         Ok(len)
     }
 
+    #[allow(unused)]
     pub fn write_write_buffer(&self, buf: &[u8]) -> Result<usize, SystemError> {
         let mut buffer = self.write_buffer.lock_irqsave();
 

+ 3 - 0
kernel/src/net/socket/unix/seqpacket/inner.rs

@@ -138,6 +138,7 @@ pub struct Connected {
 
 impl Connected {
     /// 默认的缓冲区大小
+    #[allow(unused)]
     pub const DEFAULT_BUF_SIZE: usize = 64 * 1024;
 
     pub fn new_pair(
@@ -158,10 +159,12 @@ impl Connected {
         (this, peer)
     }
 
+    #[allow(unused)]
     pub fn set_peer_inode(&mut self, peer_epoint: Option<Endpoint>) {
         self.peer_inode = peer_epoint;
     }
 
+    #[allow(unused)]
     pub fn set_inode(&mut self, epoint: Option<Endpoint>) {
         self.inode = epoint;
     }

+ 2 - 0
kernel/src/net/socket/unix/seqpacket/mod.rs

@@ -25,6 +25,7 @@ pub struct SeqpacketSocket {
 
 impl SeqpacketSocket {
     /// 默认的元数据缓冲区大小
+    #[allow(unused)]
     pub const DEFAULT_METADATA_BUF_SIZE: usize = 1024;
     /// 默认的缓冲区大小
     pub const DEFAULT_BUF_SIZE: usize = 64 * 1024;
@@ -50,6 +51,7 @@ impl SeqpacketSocket {
         return Ok(inode);
     }
 
+    #[allow(unused)]
     pub fn new_connected(connected: Connected, is_nonblocking: bool) -> Arc<Self> {
         Arc::new_cyclic(|me| Self {
             inner: RwLock::new(Inner::Connected(connected)),

+ 4 - 1
kernel/src/net/socket/unix/stream/inner.rs

@@ -90,6 +90,7 @@ impl Connected {
         self.addr.as_ref()
     }
 
+    #[allow(unused)]
     pub fn set_addr(&mut self, addr: Option<Endpoint>) {
         self.addr = addr;
     }
@@ -98,6 +99,7 @@ impl Connected {
         self.peer_addr.as_ref()
     }
 
+    #[allow(unused)]
     pub fn set_peer_addr(&mut self, peer: Option<Endpoint>) {
         self.peer_addr = peer;
     }
@@ -164,7 +166,7 @@ impl Connected {
             return Err(SystemError::EINVAL);
         }
     }
-
+    #[allow(unused)]
     pub fn shutdown(&self, how: ShutdownTemp) -> Result<(), SystemError> {
         if how.is_empty() {
             return Err(SystemError::EINVAL);
@@ -212,6 +214,7 @@ impl Listener {
         return Ok(());
     }
 
+    #[allow(unused)]
     pub fn pop_incoming(&self) -> Option<Arc<Inode>> {
         let mut incoming_connects = self.incoming_connects.lock();
 

+ 2 - 1
kernel/src/net/socket/unix/stream/mod.rs

@@ -31,6 +31,7 @@ pub struct StreamSocket {
 
 impl StreamSocket {
     /// 默认的元数据缓冲区大小
+    #[allow(unused)]
     pub const DEFAULT_METADATA_BUF_SIZE: usize = 1024;
     /// 默认的缓冲区大小
     pub const DEFAULT_BUF_SIZE: usize = 64 * 1024;
@@ -60,7 +61,7 @@ impl StreamSocket {
 
         return Ok((inode0, inode1));
     }
-
+    #[allow(unused)]
     pub fn new_connected(connected: Connected) -> Arc<Self> {
         Arc::new_cyclic(|me| Self {
             inner: RwLock::new(Inner::Connected(connected)),