mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 06:48:49 +00:00
Kernel: Make VirtualFileSystem::Mount a top-level class
And move it to its own compilation unit.
This commit is contained in:
parent
79552c91d5
commit
6a27de2d94
Notes:
sideshowbarker
2024-07-18 09:22:05 +09:00
Author: https://github.com/awesomekling
Commit: 6a27de2d94
6 changed files with 109 additions and 62 deletions
|
@ -780,43 +780,6 @@ KResult VirtualFileSystem::rmdir(StringView path, Custody& base)
|
|||
return parent_inode.remove_child(KLexicalPath::basename(path));
|
||||
}
|
||||
|
||||
VirtualFileSystem::Mount::Mount(FileSystem& guest_fs, Custody* host_custody, int flags)
|
||||
: m_guest(guest_fs.root_inode())
|
||||
, m_guest_fs(guest_fs)
|
||||
, m_host_custody(host_custody)
|
||||
, m_flags(flags)
|
||||
{
|
||||
}
|
||||
|
||||
VirtualFileSystem::Mount::Mount(Inode& source, Custody& host_custody, int flags)
|
||||
: m_guest(source)
|
||||
, m_guest_fs(source.fs())
|
||||
, m_host_custody(host_custody)
|
||||
, m_flags(flags)
|
||||
{
|
||||
}
|
||||
|
||||
String VirtualFileSystem::Mount::absolute_path() const
|
||||
{
|
||||
if (!m_host_custody)
|
||||
return "/";
|
||||
return m_host_custody->absolute_path();
|
||||
}
|
||||
|
||||
Inode* VirtualFileSystem::Mount::host()
|
||||
{
|
||||
if (!m_host_custody)
|
||||
return nullptr;
|
||||
return &m_host_custody->inode();
|
||||
}
|
||||
|
||||
const Inode* VirtualFileSystem::Mount::host() const
|
||||
{
|
||||
if (!m_host_custody)
|
||||
return nullptr;
|
||||
return &m_host_custody->inode();
|
||||
}
|
||||
|
||||
void VirtualFileSystem::for_each_mount(Function<void(const Mount&)> callback) const
|
||||
{
|
||||
for (auto& mount : m_mounts) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue