pub(crate) fn remove(&mut self) {
        info!("Removing child {}", self.name);

        // The bdev is being removed, so ensure we don't use it again.
        self.bdev = None;

        let state = self.state();

        match state {
            ChildState::Open | Faulted(Reason::OutOfSync) => {
                // Change the state of the child to ensure it is taken out of
                // the I/O path when the nexus is reconfigured.
                self.set_state(ChildState::Closed)
            }
            // leave the state into whatever we found it as
            _ => {}
        }

        // Remove the child from the I/O path. If we had an IO error the bdev,
        // the channels where already reconfigured so we dont have to do
        // that twice.
        if state != ChildState::Faulted(Reason::IoError) {
            let nexus_name = self.parent.clone();
            Reactor::block_on(async move {
                match nexus_lookup(&nexus_name) {
                    Some(n) => n.reconfigure(DREvent::ChildRemove).await,
                    None => error!("Nexus {} not found", nexus_name),
                }
            });
        }

        // Dropping the last descriptor results in the bdev being removed.
        // This must be performed in this function.
        let desc = self.desc.take();
        drop(desc);

        self.remove_complete();
        info!("Child {} removed", self.name);
    }
/// Called in response to a SPDK_BDEV_EVENT_REMOVE event.
/// All the necessary teardown should be performed here before the bdev is
/// removed.
///
/// Note: The descriptor *must* be dropped for the remove to complete.
Called in response to a SPDK_BDEV_EVENT_REMOVE event.
All the necessary teardown should be performed here before the bdev is
removed.

The descriptor *must* be dropped for the remove to complete.
Called in response to a SPDK_BDEV_EVENT_REMOVE event . All the necessary teardown should be performed here before the bdev is removed . The descriptor * must * be dropped for the remove to complete .
pub(crate) fn remove(&mut self) {
        info!("Removing child {}", self.name);
        // The bdev is being removed, so ensure we don't use it again.
        self.bdev = None;
        let state = self.state();
        match state {
            ChildState::Open | Faulted(Reason::OutOfSync) => {
                // Change the state of the child to ensure it is taken out of
                // the I/O path when the nexus is reconfigured.
                self.set_state(ChildState::Closed)
            }
            // leave the state into whatever we found it as
            _ => {}
        }
        // Remove the child from the I/O path. If we had an IO error the bdev,
        // the channels where already reconfigured so we dont have to do
        // that twice.
        if state != ChildState::Faulted(Reason::IoError) {
            let nexus_name = self.parent.clone();
            Reactor::block_on(async move {
                match nexus_lookup(&nexus_name) {
                    Some(n) => n.reconfigure(DREvent::ChildRemove).await,
                    None => error!("Nexus {} not found", nexus_name),
                }
            });
        }
        // Dropping the last descriptor results in the bdev being removed.
        // This must be performed in this function.
        let desc = self.desc.take();
        drop(desc);
        self.remove_complete();
        info!("Child {} removed", self.name);
    }
pub ( crate ) fn remove ( & mut self ) { info ! ( " " self name ) ; // The bdev is being removed, so ensure we don't use it again. self . bdev = None ; let state = self . state ( ) ; match state { ChildState :: Open | Faulted ( Reason :: OutOfSync ) => { // Change the state of the child to ensure it is taken out of // the I/O path when the nexus is reconfigured. self . set_state ( ChildState :: Closed ) } // leave the state into whatever we found it as _ => { } } // Remove the child from the I/O path. If we had an IO error the bdev, // the channels where already reconfigured so we dont have to do // that twice. if state != ChildState :: Faulted ( Reason :: IoError ) { let nexus_name = self . parent . clone ( ) ; Reactor :: block_on ( async move { match nexus_lookup ( & nexus_name ) { Some ( n ) => n . reconfigure ( DREvent :: ChildRemove ) . await , None => error ! ( " " nexus_name ) , } } ) ; } // Dropping the last descriptor results in the bdev being removed. // This must be performed in this function. let desc = self . desc . take ( ) ; drop ( desc ) ; self . remove_complete ( ) ; info ! ( " " self name ) ; }
Called in response to a SPDK_BDEV_EVENT_REMOVE event.
Called in response to a SPDK_BDEV_EVENT_REMOVE event .
&mut self