diff options
author | Alexis211 <alexis211@gmail.com> | 2009-12-22 15:03:48 +0100 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2009-12-22 15:03:48 +0100 |
commit | 2c23da1cf398aef420130dde1b86e4c474e3cacb (patch) | |
tree | 33f31cf7459fe017c35a313c88e4bfcb6f00eb8a /Source/Kernel/Shell/KernelShell-sys.class.cpp | |
parent | 98decfffefc49c82f20a0453cef823f7588e7654 (diff) | |
parent | 837290db7d39c8cd852541cb345dc5a57c9274ce (diff) | |
download | Melon-2c23da1cf398aef420130dde1b86e4c474e3cacb.tar.gz Melon-2c23da1cf398aef420130dde1b86e4c474e3cacb.zip |
Merge branch 'master' into framework
Conflicts:
Melon.img
Diffstat (limited to 'Source/Kernel/Shell/KernelShell-sys.class.cpp')
-rw-r--r-- | Source/Kernel/Shell/KernelShell-sys.class.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Source/Kernel/Shell/KernelShell-sys.class.cpp b/Source/Kernel/Shell/KernelShell-sys.class.cpp index 85ba207..b1ab274 100644 --- a/Source/Kernel/Shell/KernelShell-sys.class.cpp +++ b/Source/Kernel/Shell/KernelShell-sys.class.cpp @@ -81,6 +81,28 @@ void KernelShell::mount(Vector<String>& args) { } } +void KernelShell::unmount(Vector<String>& args) { + if (args.size() == 2) { + FSNode* n = VFS::find(args[1], m_cwd); + bool ok = false; + if (n == 0) { + ok = false; + } else { + String p = VFS::path(n); + for (u32int i = 0; i < VFS::filesystems.size(); i++) { + if (VFS::path(VFS::filesystems[i]->getRootNode()) == p) { + ok = VFS::unmount(VFS::filesystems[i]); + break; + } + } + } + if (ok) *m_vt << "Ok, filesystem unmounted.\n"; + else *m_vt << "Error.\n"; + } else { + *m_vt << "Usage: unmount <mountpoint>\n"; + } +} + void KernelShell::readblock(Vector<String>& args) { if (args.size() == 3) { Vector<Device*> devcs = Dev::findDevices("block"); |