/// Store RAFS bootstrap to backend storage.
Store RAFS bootstrap to backend storage.
Store RAFS bootstrap to backend storage .
pub fn store(&self, w: &mut RafsIoWriter) -> Result<usize> {
        let mut sb = OndiskSuperBlock::new();
        sb.set_magic(self.meta.magic);
        sb.set_version(self.meta.version);
        sb.set_sb_size(self.meta.sb_size);
        sb.set_block_size(self.meta.block_size);
        sb.set_flags(self.meta.flags.bits());
        match self.meta.version {
            RAFS_SUPER_VERSION_V4 => {}
            RAFS_SUPER_VERSION_V5 => {
                sb.set_inodes_count(self.meta.inodes_count);
                sb.set_inode_table_entries(self.meta.inode_table_entries);
                sb.set_inode_table_offset(self.meta.inode_table_offset);
            }
            _ => return Err(einval!("invalid superblock version number")),
        }
        sb.validate()?;
        w.write_all(sb.as_ref())?;
        trace!("written superblock: {}", &sb);
        Ok(std::mem::size_of::<OndiskSuperBlock>())
    }
pub fn store ( & self , w : & mut RafsIoWriter ) -> Result < usize > { let mut sb = OndiskSuperBlock :: new ( ) ; sb . set_magic ( self . meta . magic ) ; sb . set_version ( self . meta . version ) ; sb . set_sb_size ( self . meta . sb_size ) ; sb . set_block_size ( self . meta . block_size ) ; sb . set_flags ( self . meta . flags . bits ( ) ) ; match self . meta . version { RAFS_SUPER_VERSION_V4 => { } RAFS_SUPER_VERSION_V5 => { sb . set_inodes_count ( self . meta . inodes_count ) ; sb . set_inode_table_entries ( self . meta . inode_table_entries ) ; sb . set_inode_table_offset ( self . meta . inode_table_offset ) ; } _ => return Err ( einval ! ( " " ) ) , } sb . validate ( ) ? ; w . write_all ( sb . as_ref ( ) ) ? ; trace ! ( " " sb ) ; Ok ( std :: mem :: size_of :: < OndiskSuperBlock > ( ) ) }
Store RAFS bootstrap to backend storage.
Store RAFS bootstrap to backend storage .
&self
w
&mut RafsIoWriter