mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-26 19:03:27 +00:00
Extract dentry.rs and mount.rs to path module, rename Dentry and DentryMnt and check usage of pub.
Signed-off-by: Zhenchen Wang <m202372036@hust.edu.cn>
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
8d18a12385
commit
8bcadee540
@ -34,7 +34,7 @@ pub fn sys_truncate(path_ptr: Vaddr, len: isize) -> Result<SyscallReturn> {
|
||||
check_length(len)?;
|
||||
|
||||
let current = current!();
|
||||
let dir_dentrymnt = {
|
||||
let dir_dentry = {
|
||||
let path = path.to_string_lossy();
|
||||
if path.is_empty() {
|
||||
return_errno_with_message!(Errno::ENOENT, "path is empty");
|
||||
@ -42,7 +42,7 @@ pub fn sys_truncate(path_ptr: Vaddr, len: isize) -> Result<SyscallReturn> {
|
||||
let fs_path = FsPath::new(AT_FDCWD, path.as_ref())?;
|
||||
current.fs().read().lookup(&fs_path)?
|
||||
};
|
||||
dir_dentrymnt.resize(len as usize)?;
|
||||
dir_dentry.resize(len as usize)?;
|
||||
Ok(SyscallReturn::Return(0))
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user