mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:17:44 +00:00
Kernel: Merge unnecessary DiskDevice class into BlockDevice
This commit is contained in:
parent
6be880bd10
commit
88ea152b24
27 changed files with 98 additions and 212 deletions
|
@ -28,13 +28,13 @@
|
|||
|
||||
// #define OFFD_DEBUG
|
||||
|
||||
NonnullRefPtr<DiskPartition> DiskPartition::create(DiskDevice& device, unsigned block_offset, unsigned block_limit)
|
||||
NonnullRefPtr<DiskPartition> DiskPartition::create(BlockDevice& device, unsigned block_offset, unsigned block_limit)
|
||||
{
|
||||
return adopt(*new DiskPartition(device, block_offset, block_limit));
|
||||
}
|
||||
|
||||
DiskPartition::DiskPartition(DiskDevice& device, unsigned block_offset, unsigned block_limit)
|
||||
: DiskDevice(100, 0, device.block_size())
|
||||
DiskPartition::DiskPartition(BlockDevice& device, unsigned block_offset, unsigned block_limit)
|
||||
: BlockDevice(100, 0, device.block_size())
|
||||
, m_device(device)
|
||||
, m_block_offset(block_offset)
|
||||
, m_block_limit(block_limit)
|
||||
|
@ -45,24 +45,6 @@ DiskPartition::~DiskPartition()
|
|||
{
|
||||
}
|
||||
|
||||
bool DiskPartition::read_block(unsigned index, u8* out) const
|
||||
{
|
||||
#ifdef OFFD_DEBUG
|
||||
kprintf("DiskPartition::read_block %u (really: %u)\n", index, m_block_offset + index);
|
||||
#endif
|
||||
|
||||
return m_device->read_block(m_block_offset + index, out);
|
||||
}
|
||||
|
||||
bool DiskPartition::write_block(unsigned index, const u8* data)
|
||||
{
|
||||
#ifdef OFFD_DEBUG
|
||||
kprintf("DiskPartition::write_block %u (really: %u)\n", index, m_block_offset + index);
|
||||
#endif
|
||||
|
||||
return m_device->write_block(m_block_offset + index, data);
|
||||
}
|
||||
|
||||
bool DiskPartition::read_blocks(unsigned index, u16 count, u8* out)
|
||||
{
|
||||
#ifdef OFFD_DEBUG
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue