/// write vectored IO to the underlying children.
write vectored IO to the underlying children.
write vectored IO to the underlying children .
pub(crate) fn writev(
        &self,
        pio: *mut spdk_bdev_io,
        channels: &NexusChannelInner,
    ) {
        let mut io = Bio(pio);
        // in case of writes, we want to write to all underlying children
        io.ctx_as_mut_ref().in_flight = channels.ch.len() as i8;
        let results = channels
            .ch
            .iter()
            .map(|c| unsafe {
                let (desc, chan) = c.io_tuple();
                spdk_bdev_writev_blocks(
                    desc,
                    chan,
                    io.iovs(),
                    io.iov_count(),
                    io.offset() + io.nexus_as_ref().data_ent_offset,
                    io.num_blocks(),
                    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 writev ( & self , pio : * mut spdk_bdev_io , channels : & NexusChannelInner , ) { let mut io = Bio ( pio ) ; // in case of writes, we want to write to all underlying children io . ctx_as_mut_ref ( ) . in_flight = channels . ch . len ( ) as i8 ; let results = channels . ch . iter ( ) . map ( | c | unsafe { let ( desc , chan ) = c . io_tuple ( ) ; spdk_bdev_writev_blocks ( desc , chan , io . iovs ( ) , io . iov_count ( ) , io . offset ( ) + io . nexus_as_ref ( ) . data_ent_offset , io . num_blocks ( ) , 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 ) ; } }
write vectored IO to the underlying children.
write vectored IO to the underlying children .
&self
pio
*mut spdk_bdev_io
channels
&NexusChannelInner