MCPcopy Create free account
hub / github.com/Bananymous/banan-os / mount

Method mount

kernel/kernel/FS/VirtualFileSystem.cpp:191–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189 }
190
191 BAN::ErrorOr<void> VirtualFileSystem::mount(const Credentials& credentials, BAN::StringView block_device_path, BAN::StringView target)
192 {
193 // TODO: allow custom root
194 auto block_device_file = TRY(file_from_absolute_path(root_inode(), credentials, block_device_path, true));
195 if (!block_device_file.inode->is_device())
196 return BAN::Error::from_errno(ENOTBLK);
197
198 auto* device = static_cast<Device*>(block_device_file.inode.ptr());
199 if (!device->mode().ifblk())
200 return BAN::Error::from_errno(ENOTBLK);
201
202 auto file_system = TRY(FileSystem::from_block_device(static_cast<BlockDevice*>(device)));
203 return mount(credentials, file_system, target);
204 }
205
206 BAN::ErrorOr<void> VirtualFileSystem::mount(const Credentials& credentials, BAN::RefPtr<FileSystem> file_system, BAN::StringView path)
207 {

Callers 1

initializeMethod · 0.80

Calls 6

is_deviceMethod · 0.80
ifblkMethod · 0.80
modeMethod · 0.80
ifdirMethod · 0.80
ptrMethod · 0.45
emplace_backMethod · 0.45

Tested by

no test coverage detected