Kernel: Merge unnecessary DiskDevice class into BlockDevice

This commit is contained in:
Andreas Kling 2020-02-08 02:17:26 +01:00
parent 6be880bd10
commit 88ea152b24
Notes: sideshowbarker 2024-07-19 09:32:16 +09:00
27 changed files with 98 additions and 212 deletions

View file

@ -58,13 +58,13 @@ static u8 to_ext2_file_type(mode_t mode)
return EXT2_FT_UNKNOWN;
}
NonnullRefPtr<Ext2FS> Ext2FS::create(NonnullRefPtr<DiskDevice> device)
NonnullRefPtr<Ext2FS> Ext2FS::create(BlockDevice& device)
{
return adopt(*new Ext2FS(move(device)));
return adopt(*new Ext2FS(device));
}
Ext2FS::Ext2FS(NonnullRefPtr<DiskDevice>&& device)
: DiskBackedFS(move(device))
Ext2FS::Ext2FS(BlockDevice& device)
: DiskBackedFS(device)
{
}
@ -90,7 +90,7 @@ const ext2_group_desc& Ext2FS::group_descriptor(GroupIndex group_index) const
bool Ext2FS::initialize()
{
LOCKER(m_lock);
bool success = const_cast<DiskDevice&>(device()).read_blocks(2, 1, (u8*)&m_super_block);
bool success = const_cast<BlockDevice&>(device()).read_blocks(2, 1, (u8*)&m_super_block);
ASSERT(success);
auto& super_block = this->super_block();