diff --git a/rcore-fs-sfs/src/lib.rs b/rcore-fs-sfs/src/lib.rs index b007c40..bb7b0fa 100644 --- a/rcore-fs-sfs/src/lib.rs +++ b/rcore-fs-sfs/src/lib.rs @@ -388,14 +388,14 @@ impl vfs::INode for INodeImpl { let device_inodes = self.fs.device_inodes.read(); let device_inode = device_inodes.get(&self.device_inode_id); match device_inode { - Some(device) => device.read().read_at(offset, buf), + Some(device) => device.read_at(offset, buf), None => Err(FsError::DeviceError) } }, _ => Err(FsError::NotFile) } } - fn write_at(&mut self, offset: usize, buf: &[u8]) -> vfs::Result { + fn write_at(&self, offset: usize, buf: &[u8]) -> vfs::Result { let DiskINode { type_, size, .. } = **self.disk_inode.read(); match type_ { FileType::File | FileType::SymLink => { @@ -409,7 +409,7 @@ impl vfs::INode for INodeImpl { let device_inodes = self.fs.device_inodes.write(); let device_inode = device_inodes.get(&self.device_inode_id); match device_inode { - Some(device) => device.write().write_at(offset, buf), + Some(device) => device.write_at(offset, buf), None => Err(FsError::DeviceError) } }, @@ -696,7 +696,7 @@ pub struct SimpleFileSystem { /// Pointer to self, used by INodes self_ptr: Weak, /// device inode - device_inodes: RwLock>>> + device_inodes: RwLock>> } impl SimpleFileSystem { diff --git a/rcore-fs/Cargo.toml b/rcore-fs/Cargo.toml index 1b47bb5..58dbe8a 100644 --- a/rcore-fs/Cargo.toml +++ b/rcore-fs/Cargo.toml @@ -7,5 +7,8 @@ edition = "2018" [dev-dependencies] tempfile = "3" +[dependencies] +spin = "0.4" + [features] std = [] \ No newline at end of file