pub(crate) async fn online(
        &mut self,
        parent_size: u64,
    ) -> Result<String, ChildError> {
        // Only online a child if it was previously set offline. Check for a
        // "Closed" state as that is what offlining a child will set it to.
        match self.state.load() {
            ChildState::Closed => {
                // Re-create the bdev as it will have been previously destroyed.
                let name =
                    bdev_create(&self.name).await.context(ChildBdevCreate {
                        child: self.name.clone(),
                    })?;
                self.bdev = Bdev::lookup_by_name(&name);
            }
            _ => return Err(ChildError::ChildNotClosed {}),
        }

        let result = self.open(parent_size);
        self.set_state(ChildState::Faulted(Reason::OutOfSync));
        NexusChild::save_state_change();
        result
    }
/// Online a previously offlined child.
/// The child is set out-of-sync so that it will be rebuilt.
/// TODO: channels need to be updated when bdevs are opened
Online a previously offlined child.
The child is set out-of-sync so that it will be rebuilt.
TODO: channels need to be updated when bdevs are opened
Online a previously offlined child . The child is set out - of - sync so that it will be rebuilt . TODO : channels need to be updated when bdevs are opened
pub(crate) async fn online(
        &mut self,
        parent_size: u64,
    ) -> Result<String, ChildError> {
        // Only online a child if it was previously set offline. Check for a
        // "Closed" state as that is what offlining a child will set it to.
        match self.state.load() {
            ChildState::Closed => {
                // Re-create the bdev as it will have been previously destroyed.
                let name =
                    bdev_create(&self.name).await.context(ChildBdevCreate {
                        child: self.name.clone(),
                    })?;
                self.bdev = Bdev::lookup_by_name(&name);
            }
            _ => return Err(ChildError::ChildNotClosed {}),
        }
        let result = self.open(parent_size);
        self.set_state(ChildState::Faulted(Reason::OutOfSync));
        NexusChild::save_state_change();
        result
    }
pub ( crate ) async fn online ( & mut self , parent_size : u64 , ) -> Result < String , ChildError > { // Only online a child if it was previously set offline. Check for a // "Closed" state as that is what offlining a child will set it to. match self . state . load ( ) { ChildState :: Closed => { // Re-create the bdev as it will have been previously destroyed. let name = bdev_create ( & self . name ) . await . context ( ChildBdevCreate { child : self . name . clone ( ) , } ) ? ; self . bdev = Bdev :: lookup_by_name ( & name ) ; } _ => return Err ( ChildError :: ChildNotClosed { } ) , } let result = self . open ( parent_size ) ; self . set_state ( ChildState :: Faulted ( Reason :: OutOfSync ) ) ; NexusChild :: save_state_change ( ) ; result }
Online a previously offlined child.
Online a previously offlined child .
&mut self
parent_size
u64