实现free指令+修复 mountfs的内存泄露问题(#394)

* 实现meminfo文件

* 成功实现free指令,添加了一些string有关函数,并进行一些无影响的小改动


* 解决内存泄露的问题:mountfs inode的wrap方法使用了Arc::into_raw而没有from_raw,导致inode始终无法释放

---------

Co-authored-by: LoGin <longjin@DragonOS.org>
Co-authored-by: longjin <longjin@RinGoTek.cn>
This commit is contained in:
yuyi2439
2023-10-08 14:26:17 +08:00
committed by GitHub
parent afc95d5c25
commit 34e6d6c80f
16 changed files with 401 additions and 89 deletions

View File

@ -417,9 +417,9 @@ impl Syscall {
Err(SystemError::EINVAL)
} else {
let path: &str = path.unwrap();
let flags = args[1];
let open_flags: FileMode = FileMode::from_bits_truncate(flags as u32);
Self::open(path, open_flags)
};
@ -427,7 +427,10 @@ impl Syscall {
}
SYS_CLOSE => {
let fd = args[0];
Self::close(fd)
let res = Self::close(fd);
res
}
SYS_READ => {
let fd = args[0] as i32;
@ -545,6 +548,7 @@ impl Syscall {
SYS_GET_DENTS => {
let fd = args[0] as i32;
let buf_vaddr = args[1];
let len = args[2];
let virt_addr: VirtAddr = VirtAddr::new(buf_vaddr);