mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:47:35 +00:00
Kernel: Refactor storage stack with u64 as number of blocks
This commit is contained in:
parent
aeef14ae28
commit
9a3aa7eb0b
10 changed files with 26 additions and 38 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue