| 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 | { |
no test coverage detected