forked from AbleOS/ableos
NOT ONE, but TWO deadlocks fixed!
This commit is contained in:
parent
70342c5f46
commit
960da43383
|
@ -39,8 +39,8 @@ where
|
|||
|
||||
pub fn init() -> Result<()> {
|
||||
let mut state = KERNEL_STATE.lock();
|
||||
let mut vfs = VFS.lock();
|
||||
let fs = load_fs()?;
|
||||
let mut vfs = VFS.lock();
|
||||
vfs.init(fs.root_node());
|
||||
state.add_storage_device(fs);
|
||||
Ok(())
|
||||
|
@ -56,9 +56,12 @@ fn load_fs() -> Result<Ext2StorageDevice<Size1024, Vec<u8>>> {
|
|||
pub fn walk<S: Into<String>>(dir: Arc<FsNode>, path: S) {
|
||||
let path = path.into();
|
||||
if let Some(dir) = dir.directory() {
|
||||
let mut vfs = VFS.lock();
|
||||
for entry in dir {
|
||||
let fs_node = vfs.fs_node(entry.node()).unwrap();
|
||||
let fs_node = {
|
||||
let mut vfs = VFS.lock();
|
||||
vfs.fs_node(entry.node()).unwrap()
|
||||
};
|
||||
|
||||
println!("{}/{} => {}", path, entry.name(), fs_node.inode());
|
||||
trace!("{entry:#?}");
|
||||
if entry.name() != "." && entry.name() != ".." {
|
||||
|
|
|
@ -10,14 +10,13 @@ use crate::devices::pci::brute_force_scan;
|
|||
use crate::filesystem::vfs::VFS;
|
||||
use crate::systeminfo::{KERNEL_VERSION, RELEASE_TYPE};
|
||||
use crate::time::fetch_time;
|
||||
use crate::KERNEL_STATE;
|
||||
use crate::{filesystem, KERNEL_STATE};
|
||||
use crate::{
|
||||
arch::shutdown,
|
||||
rhai_shell::KEYBUFF,
|
||||
vterm::VTerm,
|
||||
// wasm_jumploader::run_program,
|
||||
};
|
||||
use crate::{filesystem, KERNEL_STATE};
|
||||
|
||||
use acpi::{AcpiTables, PlatformInfo};
|
||||
use cpuio::{inb, outb};
|
||||
|
|
Loading…
Reference in a new issue