20 lines
516 B
C++
20 lines
516 B
C++
#include "fs/Mount.h"
|
|
|
|
LinkedList<MountInode> g_mounts;
|
|
|
|
Result<SharedPtr<VFS::Inode>> MountInode::create(SharedPtr<VFS::Inode> source, SharedPtr<VFS::FileSystem> fs)
|
|
{
|
|
auto inode = TRY(adopt_shared_if_nonnull(new (std::nothrow) MountInode()));
|
|
|
|
inode->m_source = source;
|
|
inode->m_mountee = fs;
|
|
inode->m_mount_root_inode = fs->root_inode();
|
|
|
|
auto parent = TRY(source->find(".."));
|
|
TRY(fs->set_mount_dir(parent));
|
|
|
|
g_mounts.append(inode.ptr());
|
|
|
|
return (SharedPtr<VFS::Inode>)inode;
|
|
}
|