Lines Matching refs:inode
174 let mut inode = self.0.lock(); in truncate() localVariable
177 if inode.metadata.file_type == FileType::Dir { in truncate()
182 if inode.data.len() > len { in truncate()
183 inode.data.resize(len, 0); in truncate()
211 let inode: SpinLockGuard<RamFSInode> = self.0.lock(); in read_at() localVariable
214 if inode.metadata.file_type == FileType::Dir { in read_at()
218 let start = inode.data.len().min(offset); in read_at()
219 let end = inode.data.len().min(offset + len); in read_at()
227 let src = &inode.data[start..end]; in read_at()
244 let mut inode: SpinLockGuard<RamFSInode> = self.0.lock(); in write_at() localVariable
247 if inode.metadata.file_type == FileType::Dir { in write_at()
251 let data: &mut Vec<u8> = &mut inode.data; in write_at()
272 let inode = self.0.lock(); in metadata() localVariable
273 let mut metadata = inode.metadata.clone(); in metadata()
274 metadata.size = inode.data.len() as i64; in metadata()
280 let mut inode = self.0.lock(); in set_metadata() localVariable
281 inode.metadata.atime = metadata.atime; in set_metadata()
282 inode.metadata.mtime = metadata.mtime; in set_metadata()
283 inode.metadata.ctime = metadata.ctime; in set_metadata()
284 inode.metadata.mode = metadata.mode; in set_metadata()
285 inode.metadata.uid = metadata.uid; in set_metadata()
286 inode.metadata.gid = metadata.gid; in set_metadata()
292 let mut inode = self.0.lock(); in resize() localVariable
293 if inode.metadata.file_type == FileType::File { in resize()
294 inode.data.resize(len, 0); in resize()
310 let mut inode = self.0.lock(); in create_with_data() localVariable
312 if inode.metadata.file_type != FileType::Dir { in create_with_data()
316 if inode.children.contains_key(&name) { in create_with_data()
322 parent: inode.self_ref.clone(), in create_with_data()
342 fs: inode.fs.clone(), in create_with_data()
351 inode.children.insert(name, result.clone()); in create_with_data()
361 let mut inode: SpinLockGuard<RamFSInode> = self.0.lock(); in link() localVariable
365 if inode.metadata.file_type != FileType::Dir { in link()
375 if inode.children.contains_key(&name) { in link()
379 inode in link()
389 let mut inode: SpinLockGuard<RamFSInode> = self.0.lock(); in unlink() localVariable
391 if inode.metadata.file_type != FileType::Dir { in unlink()
401 let to_delete = inode.children.get(&name).ok_or(SystemError::ENOENT)?; in unlink()
408 inode.children.remove(&name); in unlink()
414 let mut inode: SpinLockGuard<RamFSInode> = self.0.lock(); in rmdir() localVariable
416 if inode.metadata.file_type != FileType::Dir { in rmdir()
420 let to_delete = inode.children.get(&name).ok_or(SystemError::ENOENT)?; in rmdir()
427 inode.children.remove(&name); in rmdir()
479 let inode = self.0.lock(); in find() localVariable
481 if inode.metadata.file_type != FileType::Dir { in find()
487 return Ok(inode.self_ref.upgrade().ok_or(SystemError::ENOENT)?); in find()
491 return Ok(inode.parent.upgrade().ok_or(SystemError::ENOENT)?); in find()
496 return Ok(inode in find()
506 let inode: SpinLockGuard<RamFSInode> = self.0.lock(); in get_entry_name() localVariable
507 if inode.metadata.file_type != FileType::Dir { in get_entry_name()
521 let mut key: Vec<String> = inode in get_entry_name()
536 …node_id={inode_id:?}, to find={to_find:?}", key_len=key.len(), inode_id = inode.metadata.inode_id,… in get_entry_name()
570 let mut inode = self.0.lock(); in mknod() localVariable
571 if inode.metadata.file_type != FileType::Dir { in mknod()
584 parent: inode.self_ref.clone(), in mknod()
604 fs: inode.fs.clone(), in mknod()
625 inode.children.insert(filename, nod.clone()); in mknod()