pub(crate) fn update_info_sector<D, T>(
        &mut self,
        controller: &mut Controller<D, T>,
    ) -> Result<(), Error<D::Error>>
    where
        D: BlockDevice,
        T: TimeSource,
    {
        if self.free_clusters_count.is_none() && self.next_free_cluster.is_none() {
            return Ok(());
        }
        let mut blocks = [Block::new()];
        controller
            .block_device
            .read(&mut blocks, self.info_location, "read_info_sector")
            .map_err(Error::DeviceError)?;
        let block = &mut blocks[0];
        if let Some(count) = self.free_clusters_count {
            block[488..492].copy_from_slice(&count.to_le_bytes());
        }
        if let Some(next_free_cluster) = self.next_free_cluster {
            block[492..496].copy_from_slice(&next_free_cluster.0.to_le_bytes());
        }
        controller
            .block_device
            .write(&blocks, self.info_location)
            .map_err(Error::DeviceError)?;
        Ok(())
    }
/// Writes the updated info_sector to disk
Writes the updated info_sector to disk
Writes the updated info_sector to disk
pub(crate) fn update_info_sector<D, T>(
        &mut self,
        controller: &mut Controller<D, T>,
    ) -> Result<(), Error<D::Error>>
    where
        D: BlockDevice,
        T: TimeSource,
    {
        if self.free_clusters_count.is_none() && self.next_free_cluster.is_none() {
            return Ok(());
        }
        let mut blocks = [Block::new()];
        controller
            .block_device
            .read(&mut blocks, self.info_location, "read_info_sector")
            .map_err(Error::DeviceError)?;
        let block = &mut blocks[0];
        if let Some(count) = self.free_clusters_count {
            block[488..492].copy_from_slice(&count.to_le_bytes());
        }
        if let Some(next_free_cluster) = self.next_free_cluster {
            block[492..496].copy_from_slice(&next_free_cluster.0.to_le_bytes());
        }
        controller
            .block_device
            .write(&blocks, self.info_location)
            .map_err(Error::DeviceError)?;
        Ok(())
    }
pub ( crate ) fn update_info_sector < D , T > ( & mut self , controller : & mut Controller < D , T > , ) -> Result < ( ) , Error < D :: Error > > where D : BlockDevice , T : TimeSource , { if self . free_clusters_count . is_none ( ) && self . next_free_cluster . is_none ( ) { return Ok ( ( ) ) ; } let mut blocks = [ Block :: new ( ) ] ; controller . block_device . read ( & mut blocks , self . info_location , " " ) . map_err ( Error :: DeviceError ) ? ; let block = & mut blocks [ 0 ] ; if let Some ( count ) = self . free_clusters_count { block [ 488 .. 492 ] . copy_from_slice ( & count . to_le_bytes ( ) ) ; } if let Some ( next_free_cluster ) = self . next_free_cluster { block [ 492 .. 496 ] . copy_from_slice ( & next_free_cluster . 0 . to_le_bytes ( ) ) ; } controller . block_device . write ( & blocks , self . info_location ) . map_err ( Error :: DeviceError ) ? ; Ok ( ( ) ) }
Writes the updated info_sector to disk
Writes the updated info_sector to disk
&mut self
controller
&mut Controller<D, T>
&mut self
controller
&mut Controller<D, T>