fn parse_node(&self, inode: Arc<dyn RafsInode>, path: PathBuf) -> Result<Node> {
        // Parse chunks info
        let child_count = inode.get_child_count();
        let mut chunks = Vec::new();
        if inode.is_reg() {
            let chunk_count = child_count;
            for i in 0..chunk_count {
                let chunk = inode.get_chunk_info(i as u32)?.cast_ondisk()?;
                chunks.push(chunk);
            }
        }

        // Parse symlink
        let symlink = if inode.is_symlink() {
            Some(inode.get_symlink()?)
        } else {
            None
        };

        // Parse xattrs
        let mut xattrs = XAttrs {
            pairs: HashMap::new(),
        };
        for name in inode.get_xattrs()? {
            let name = bytes_to_os_str(&name);
            let value = inode.get_xattr(name)?;
            xattrs
                .pairs
                .insert(name.to_os_string(), value.unwrap_or_else(Vec::new));
        }

        // Get OndiskInode
        let ondisk_inode = inode.cast_ondisk()?;

        // Inodes from parent bootstrap can't have nodes with unique inode number.
        // So we assign an invalid dev here.
        Ok(Node {
            index: 0,
            real_ino: ondisk_inode.i_ino,
            dev: u64::MAX,
            overlay: Overlay::Lower,
            explicit_uidgid: self.rs.meta.explicit_uidgid(),
            source: PathBuf::from_str("/").unwrap(),
            path,
            inode: ondisk_inode,
            chunks,
            symlink,
            xattrs,
        })
    }
/// Parse ondisk inode in RAFS to Node in builder
Parse ondisk inode in RAFS to Node in builder
Parse ondisk inode in RAFS to Node in builder
fn parse_node(&self, inode: Arc<dyn RafsInode>, path: PathBuf) -> Result<Node> {
        // Parse chunks info
        let child_count = inode.get_child_count();
        let mut chunks = Vec::new();
        if inode.is_reg() {
            let chunk_count = child_count;
            for i in 0..chunk_count {
                let chunk = inode.get_chunk_info(i as u32)?.cast_ondisk()?;
                chunks.push(chunk);
            }
        }
        // Parse symlink
        let symlink = if inode.is_symlink() {
            Some(inode.get_symlink()?)
        } else {
            None
        };
        // Parse xattrs
        let mut xattrs = XAttrs {
            pairs: HashMap::new(),
        };
        for name in inode.get_xattrs()? {
            let name = bytes_to_os_str(&name);
            let value = inode.get_xattr(name)?;
            xattrs
                .pairs
                .insert(name.to_os_string(), value.unwrap_or_else(Vec::new));
        }
        // Get OndiskInode
        let ondisk_inode = inode.cast_ondisk()?;
        // Inodes from parent bootstrap can't have nodes with unique inode number.
        // So we assign an invalid dev here.
        Ok(Node {
            index: 0,
            real_ino: ondisk_inode.i_ino,
            dev: u64::MAX,
            overlay: Overlay::Lower,
            explicit_uidgid: self.rs.meta.explicit_uidgid(),
            source: PathBuf::from_str("/").unwrap(),
            path,
            inode: ondisk_inode,
            chunks,
            symlink,
            xattrs,
        })
    }
fn parse_node ( & self , inode : Arc < dyn RafsInode > , path : PathBuf ) -> Result < Node > { // Parse chunks info let child_count = inode . get_child_count ( ) ; let mut chunks = Vec :: new ( ) ; if inode . is_reg ( ) { let chunk_count = child_count ; for i in 0 .. chunk_count { let chunk = inode . get_chunk_info ( i as u32 ) ? . cast_ondisk ( ) ? ; chunks . push ( chunk ) ; } } // Parse symlink let symlink = if inode . is_symlink ( ) { Some ( inode . get_symlink ( ) ? ) } else { None } ; // Parse xattrs let mut xattrs = XAttrs { pairs : HashMap :: new ( ) , } ; for name in inode . get_xattrs ( ) ? { let name = bytes_to_os_str ( & name ) ; let value = inode . get_xattr ( name ) ? ; xattrs . pairs . insert ( name . to_os_string ( ) , value . unwrap_or_else ( Vec :: new ) ) ; } // Get OndiskInode let ondisk_inode = inode . cast_ondisk ( ) ? ; // Inodes from parent bootstrap can't have nodes with unique inode number. // So we assign an invalid dev here. Ok ( Node { index : 0 , real_ino : ondisk_inode . i_ino , dev : u64 :: MAX , overlay : Overlay :: Lower , explicit_uidgid : self . rs . meta . explicit_uidgid ( ) , source : PathBuf :: from_str ( " " ) . unwrap ( ) , path , inode : ondisk_inode , chunks , symlink , xattrs , } ) }
Parse ondisk inode in RAFS to Node in builder
Parse ondisk inode in RAFS to Node in builder
&self
inode
Arc<dyn RafsInode>
path
PathBuf
&self
inode
Arc<dyn RafsInode>
path
PathBuf