Add support for truncate syscall

This commit is contained in:
LI Qing
2024-01-05 14:44:19 +08:00
committed by Tate, Hongliang Tian
parent 31998d1cd4
commit 195c6a0739
19 changed files with 167 additions and 44 deletions

View File

@ -410,9 +410,14 @@ impl Dentry {
self.inode.set_mode(mode)
}
/// Get the inode length
pub fn inode_len(&self) -> usize {
self.inode.len()
/// Gets the size of the inode
pub fn inode_size(&self) -> usize {
self.inode.size()
}
/// Sets the size of the inode
pub fn set_inode_size(&self, new_size: usize) -> Result<()> {
self.inode.resize(new_size)
}
/// Get the access timestamp