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
Notes: sideshowbarker 2024-07-17 20:16:06 +09:00

View file

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