Skip to content

Commit 11b1224

Browse files
author
lind
committed
removed decrementing refcount for cwd
1 parent f131ebc commit 11b1224

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

src/safeposix/filesystem.rs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -636,22 +636,3 @@ pub fn incref_root() {
636636
panic!("Root directory inode was not a directory");
637637
}
638638
}
639-
640-
pub fn decref_dir(cwd_container: &interface::RustPathBuf) {
641-
if let Some(cwdinodenum) = metawalk(&cwd_container) {
642-
if let Inode::Dir(ref mut cwddir) = *(FS_METADATA.inodetable.get_mut(&cwdinodenum).unwrap())
643-
{
644-
cwddir.refcount -= 1;
645-
646-
//if the directory has been removed but this cwd was the last open handle to it
647-
if cwddir.refcount == 0 && cwddir.linkcount == 0 {
648-
FS_METADATA.inodetable.remove(&cwdinodenum);
649-
}
650-
} else {
651-
panic!("Cage had a cwd that was not a directory!");
652-
}
653-
} else {
654-
panic!("Cage had a cwd which did not exist!");
655-
} //we probably want to handle this case, maybe cwd should be an inode
656-
// number?? Not urgent
657-
}

0 commit comments

Comments
 (0)