1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 14:35:07 +00:00

Kernel: Move DiskDevice::block_size() up to BlockDevice

All block devices should have a block size, after all. This defaults to
PAGE_SIZE if no size is specified.
This commit is contained in:
Andreas Kling 2019-08-21 16:45:52 +02:00
parent 52366e3f02
commit 5de483cfbb
11 changed files with 23 additions and 45 deletions

View file

@ -2,14 +2,14 @@
// #define OFFD_DEBUG
NonnullRefPtr<DiskPartition> DiskPartition::create(NonnullRefPtr<DiskDevice> device, unsigned block_offset)
NonnullRefPtr<DiskPartition> DiskPartition::create(DiskDevice& device, unsigned block_offset)
{
return adopt(*new DiskPartition(move(device), block_offset));
return adopt(*new DiskPartition(device, block_offset));
}
DiskPartition::DiskPartition(NonnullRefPtr<DiskDevice> device, unsigned block_offset)
: DiskDevice(100, 0)
, m_device(move(device))
DiskPartition::DiskPartition(DiskDevice& device, unsigned block_offset)
: DiskDevice(100, 0, device.block_size())
, m_device(device)
, m_block_offset(block_offset)
{
}
@ -18,11 +18,6 @@ DiskPartition::~DiskPartition()
{
}
unsigned DiskPartition::block_size() const
{
return m_device->block_size();
}
bool DiskPartition::read_block(unsigned index, u8* out) const
{
#ifdef OFFD_DEBUG