/// Update storage backend for blobs.
Update storage backend for blobs.
Update storage backend for blobs .
pub fn update(&self, r: &mut RafsIoReader, conf: RafsConfig) -> RafsResult<()> {
        info!("update");
        if !self.initialized {
            warn!("Rafs is not yet initialized");
            return Err(RafsError::Uninitialized);
        }
        // TODO: seems no need to do self.sb.update()
        // step 1: update sb.
        // No lock is needed thanks to ArcSwap.
        self.sb.update(r).map_err(|e| {
            error!("update failed due to {:?}", e);
            e
        })?;
        info!("update sb is successful");
        let storage_conf = Self::prepare_storage_conf(&conf)?;
        let blob_infos = self.sb.superblock.get_blob_infos();
        // step 2: update device (only localfs is supported)
        self.device
            .update(&storage_conf, &blob_infos)
            .map_err(RafsError::SwapBackend)?;
        info!("update device is successful");
        Ok(())
    }
pub fn update ( & self , r : & mut RafsIoReader , conf : RafsConfig ) -> RafsResult < ( ) > { info ! ( " " ) ; if ! self . initialized { warn ! ( " " ) ; return Err ( RafsError :: Uninitialized ) ; } // TODO: seems no need to do self.sb.update() // step 1: update sb. // No lock is needed thanks to ArcSwap. self . sb . update ( r ) . map_err ( | e | { error ! ( " " e ) ; e } ) ? ; info ! ( " " ) ; let storage_conf = Self :: prepare_storage_conf ( & conf ) ? ; let blob_infos = self . sb . superblock . get_blob_infos ( ) ; // step 2: update device (only localfs is supported) self . device . update ( & storage_conf , & blob_infos ) . map_err ( RafsError :: SwapBackend ) ? ; info ! ( " " ) ; Ok ( ( ) ) }
Update storage backend for blobs.
Update storage backend for blobs .
&self
r
&mut RafsIoReader
conf
RafsConfig