Please enable JavaScript.
Coggle requires JavaScript to display documents.
libublk-rs refactor - Coggle Diagram
libublk-rs refactor
idears
final goal is to support async/await & for_incoming_ios
1st step is to kill UblkQueueImpl, instead of switching to closure
Iterator
next()
block in io_uring_enter() if nothing needs handling
otherwise return one UblkCQE one by one from cached vector
Item: &UblkCQE
should be mutable UblkIO
add completion method to UblkIO
lazy SQE pushing
we can't pass UblkQueue to closure
need new parameter of QueueCtx for get_iod()
UblkIO.get_iod(QueueCtx)
how to handle termination?
pass blktests tests first
re-use blktests for verification
replace miniublk with rublk in blktests
how to integrate blktests into rublk project?
requirements
support event
use eventfd to wakeup queue daemon for completing IO
event mod
UblkEvent Struture
hold one queue reference in this structure
for fetching iod
not doable, queue is mutable in daemon context
abstract one readonly CmdBuf Structure which can be shared among pthreads
shared in queue daemon & target io handler
need to be Arc
Arc<Mutex<>>
fields
event fd
out_queue
in_queue
handling IOs from multiple queues/devices
async/await support
target handling can be done by async functions
move IO handling into closure first
other per-queue structures can be captured in this closure
remove UblkQueueImpl trait first
is it doable?
convert tests first
knowledge
closure
questions
how to understand "Closures are represented by traits"
cost of passing closure
advantages
can capture variables in context
easy to share data between closure and other contexts
easier to support target with AIO
support async