1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 20:18:12 +00:00

Kernel: Use buffer_size from AsyncBlockDevice struct

The underlying driver does not need to recalculate the buffer size as
it is passed in the AsyncBlockDevice struct anyway. This also helps in
removing any assumptions of the underlying block size of the device.
This commit is contained in:
Pankaj Raghav 2022-03-26 18:39:47 +01:00 committed by Brian Gianforcaro
parent 4ecc695a65
commit 4b2094506b
4 changed files with 7 additions and 7 deletions

View file

@ -43,7 +43,7 @@ void NVMeInterruptQueue::complete_current_request(u16 status)
return;
}
if (current_request->request_type() == AsyncBlockDeviceRequest::RequestType::Read) {
if (auto result = current_request->write_to_buffer(current_request->buffer(), m_rw_dma_region->vaddr().as_ptr(), 512 * current_request->block_count()); result.is_error()) {
if (auto result = current_request->write_to_buffer(current_request->buffer(), m_rw_dma_region->vaddr().as_ptr(), current_request->buffer_size()); result.is_error()) {
lock.unlock();
current_request->complete(AsyncDeviceRequest::MemoryFault);
return;