/DragonOS/kernel/src/ipc/ |
H A D | pipe.rs | 173 let inode = self.inner.lock(); in readable() localVariable 174 return inode.valid_cnt > 0 || inode.writer == 0; in readable() 178 let inode = self.inner.lock(); in writeable() localVariable 179 return !inode.buf_full() || inode.reader == 0; in writeable() 206 let mut inode = self.inner.lock(); in read_at() localVariable 209 while inode.valid_cnt == 0 { in read_at() 211 if inode.writer == 0 { in read_at() 220 drop(inode); in read_at() 225 drop(inode); in read_at() 231 inode = self.inner.lock(); in read_at() [all …]
|
/DragonOS/kernel/src/filesystem/vfs/ |
H A D | open.rs | 46 let (inode, path) = user_path_at(&ProcessManager::current_pcb(), dirfd, path)?; in do_faccessat() 49 let _inode = inode.lookup_follow_symlink(path.as_str(), VFS_MAX_FOLLOW_SYMLINK_TIMES)?; in do_faccessat() 59 let (inode, path) = user_path_at(&ProcessManager::current_pcb(), dirfd, path)?; in do_fchmodat() 62 let _inode = inode.lookup_follow_symlink(path.as_str(), VFS_MAX_FOLLOW_SYMLINK_TIMES)?; in do_fchmodat() 83 let (inode, path) = user_path_at(&ProcessManager::current_pcb(), dirfd, path)?; in do_fchownat() 86 let inode = if follow_symlink { in do_fchownat() localVariable 87 inode.lookup_follow_symlink2(path.as_str(), VFS_MAX_FOLLOW_SYMLINK_TIMES, false) in do_fchownat() 89 inode.lookup(path.as_str()) in do_fchownat() 92 if inode.is_err() { in do_fchownat() 93 let errno = inode.clone().unwrap_err(); in do_fchownat() [all …]
|
H A D | file.rs | 130 inode: Lazy<Weak<dyn IndexNode>>, field 150 pub fn new(inode: Option<Weak<dyn IndexNode>>) -> Arc<PageCache> { in new() 153 inode: { in new() 155 if let Some(inode) = inode { in new() 156 v.init(inode); in new() 164 pub fn inode(&self) -> Option<Weak<dyn IndexNode>> { in inode() method 165 self.inode.try_get().cloned() in inode() 187 pub fn set_inode(&self, inode: Weak<dyn IndexNode>) -> Result<(), SystemError> { in set_inode() 188 if self.inode.initialized() { in set_inode() 191 self.inode.init(inode); in set_inode() [all …]
|
H A D | mount.rs | 130 let inode: Arc<MountFSInode> = Arc::new(self); in wrap() localVariable 132 let weak: Weak<MountFSInode> = Arc::downgrade(&inode); in wrap() 135 let ptr: *mut MountFSInode = inode.as_ref() as *const Self as *mut Self; in wrap() 142 return inode; in wrap() 183 Some(inode) => { in do_parent() 184 let inner_inode = inode.parent()?; in do_parent() 386 .map(|inode| inode as Arc<dyn IndexNode>) in find() 393 _ => self.do_find(name).map(|inode| inode as Arc<dyn IndexNode>), in find() 524 if let Some(inode) = &self.mount_fs.self_mountpoint { in dname() 525 return inode.inner_inode.dname(); in dname() [all …]
|
H A D | utils.rs | 45 let mut inode = ROOT_INODE(); in user_path_at() localVariable 65 inode = file.inode(); in user_path_at() 77 return Ok((inode, ret_path)); in user_path_at()
|
H A D | core.rs | 225 let inode: Result<Arc<dyn IndexNode>, SystemError> = in do_unlink_at() localVariable 228 if inode.is_err() { in do_unlink_at() 229 let errno = inode.clone().unwrap_err(); in do_unlink_at() 236 if inode.unwrap().metadata()?.file_type == FileType::Dir { in do_unlink_at() 319 let inode = current_node.lookup_follow_symlink(&rest_path, VFS_MAX_FOLLOW_SYMLINK_TIMES)?; in do_mount() localVariable 326 return inode.mount(fs); in do_mount() 347 let inode = do_mkdir_at( in do_mount_mkdir() localVariable 357 return inode.mount(fs); in do_mount_mkdir()
|
H A D | mod.rs | 521 Ok(inode) => { in mkdir() 522 if inode.metadata()?.file_type == FileType::Dir { in mkdir() 523 Ok(inode) in mkdir() 678 let inode = result.find(&name)?; in do_lookup_follow_symlink() localVariable 679 let file_type = inode.metadata()?.file_type; in do_lookup_follow_symlink() 683 return Ok(inode); in do_lookup_follow_symlink() 691 let len = inode.read_at( in do_lookup_follow_symlink() 711 result = inode; in do_lookup_follow_symlink()
|
/DragonOS/kernel/src/filesystem/ramfs/ |
H A D | mod.rs | 174 let mut inode = self.0.lock(); in truncate() localVariable 177 if inode.metadata.file_type == FileType::Dir { in truncate() 182 if inode.data.len() > len { in truncate() 183 inode.data.resize(len, 0); in truncate() 211 let inode: SpinLockGuard<RamFSInode> = self.0.lock(); in read_at() localVariable 214 if inode.metadata.file_type == FileType::Dir { in read_at() 218 let start = inode.data.len().min(offset); in read_at() 219 let end = inode.data.len().min(offset + len); in read_at() 227 let src = &inode.data[start..end]; in read_at() 244 let mut inode: SpinLockGuard<RamFSInode> = self.0.lock(); in write_at() localVariable [all …]
|
/DragonOS/kernel/src/filesystem/procfs/ |
H A D | mod.rs | 368 let inode = result.root_inode(); in new() localVariable 369 let binding = inode.create( in new() 386 let binding = inode.create("kmsg", FileType::File, ModeType::from_bits_truncate(0o444)); in new() 405 let inode: Arc<dyn IndexNode> = self.root_inode(); in register_pid() localVariable 407 let pid_dir: Arc<dyn IndexNode> = inode.create( in register_pid() 458 let mut inode: SpinLockGuard<ProcFSInode> = self.0.lock(); in open() localVariable 461 if let FileType::Dir = inode.metadata.file_type { in open() 466 let file_size = match inode.fdata.ftype { in open() 467 ProcFileType::ProcStatus => inode.open_status(&mut private_data)?, in open() 468 ProcFileType::ProcMeminfo => inode.open_meminfo(&mut private_data)?, in open() [all …]
|
/DragonOS/kernel/src/filesystem/sysfs/ |
H A D | symlink.rs | 53 kobj.inode() in do_create_link() 66 inode: &Arc<KernFSInode>, in do_create_link_sd() 71 let target_inode = target.inode().ok_or(SystemError::ENOENT)?; in do_create_link_sd() 77 let kn = inode.add_link(name.clone(), &target_inode, target_abs_path); in do_create_link_sd() 83 self.warn_duplicate(inode, &name); in do_create_link_sd() 98 inode: &Arc<KernFSInode>, in create_link_sd() 102 return self.do_create_link_sd(inode, target, name, true); in create_link_sd()
|
H A D | dir.rs | 61 .map(|p| p.upgrade().unwrap().inode()) in create_dir() 119 let kobj_inode = kobj.inode(); in remove_dir() 122 if let Some(inode) = kobj_inode { in remove_dir() 123 let parent = inode.parent().unwrap(); in remove_dir()
|
H A D | group.rs | 61 let kobj_inode = kobj.inode().ok_or(SystemError::EINVAL)?; in do_create_group() 134 let inode = kobj.inode().unwrap(); in remove_group() localVariable 137 parent_inode = inode in remove_group() 145 parent_inode = inode; in remove_group()
|
H A D | file.rs | 110 let inode = kobj.inode().ok_or(SystemError::EINVAL)?; in create_file() localVariable 111 return self.add_file_with_mode(&inode, attr, attr.mode()); in create_file() 182 let parent = kobj.inode(); in remove_file() 209 let inode = kobj.inode().ok_or(SystemError::EINVAL)?; in create_bin_file() localVariable 210 return self.add_bin_file_with_mode(&inode, attr, attr.mode()); in create_bin_file() 218 let parent = kobj.inode(); in remove_bin_file()
|
/DragonOS/kernel/src/filesystem/devfs/ |
H A D | null_dev.rs | 35 let inode = NullInode { in new() localVariable 57 let result = Arc::new(LockedNullInode(SpinLock::new(inode))); in new() 100 let mut inode = self.0.lock(); in set_metadata() localVariable 101 inode.metadata.atime = metadata.atime; in set_metadata() 102 inode.metadata.mtime = metadata.mtime; in set_metadata() 103 inode.metadata.ctime = metadata.ctime; in set_metadata() 104 inode.metadata.mode = metadata.mode; in set_metadata() 105 inode.metadata.uid = metadata.uid; in set_metadata() 106 inode.metadata.gid = metadata.gid; in set_metadata()
|
H A D | zero_dev.rs | 35 let inode = ZeroInode { in new() localVariable 57 let result = Arc::new(LockedZeroInode(SpinLock::new(inode))); in new() 100 let mut inode = self.0.lock(); in set_metadata() localVariable 101 inode.metadata.atime = metadata.atime; in set_metadata() 102 inode.metadata.mtime = metadata.mtime; in set_metadata() 103 inode.metadata.ctime = metadata.ctime; in set_metadata() 104 inode.metadata.mode = metadata.mode; in set_metadata() 105 inode.metadata.uid = metadata.uid; in set_metadata() 106 inode.metadata.gid = metadata.gid; in set_metadata()
|
H A D | mod.rs | 310 Ok(inode) => inode, in add_dir() 424 let inode = self.0.lock(); in find() localVariable 426 if inode.metadata.file_type != FileType::Dir { in find() 432 return Ok(inode.self_ref.upgrade().ok_or(SystemError::ENOENT)?); in find() 435 return Ok(inode.parent.upgrade().ok_or(SystemError::ENOENT)?); in find() 439 return Ok(inode in find() 453 let inode: SpinLockGuard<DevFSInode> = self.0.lock(); in get_entry_name() localVariable 454 if inode.metadata.file_type != FileType::Dir { in get_entry_name() 468 let mut key: Vec<String> = inode in get_entry_name() 483 …node_id={inode_id:?}, to find={to_find:?}", key_len=key.len(), inode_id = inode.metadata.inode_id,… in get_entry_name() [all …]
|
/DragonOS/kernel/src/virt/kvm/ |
H A D | kvm_dev.rs | 54 let inode = KvmInode { in new() localVariable 75 let result = Arc::new(LockedKvmInode(SpinLock::new(inode))); in new() 119 let mut inode = self.0.lock(); in set_metadata() localVariable 120 inode.metadata.atime = metadata.atime; in set_metadata() 121 inode.metadata.mtime = metadata.mtime; in set_metadata() 122 inode.metadata.ctime = metadata.ctime; in set_metadata() 123 inode.metadata.mode = metadata.mode; in set_metadata() 124 inode.metadata.uid = metadata.uid; in set_metadata() 125 inode.metadata.gid = metadata.gid; in set_metadata()
|
H A D | vcpu_dev.rs | 65 let inode = VcpuInode { in new() localVariable 89 let result = Arc::new(LockedVcpuInode(SpinLock::new(inode))); in new() 127 let mut inode = self.0.lock(); in set_metadata() localVariable 128 inode.metadata.atime = metadata.atime; in set_metadata() 129 inode.metadata.mtime = metadata.mtime; in set_metadata() 130 inode.metadata.ctime = metadata.ctime; in set_metadata() 131 inode.metadata.mode = metadata.mode; in set_metadata() 132 inode.metadata.uid = metadata.uid; in set_metadata() 133 inode.metadata.gid = metadata.gid; in set_metadata()
|
H A D | vm_dev.rs | 63 let inode = VmInode { in new() localVariable 87 let result = Arc::new(LockedVmInode(SpinLock::new(inode))); in new() 125 let mut inode = self.0.lock(); in set_metadata() localVariable 126 inode.metadata.atime = metadata.atime; in set_metadata() 127 inode.metadata.mtime = metadata.mtime; in set_metadata() 128 inode.metadata.ctime = metadata.ctime; in set_metadata() 129 inode.metadata.mode = metadata.mode; in set_metadata() 130 inode.metadata.uid = metadata.uid; in set_metadata() 131 inode.metadata.gid = metadata.gid; in set_metadata()
|
/DragonOS/kernel/src/driver/keyboard/ |
H A D | ps2_keyboard.rs | 76 let inode = PS2KeyBoardInode { in new() localVariable 98 let result = Arc::new(LockedPS2KeyBoardInode(RwLock::new(inode))); in new() 154 let mut inode = self.0.write(); in set_metadata() localVariable 155 inode.metadata.atime = metadata.atime; in set_metadata() 156 inode.metadata.mtime = metadata.mtime; in set_metadata() 157 inode.metadata.ctime = metadata.ctime; in set_metadata() 158 inode.metadata.mode = metadata.mode; in set_metadata() 159 inode.metadata.uid = metadata.uid; in set_metadata() 160 inode.metadata.gid = metadata.gid; in set_metadata()
|
/DragonOS/docs/kernel/filesystem/ |
H A D | sysfs.md | 77 sys_info: Option<Arc<dyn IndexNode>>, // 总线inode 81   可以看到,每个管理器中均存在sys_info,设备模型通过该成员与sysfs建立联系,sys_info指向sysfs中唯一的inode。对于device而言,对应sysfs下… 100 Ok(inode) => { 101 let _ = sys_bus_init(&inode);
|
/DragonOS/kernel/src/filesystem/kernfs/ |
H A D | mod.rs | 399 let inode = Arc::new(KernFSInode { in new() localVariable 416 let ptr = inode.as_ref() as *const KernFSInode as *mut KernFSInode; in new() 418 (*ptr).self_ref = Arc::downgrade(&inode); in new() 428 *inode.fs.write() = Arc::downgrade(&kernfs); in new() 430 return inode; in new() 568 let inode = children.get(name).ok_or(SystemError::ENOENT)?; in remove() localVariable 569 if inode.children.lock().is_empty() { in remove() 595 let inode = self.inner_create( in add_link() localVariable 604 inode.inner.write().symlink_target = Some(Arc::downgrade(target)); in add_link() 605 inode.inner.write().symlink_target_absolute_path = Some(target_absolute_path); in add_link() [all …]
|
/DragonOS/kernel/src/namespaces/ |
H A D | mnt_namespace.rs | 84 pub fn set_root(&mut self, inode: Arc<dyn IndexNode>) { in set_root() 85 self.root = inode; in set_root() 87 pub fn set_pwd(&mut self, inode: Arc<dyn IndexNode>) { in set_pwd() 88 self.pwd = inode; in set_pwd()
|
/DragonOS/kernel/src/filesystem/overlayfs/ |
H A D | mod.rs | 245 if let Ok(inode) = upper_inode.find(name) { in has_whiteout() 246 if let Some(ovl_inode) = inode.as_any_ref().downcast_ref::<OvlInode>() { in has_whiteout() 403 if let Ok(inode) = upper.find(name) { in find() 404 return Ok(inode); in find() 412 if let Ok(inode) = lower.find(name) { in find() 413 return Ok(inode); in find() 427 if let Some(ref inode) = *upper_inode { in mknod() 428 inode.mknod(filename, mode, dev_t) in mknod()
|
/DragonOS/kernel/src/net/socket/ |
H A D | unix.rs | 89 if let Endpoint::Inode(inode) = endpoint { in connect() 90 self.peer_inode = inode; in connect() 200 if let Endpoint::Inode(inode) = endpoint { in connect() 201 self.peer_inode = inode; in connect()
|