mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-20 05:56:32 +00:00
实现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:
@ -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);
|
||||
|
Reference in New Issue
Block a user