mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +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:
parent
4ecc695a65
commit
4b2094506b
Notes:
sideshowbarker
2024-07-17 16:41:33 +09:00
Author: https://github.com/Panky-codes
Commit: 4b2094506b
Pull-request: https://github.com/SerenityOS/serenity/pull/13282
Reviewed-by: https://github.com/bgianfo ✅
4 changed files with 7 additions and 7 deletions
|
@ -157,7 +157,7 @@ void NVMeQueue::write(AsyncBlockDeviceRequest& request, u16 nsid, u64 index, u32
|
|||
SpinlockLocker m_lock(m_request_lock);
|
||||
m_current_request = request;
|
||||
|
||||
if (auto result = m_current_request->read_from_buffer(m_current_request->buffer(), m_rw_dma_region->vaddr().as_ptr(), 512 * m_current_request->block_count()); result.is_error()) {
|
||||
if (auto result = m_current_request->read_from_buffer(m_current_request->buffer(), m_rw_dma_region->vaddr().as_ptr(), m_current_request->buffer_size()); result.is_error()) {
|
||||
complete_current_request(AsyncDeviceRequest::MemoryFault);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue