async fn create_nexus_bdevs(&self) -> usize {
        let mut failures = 0;
        info!("creating nexus devices");

        // we can't use iterators here as they are not async
        if let Some(bdevs) = self.nexus_bdevs.as_ref() {
            for nexus in bdevs {
                info!("creating nexus {}", nexus.name);
                match Byte::from_str(&nexus.size) {
                    Ok(val) => {
                        if let Err(e) = nexus_create(
                            &nexus.name,
                            val.get_bytes() as u64,
                            Some(&nexus.uuid),
                            &nexus.children,
                        )
                        .await
                        {
                            error!(
                                "Failed to create nexus {}, error={}",
                                nexus.name,
                                e.verbose()
                            );
                            failures += 1;
                        }
                    }
                    Err(_e) => {
                        failures += 1;
                        error!(
                            "Invalid size {} for {}",
                            &nexus.size, nexus.name
                        );
                    }
                }
            }
        }

        // Apply the saved child status and start rebuilding any degraded
        // children
        ChildStatusConfig::apply().await;
        self.start_rebuilds().await;

        failures
    }
/// create any nexus bdevs any failure will be logged, but we will silently
/// continue and try to create as many as possible. Returns the number of
/// bdevs for which the creation failed.
create any nexus bdevs any failure will be logged, but we will silently
continue and try to create as many as possible. Returns the number of
bdevs for which the creation failed.
create any nexus bdevs any failure will be logged but we will silently continue and try to create as many as possible . Returns the number of bdevs for which the creation failed .
async fn create_nexus_bdevs(&self) -> usize {
        let mut failures = 0;
        info!("creating nexus devices");
        // we can't use iterators here as they are not async
        if let Some(bdevs) = self.nexus_bdevs.as_ref() {
            for nexus in bdevs {
                info!("creating nexus {}", nexus.name);
                match Byte::from_str(&nexus.size) {
                    Ok(val) => {
                        if let Err(e) = nexus_create(
                            &nexus.name,
                            val.get_bytes() as u64,
                            Some(&nexus.uuid),
                            &nexus.children,
                        )
                        .await
                        {
                            error!(
                                "Failed to create nexus {}, error={}",
                                nexus.name,
                                e.verbose()
                            );
                            failures += 1;
                        }
                    }
                    Err(_e) => {
                        failures += 1;
                        error!(
                            "Invalid size {} for {}",
                            &nexus.size, nexus.name
                        );
                    }
                }
            }
        }
        // Apply the saved child status and start rebuilding any degraded
        // children
        ChildStatusConfig::apply().await;
        self.start_rebuilds().await;
        failures
    }
async fn create_nexus_bdevs ( & self ) -> usize { let mut failures = 0 ; info ! ( " " ) ; // we can't use iterators here as they are not async if let Some ( bdevs ) = self . nexus_bdevs . as_ref ( ) { for nexus in bdevs { info ! ( " " nexus name ) ; match Byte :: from_str ( & nexus . size ) { Ok ( val ) => { if let Err ( e ) = nexus_create ( & nexus . name , val . get_bytes ( ) as u64 , Some ( & nexus . uuid ) , & nexus . children , ) . await { error ! ( " " nexus name e verbose ( ) ) ; failures += 1 ; } } Err ( _e ) => { failures += 1 ; error ! ( " " nexus size nexus name ) ; } } } } // Apply the saved child status and start rebuilding any degraded // children ChildStatusConfig :: apply ( ) . await ; self . start_rebuilds ( ) . await ; failures }
create any nexus bdevs any failure will be logged, but we will silently
continue and try to create as many as possible.
create any nexus bdevs any failure will be logged but we will silently continue and try to create as many as possible .
&self