Add unix stream socket

This commit is contained in:
Jianfeng Jiang
2023-07-31 19:23:40 +08:00
committed by Tate, Hongliang Tian
parent af04ef874c
commit 4aeedd16d9
13 changed files with 1175 additions and 1 deletions

View File

@ -5,7 +5,7 @@ use alloc::string::String;
use core::sync::atomic::{AtomicU32, Ordering};
use core::time::Duration;
use super::{FileSystem, Inode, InodeMode, InodeType, Metadata, Vnode, NAME_MAX};
use super::{FileSystem, Inode, InodeMode, InodeType, Metadata, MountNode, Vnode, NAME_MAX};
lazy_static! {
static ref DCACHE: Mutex<BTreeMap<DentryKey, Arc<Dentry>>> = Mutex::new(BTreeMap::new());
@ -162,6 +162,8 @@ impl Dentry {
/// Get the mount node which the dentry belongs to.
pub fn mount_node(&self) -> Arc<MountNode> {
self.mount_node.upgrade().unwrap()
}
pub fn inode(&self) -> Weak<dyn Inode> {
self.vnode.inode()
}