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

Kernel: Fix index calculation in NVMeQueue submit_sync_sqe function

There was a bug while calculating the next index in submit_sync_sqe
function. Use the NVMeQueue's class variable m_qdepth instead of the
hardcoded IO_QUEUE_SIZE.
This commit is contained in:
Pankaj Raghav 2022-01-25 21:58:00 +05:30 committed by Idan Horowitz
parent 67ce9e28a5
commit 4a8a3df975

View file

@ -123,7 +123,7 @@ u16 NVMeQueue::submit_sync_sqe(NVMeSubmission& sub)
SpinlockLocker lock(m_cq_lock); SpinlockLocker lock(m_cq_lock);
index = m_cq_head - 1; index = m_cq_head - 1;
if (index < 0) if (index < 0)
index = IO_QUEUE_SIZE - 1; index = m_qdepth - 1;
} }
cqe_cid = m_cqe_array[index].command_id; cqe_cid = m_cqe_array[index].command_id;
Scheduler::yield(); Scheduler::yield();