Kernel: Inode/Device detection is done with overridden bool functions

This commit is contained in:
Bananymous
2023-06-03 13:28:15 +03:00
parent 402ad85583
commit 9228df0f23
6 changed files with 7 additions and 26 deletions

View File

@@ -41,11 +41,11 @@ namespace Kernel
BAN::ErrorOr<void> VirtualFileSystem::mount(BAN::StringView partition, BAN::StringView target)
{
auto partition_file = TRY(file_from_absolute_path(partition, true));
if (partition_file.inode->inode_type() != Inode::InodeType::Device)
if (!partition_file.inode->is_device())
return BAN::Error::from_errno(ENOTBLK);
Device* device = (Device*)partition_file.inode.ptr();
if (device->device_type() != Device::DeviceType::BlockDevice)
if (!device->is_partition())
return BAN::Error::from_errno(ENOTBLK);
auto* file_system = TRY(Ext2FS::create(*(Partition*)device));