Add struct Path for VFS

Signed-off-by: Zhenchen Wang <m202372036@hust.edu.cn>
This commit is contained in:
plucky
2024-04-09 09:30:58 +08:00
committed by Tate, Hongliang Tian
parent bc1bf4cb53
commit 6d486c6c01
39 changed files with 561 additions and 447 deletions

View File

@ -63,7 +63,7 @@ pub fn sys_fstatat(
}
let current = current!();
let dentry = {
let path = {
let filename = filename.to_string_lossy();
let fs_path = FsPath::new(dirfd, filename.as_ref())?;
let fs = current.fs().read();
@ -73,7 +73,7 @@ pub fn sys_fstatat(
fs.lookup(&fs_path)?
}
};
let stat = Stat::from(dentry.metadata());
let stat = Stat::from(path.dentry().metadata());
write_val_to_user(stat_buf_ptr, &stat)?;
Ok(SyscallReturn::Return(0))
}