1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:27:44 +00:00

Kernel: Refactor storage stack with u64 as number of blocks

This commit is contained in:
Jean-Baptiste Boric 2021-03-16 20:23:16 +01:00 committed by Andreas Kling
parent aeef14ae28
commit 9a3aa7eb0b
10 changed files with 26 additions and 38 deletions

View file

@ -38,10 +38,10 @@ NonnullRefPtr<RamdiskDevice> RamdiskDevice::create(const RamdiskController& cont
}
RamdiskDevice::RamdiskDevice(const RamdiskController& controller, OwnPtr<Region>&& region, int major, int minor)
: StorageDevice(controller, major, minor, 512, 0)
: StorageDevice(controller, major, minor, 512, m_region->size() / 512)
, m_region(move(region))
{
dmesgln("Ramdisk: Device #{} @ {}, length {}", minor, m_region->vaddr(), m_region->size());
dmesgln("Ramdisk: Device #{} @ {}, Capacity={}", minor, m_region->vaddr(), max_addressable_block() * 512);
}
RamdiskDevice::~RamdiskDevice()
@ -53,11 +53,6 @@ const char* RamdiskDevice::class_name() const
return "RamdiskDevice";
}
size_t RamdiskDevice::max_addressable_block() const
{
return m_region->size() / 512;
}
void RamdiskDevice::start_request(AsyncBlockDeviceRequest& request)
{
LOCKER(m_lock);