pub fn import(
        &mut self,
        r: &mut RafsIoReader,
        prefetch_files: Option<Vec<&Path>>,
    ) -> Result<()> {
        if self.initialized {
            return Err(ealready!("rafs already mounted"));
        }

        self.device
            .init(&self.sb.meta, &self.sb.inodes.get_blobs())?;

        // Device should be ready before any prefetch.
        if self.fs_prefetch {
            let inodes = match prefetch_files {
                Some(files) => {
                    let mut inodes = Vec::<Inode>::new();
                    for f in files {
                        if let Ok(inode) = self.ino_from_path(f) {
                            inodes.push(inode);
                        } else {
                            continue;
                        }
                    }
                    Some(inodes)
                }
                None => None,
            };

            if let Ok(ref mut desc) = self.sb.prefetch_hint_files(r, inodes) {
                if self.device.prefetch(desc).is_err() {
                    eother!("Prefetch error");
                }
            }
        }

        self.initialized = true;
        info!("rafs imported");

        Ok(())
    }
/// Import an rafs bootstrap to initialize the filesystem instance.
Import an rafs bootstrap to initialize the filesystem instance.
Import an rafs bootstrap to initialize the filesystem instance .
pub fn import(
        &mut self,
        r: &mut RafsIoReader,
        prefetch_files: Option<Vec<&Path>>,
    ) -> Result<()> {
        if self.initialized {
            return Err(ealready!("rafs already mounted"));
        }
        self.device
            .init(&self.sb.meta, &self.sb.inodes.get_blobs())?;
        // Device should be ready before any prefetch.
        if self.fs_prefetch {
            let inodes = match prefetch_files {
                Some(files) => {
                    let mut inodes = Vec::<Inode>::new();
                    for f in files {
                        if let Ok(inode) = self.ino_from_path(f) {
                            inodes.push(inode);
                        } else {
                            continue;
                        }
                    }
                    Some(inodes)
                }
                None => None,
            };
            if let Ok(ref mut desc) = self.sb.prefetch_hint_files(r, inodes) {
                if self.device.prefetch(desc).is_err() {
                    eother!("Prefetch error");
                }
            }
        }
        self.initialized = true;
        info!("rafs imported");
        Ok(())
    }
pub fn import ( & mut self , r : & mut RafsIoReader , prefetch_files : Option < Vec < & Path > > , ) -> Result < ( ) > { if self . initialized { return Err ( ealready ! ( " " ) ) ; } self . device . init ( & self . sb . meta , & self . sb . inodes . get_blobs ( ) ) ? ; // Device should be ready before any prefetch. if self . fs_prefetch { let inodes = match prefetch_files { Some ( files ) => { let mut inodes = Vec :: < Inode > :: new ( ) ; for f in files { if let Ok ( inode ) = self . ino_from_path ( f ) { inodes . push ( inode ) ; } else { continue ; } } Some ( inodes ) } None => None , } ; if let Ok ( ref mut desc ) = self . sb . prefetch_hint_files ( r , inodes ) { if self . device . prefetch ( desc ) . is_err ( ) { eother ! ( " " ) ; } } } self . initialized = true ; info ! ( " " ) ; Ok ( ( ) ) }
Import an rafs bootstrap to initialize the filesystem instance.
Import an rafs bootstrap to initialize the filesystem instance .
&mut self
r
&mut RafsIoReader
prefetch_files
Option<Vec<&Path>>
&mut self
r
&mut RafsIoReader
prefetch_files
Option<Vec<&Path>>