@@ -536,8 +536,9 @@ impl<Storage: driver::Storage> Filesystem<'_, Storage> {
536536 // println!("in lfs_config_read for {} bytes", size);
537537 let storage = unsafe { & mut * ( ( * c) . context as * mut Storage ) } ;
538538 debug_assert ! ( !c. is_null( ) ) ;
539- let block_size = unsafe { c. read ( ) . block_size } ;
540- let off = ( block * block_size + off) as usize ;
539+ // let block_size = unsafe { c.read().block_size };
540+ let block_size = Storage :: BLOCK_SIZE ;
541+ let off = block as usize * block_size + off as usize ;
541542 let buf: & mut [ u8 ] = unsafe { slice:: from_raw_parts_mut ( buffer as * mut u8 , size as usize ) } ;
542543
543544 error_code_from ( storage. read ( off, buf) )
@@ -556,8 +557,8 @@ impl<Storage: driver::Storage> Filesystem<'_, Storage> {
556557 let storage = unsafe { & mut * ( ( * c) . context as * mut Storage ) } ;
557558 debug_assert ! ( !c. is_null( ) ) ;
558559 // let block_size = unsafe { c.read().block_size };
559- let block_size = Storage :: BLOCK_SIZE as u32 ;
560- let off = ( block * block_size + off) as usize ;
560+ let block_size = Storage :: BLOCK_SIZE ;
561+ let off = block as usize * block_size + off as usize ;
561562 let buf: & [ u8 ] = unsafe { slice:: from_raw_parts ( buffer as * const u8 , size as usize ) } ;
562563
563564 error_code_from ( storage. write ( off, buf) )
0 commit comments