mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:07:44 +00:00
Kernel: Remove hardcoded values for block size in Ramdisk
Instead of using the hardcoded 512 in Ramdisk, retrieve the block size value from the AsyncBlockDeviceRequest struct.
This commit is contained in:
parent
2786a71bc0
commit
6d3a7fabeb
1 changed files with 2 additions and 2 deletions
|
@ -45,8 +45,8 @@ void RamdiskDevice::start_request(AsyncBlockDeviceRequest& request)
|
|||
|
||||
u8* base = m_region->vaddr().as_ptr();
|
||||
size_t size = m_region->size();
|
||||
u8* offset = base + request.block_index() * 512;
|
||||
size_t length = request.block_count() * 512;
|
||||
u8* offset = base + request.block_index() * request.block_size();
|
||||
size_t length = request.buffer_size();
|
||||
|
||||
if ((offset + length > base + size) || (offset + length < base)) {
|
||||
request.complete(AsyncDeviceRequest::Failure);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue