Merge recent update from ch7 && cargo clippy
This commit is contained in:
parent
737340b0a0
commit
c9583b0f53
20 changed files with 236 additions and 163 deletions
|
@ -110,12 +110,13 @@ impl Inode {
|
|||
|
||||
pub fn create(&self, name: &str) -> Option<Arc<Inode>> {
|
||||
let mut fs = self.fs.lock();
|
||||
if self.modify_disk_inode(|root_inode| {
|
||||
let op = |root_inode: &mut DiskInode| {
|
||||
// assert it is a directory
|
||||
assert!(root_inode.is_dir());
|
||||
// has the file been created?
|
||||
self.find_inode_id(name, root_inode)
|
||||
}).is_some() {
|
||||
};
|
||||
if self.modify_disk_inode(op).is_some() {
|
||||
return None;
|
||||
}
|
||||
// create a new file
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue