/// send reset IO to the underlying children.
send reset IO to the underlying children.
send reset IO to the underlying children .
pub(crate) fn reset(
        &self,
        pio: *mut spdk_bdev_io,
        channels: &NexusChannelInner,
    ) {
        let mut io = Bio(pio);
        // in case of resets, we want to reset all underlying children
        io.ctx_as_mut_ref().in_flight = channels.ch.len() as i8;
        let results = channels
            .ch
            .iter()
            .map(|c| unsafe {
                let (bdev, chan) = c.io_tuple();
                trace!("Dispatched RESET");
                spdk_bdev_reset(
                    bdev,
                    chan,
                    Some(Self::io_completion),
                    pio as *mut _,
                )
            })
            .collect::<Vec<_>>();
        // if any of the children failed to dispatch
        if results.iter().any(|r| *r != 0) {
            error!(
                "{}: Failed to submit dispatched IO {:?}",
                io.nexus_as_ref().name,
                pio
            );
        }
    }
pub ( crate ) fn reset ( & self , pio : * mut spdk_bdev_io , channels : & NexusChannelInner , ) { let mut io = Bio ( pio ) ; // in case of resets, we want to reset all underlying children io . ctx_as_mut_ref ( ) . in_flight = channels . ch . len ( ) as i8 ; let results = channels . ch . iter ( ) . map ( | c | unsafe { let ( bdev , chan ) = c . io_tuple ( ) ; trace ! ( " " ) ; spdk_bdev_reset ( bdev , chan , Some ( Self :: io_completion ) , pio as * mut _ , ) } ) . collect :: < Vec < _ > > ( ) ; // if any of the children failed to dispatch if results . iter ( ) . any ( | r | * r != 0 ) { error ! ( " " io nexus_as_ref ( ) name pio ) ; } }
send reset IO to the underlying children.
send reset IO to the underlying children .
&self
pio
*mut spdk_bdev_io
channels
&NexusChannelInner