pub async fn nvme_admin(
        &self,
        nvme_cmd: &spdk_sys::spdk_nvme_cmd,
        buffer: Option<&mut DmaBuf>,
    ) -> Result<(), CoreError> {
        trace!("Sending nvme_admin {}", nvme_cmd.opc());
        let (s, r) = oneshot::channel::<bool>();
        // Use the spdk-sys variant spdk_bdev_nvme_admin_passthru that
        // assumes read commands
        let errno = unsafe {
            spdk_bdev_nvme_admin_passthru_ro(
                self.desc.as_ptr(),
                self.channel.as_ptr(),
                &*nvme_cmd,
                match buffer {
                    Some(ref b) => ***b,
                    None => std::ptr::null_mut(),
                },
                match buffer {
                    Some(b) => b.len(),
                    None => 0,
                },
                Some(Self::io_completion_cb),
                cb_arg(s),
            )
        };

        if errno != 0 {
            return Err(CoreError::NvmeAdminDispatch {
                source: Errno::from_i32(errno),
                opcode: (*nvme_cmd).opc(),
            });
        }

        if r.await.expect("Failed awaiting NVMe Admin IO") {
            Ok(())
        } else {
            Err(CoreError::NvmeAdminFailed {
                opcode: (*nvme_cmd).opc(),
            })
        }
    }
/// sends the specified NVMe Admin command, only read commands
sends the specified NVMe Admin command, only read commands
sends the specified NVMe Admin command only read commands
pub async fn nvme_admin(
        &self,
        nvme_cmd: &spdk_sys::spdk_nvme_cmd,
        buffer: Option<&mut DmaBuf>,
    ) -> Result<(), CoreError> {
        trace!("Sending nvme_admin {}", nvme_cmd.opc());
        let (s, r) = oneshot::channel::<bool>();
        // Use the spdk-sys variant spdk_bdev_nvme_admin_passthru that
        // assumes read commands
        let errno = unsafe {
            spdk_bdev_nvme_admin_passthru_ro(
                self.desc.as_ptr(),
                self.channel.as_ptr(),
                &*nvme_cmd,
                match buffer {
                    Some(ref b) => ***b,
                    None => std::ptr::null_mut(),
                },
                match buffer {
                    Some(b) => b.len(),
                    None => 0,
                },
                Some(Self::io_completion_cb),
                cb_arg(s),
            )
        };
        if errno != 0 {
            return Err(CoreError::NvmeAdminDispatch {
                source: Errno::from_i32(errno),
                opcode: (*nvme_cmd).opc(),
            });
        }
        if r.await.expect("Failed awaiting NVMe Admin IO") {
            Ok(())
        } else {
            Err(CoreError::NvmeAdminFailed {
                opcode: (*nvme_cmd).opc(),
            })
        }
    }
pub async fn nvme_admin ( & self , nvme_cmd : & spdk_sys :: spdk_nvme_cmd , buffer : Option < & mut DmaBuf > , ) -> Result < ( ) , CoreError > { trace ! ( " " nvme_cmd opc ( ) ) ; let ( s , r ) = oneshot :: channel :: < bool > ( ) ; // Use the spdk-sys variant spdk_bdev_nvme_admin_passthru that // assumes read commands let errno = unsafe { spdk_bdev_nvme_admin_passthru_ro ( self . desc . as_ptr ( ) , self . channel . as_ptr ( ) , & * nvme_cmd , match buffer { Some ( ref b ) => * * * b , None => std :: ptr :: null_mut ( ) , } , match buffer { Some ( b ) => b . len ( ) , None => 0 , } , Some ( Self :: io_completion_cb ) , cb_arg ( s ) , ) } ; if errno != 0 { return Err ( CoreError :: NvmeAdminDispatch { source : Errno :: from_i32 ( errno ) , opcode : ( * nvme_cmd ) . opc ( ) , } ) ; } if r . await . expect ( " " ) { Ok ( ( ) ) } else { Err ( CoreError :: NvmeAdminFailed { opcode : ( * nvme_cmd ) . opc ( ) , } ) } }
sends the specified NVMe Admin command, only read commands
sends the specified NVMe Admin command only read commands
&self
nvme_cmd
&spdk_sys::spdk_nvme_cmd
buffer
Option<&mut DmaBuf>