Home
last modified time | relevance | path

Searched refs:fs (Results 1 – 25 of 69) sorted by relevance

123

/DragonOS/kernel/src/filesystem/fat/
H A Dentry.rs17 fs::{Cluster, FATFileSystem, MAX_FILE_SIZE},
83 fs: &Arc<FATFileSystem>, in read()
92 let start_cluster_number: u64 = offset / fs.bytes_per_cluster(); in read()
95 fs.get_cluster_by_relative(self.first_cluster, start_cluster_number as usize) in read()
105 let mut in_cluster_offset: u64 = offset % fs.bytes_per_cluster(); in read()
113 if in_cluster_offset >= fs.bytes_per_cluster() { in read()
114 if let Ok(FATEntry::Next(c)) = fs.get_fat_entry(current_cluster) { in read()
116 in_cluster_offset %= fs.bytes_per_cluster(); in read()
126 (fs.bytes_per_cluster() - in_cluster_offset) as usize, in read()
132 let offset = fs.cluster_bytes_offset(current_cluster) + in_cluster_offset; in read()
[all …]
H A Dfs.rs116 fs: Weak<FATFileSystem>, field
140 self.metadata.size = d.size(&self.fs.upgrade().unwrap().clone()) as i64; in update_metadata()
160 d.find_entry(name, None, None, self.fs.upgrade().unwrap())?; in find()
165 self.fs.upgrade().unwrap(), in find()
176 self.fs in find()
189 fs: Arc<FATFileSystem>, in new()
203 fs: Arc::downgrade(&fs), in new()
209 blk_size: fs.bpb.bytes_per_sector as usize, in new()
210 blocks: if let FATType::FAT32(_) = fs.bpb.fat_type { in new()
211 fs.bpb.total_sectors_32 as usize in new()
[all …]
H A Dmod.rs3 pub mod fs; module
/DragonOS/user/apps/test-symlink/src/
H A Dmain.rs5 use std::fs;
6 use std::os::unix::fs::symlink;
16 fs::write(target, "This is the content of the target file.") in main()
18 fs::create_dir(dir).expect("Failed to create target dir"); in main()
27 let symlink_content = fs::read_link(symlink_path).expect("Failed to read symlink"); in main()
34 fs::remove_file(symlink_path).expect("Failed to remove symlink"); in main()
35 fs::remove_file(target).expect("Failed to remove target file"); in main()
36 fs::remove_dir(dir).expect("Failed to remove test_dir"); in main()
49 let dir = fs::create_dir_all(path); in mount_test_ramfs()
/DragonOS/kernel/src/filesystem/devfs/
H A Dnull_dev.rs25 fs: Weak<DevFS>, field
38 fs: Weak::default(), in new()
65 fn set_fs(&self, fs: Weak<DevFS>) { in set_fs()
66 self.0.lock().fs = fs; in set_fs()
91 fn fs(&self) -> Arc<dyn FileSystem> { in fs() method
92 return self.0.lock().fs.upgrade().unwrap(); in fs()
H A Dzero_dev.rs25 fs: Weak<DevFS>, field
38 fs: Weak::default(), in new()
65 fn set_fs(&self, fs: Weak<DevFS>) { in set_fs()
66 self.0.lock().fs = fs; in set_fs()
91 fn fs(&self) -> Arc<dyn FileSystem> { in fs() method
92 return self.0.lock().fs.upgrade().unwrap(); in fs()
H A Dmod.rs87 root_guard.fs = Arc::downgrade(&devfs); in new()
155 device.set_fs(dev_char_inode.0.lock().fs.clone()); in register_device()
173 device.set_fs(dev_block_inode.0.lock().fs.clone()); in register_device()
251 fs: Weak<DevFS>, field
289 fs: Weak::default(), in new_with_parent()
380 fs: guard.fs.clone(), in do_create_with_data()
448 fn fs(&self) -> Arc<dyn FileSystem> { in fs() method
449 return self.0.lock().fs.upgrade().unwrap(); in fs()
574 fn set_fs(&self, fs: Weak<DevFS>); in set_fs()
592 let binding = devfs_inode.fs();
/DragonOS/user/apps/test-chown/src/
H A Dmain.rs9 fs::{self, metadata, File},
12 fs::{MetadataExt, PermissionsExt},
19 let metadata = std::fs::metadata(filename)?; in print_file_owner_group()
96 std::os::unix::fs::symlink(filename, symlink_name)?; in main()
115 std::fs::remove_file(filename)?; in main()
126 let dir = fs::create_dir_all(path); in mount_test_ramfs()
156 let _ = fs::remove_dir(path); in umount_test_ramfs()
/DragonOS/kernel/src/filesystem/devpts/
H A Dmod.rs101 fs: Weak::new(), in new()
123 pub fn set_fs(&self, fs: Weak<DevPtsFs>) { in set_fs()
124 self.inner.lock().fs = fs; in set_fs()
130 fs: Weak<DevPtsFs>, field
186 fn fs(&self) -> alloc::sync::Arc<dyn super::vfs::FileSystem> { in fs() method
187 self.inner.lock().fs.upgrade().unwrap() in fs()
233 let fs = guard.fs.upgrade().unwrap(); in create_with_data() localVariable
253 fs.pts_count.fetch_add(1, Ordering::SeqCst); in create_with_data()
/DragonOS/kernel/src/virt/kvm/
H A Dkvm_dev.rs44 fs: Weak<DevFS>, field
56 fs: Weak::default(), in new()
83 fn set_fs(&self, fs: Weak<DevFS>) { in set_fs()
84 self.0.lock().fs = fs; in set_fs()
110 fn fs(&self) -> Arc<dyn FileSystem> { in fs() method
111 return self.0.lock().fs.upgrade().unwrap(); in fs()
H A Dvcpu_dev.rs54 fs: Weak<DevFS>, field
67 fs: Weak::default(), in new()
118 fn fs(&self) -> Arc<dyn FileSystem> { in fs() method
119 return self.0.lock().fs.upgrade().unwrap(); in fs()
H A Dvm_dev.rs52 fs: Weak<DevFS>, field
65 fs: Weak::default(), in new()
116 fn fs(&self) -> Arc<dyn FileSystem> { in fs() method
117 return self.0.lock().fs.upgrade().unwrap(); in fs()
/DragonOS/user/apps/test_socket/src/
H A Dtest_unix_stream.rs4 use std::{fs, str};
20 fs::remove_file(&SOCKET_PATH).ok(); in test_unix_stream()
35 fs::remove_file(&SOCKET_PATH).ok(); in test_unix_stream()
/DragonOS/user/apps/test-mount/src/
H A Dmain.rs4 use std::fs;
10 let dir = fs::create_dir_all(path); in main()
22 let dir = fs::create_dir_all(path); in main()
/DragonOS/build-scripts/kernel_build/src/kconfig/
H A Dmod.rs1 use std::{fs, io::Write, path::PathBuf};
13 if fs::metadata("kernel.config").is_ok() { in build()
47 let mut file = fs::File::create("D.config").expect("Failed to create file: D.config"); in make_compile_cfg()
68 fs::read_to_string(&d_config_path).expect(&format!("Failed to read {}", d_config_str)); in dfs()
88 fs::read_to_string("kernel.config").expect("Failed to read kernel.config."); in parse_kernel_config()
108 fs::read_to_string(d_config).expect(&format!("Failed to read {}", path_str)); in parse_d_config()
/DragonOS/kernel/src/driver/keyboard/
H A Dps2_keyboard.rs69 fs: Weak<DevFS>, field
79 fs: Weak::default(), in new()
106 fn set_fs(&self, fs: Weak<DevFS>) { in set_fs()
107 self.0.write().fs = fs; in set_fs()
165 fn fs(&self) -> alloc::sync::Arc<dyn FileSystem> { in fs() method
166 return self.0.read().fs.upgrade().unwrap(); in fs()
/DragonOS/kernel/src/namespaces/
H A Dnamespace.rs104 fs: current.fs_struct(), in prepare_nsset()
113 let fs = current.fs_struct(); in commit_nsset() localVariable
114 let nsset_fs = nsset.fs.lock(); in commit_nsset()
115 fs.lock().set_pwd(nsset_fs.pwd.clone()); in commit_nsset()
116 fs.lock().set_root(nsset_fs.root.clone()); in commit_nsset()
/DragonOS/kernel/src/filesystem/vfs/
H A Dcore.rs11 fat::fs::FATFileSystem,
313 pub fn do_mount(fs: Arc<dyn FileSystem>, mount_point: &str) -> Result<Arc<MountFS>, SystemError> { in do_mount()
326 return inode.mount(fs); in do_mount()
344 fs: Arc<dyn FileSystem>, in do_mount_mkdir()
357 return inode.mount(fs); in do_mount_mkdir()
386 if let Some(fs) = MOUNT_LIST().remove(path) { in do_umount2()
388 fs.umount()?; in do_umount2()
389 return Ok(fs); in do_umount2()
/DragonOS/kernel/src/arch/x86_64/process/
H A Dmod.rs74 fs: SegmentSelector, field
112 fs: KERNEL_DS, in new()
252 fs: self.fs, in clone_all()
335 new_arch_guard.fs = current_arch_guard.fs; in copy_thread()
497 off_fs = const(offset_of!(ArchPCBInfo, fs)), in switch_to_inner()
532 arch_guard.fs = USER_DS; in arch_switch_to_user()
539 SegmentSelector::from_bits_truncate(arch_guard.fs.bits()), in arch_switch_to_user()
H A Dtable.rs28 pub unsafe fn switch_fs_and_gs(fs: SegmentSelector, gs: SegmentSelector) { in switch_fs_and_gs()
29 x86::segmentation::load_fs(fs); in switch_fs_and_gs()
/DragonOS/kernel/src/filesystem/kernfs/
H A Dmod.rs71 let fs = Arc::new(Self { in new() localVariable
82 *root_inode.fs.write() = Arc::downgrade(&fs); in new()
83 return fs; in new()
112 fs: RwLock::new(Weak::new()), in create_root_inode()
127 fs: RwLock<Weak<KernFS>>, field
297 fn fs(&self) -> Arc<dyn FileSystem> { in fs() method
298 return self.fs.read().upgrade().unwrap(); in fs()
408 fs: RwLock::new(Weak::new()), in new()
425 .fs() in new()
428 *inode.fs.write() = Arc::downgrade(&kernfs); in new()
/DragonOS/kernel/src/filesystem/ramfs/
H A Dmod.rs66 fs: Weak<RamFS>, field
96 fs: Weak::default(), in new()
149 root_guard.fs = Arc::downgrade(&result); in new()
159 let fs = RamFS::new(); in make_ramfs() localVariable
160 return Ok(fs); in make_ramfs()
263 fn fs(&self) -> Arc<dyn FileSystem> { in fs() method
264 return self.0.lock().fs.upgrade().unwrap(); in fs()
342 fs: inode.fs.clone(), in create_with_data()
604 fs: inode.fs.clone(), in mknod()
/DragonOS/user/apps/user-manage/src/check/
H A Dcheck.rs8 fs,
106 let r = fs::read_to_string("/etc/group"); in check_group_gid()
217 match std::fs::read_to_string("/etc/passwd") { in home()
299 if fs::File::open(home).is_ok() { in check_home()
447 let r = fs::read_to_string("/etc/passwd"); in cur_username()
476 let r = fs::read_to_string("/etc/shadow"); in check_password()
587 let r = fs::read_to_string("/etc/passwd"); in is_main_group()
645 let r = fs::read_to_string("/etc/group"); in check_group_file()
709 match fs::read_to_string("/etc/passwd") { in scan_passwd()
790 match fs::read_to_string("/etc/group") { in scan_group()
[all …]
/DragonOS/kernel/src/filesystem/procfs/
H A Dmod.rs125 fs: Weak<ProcFS>, field
346 fs: Weak::default(), in new()
363 root_guard.fs = Arc::downgrade(&result); in new()
555 fn fs(&self) -> Arc<dyn FileSystem> { in fs() method
556 return self.0.lock().fs.upgrade().unwrap(); in fs()
634 fs: inode.fs.clone(), in create_with_data()
812 let fs = procfs_inode.fs(); in procfs_register_pid() localVariable
813 let procfs: &ProcFS = fs.as_any_ref().downcast_ref::<ProcFS>().unwrap(); in procfs_register_pid()
829 let fs: Arc<dyn FileSystem> = procfs_inode.fs(); in procfs_unregister_pid() localVariable
830 let procfs: &ProcFS = fs.as_any_ref().downcast_ref::<ProcFS>().unwrap(); in procfs_unregister_pid()
/DragonOS/kernel/src/arch/x86_64/asm/
H A Dapu_boot.S19 mov %ax, %fs
65 mov %ax, %fs

123