/// Load a inode prefetch table from a reader.
///
/// Note: Generally, prefetch happens after loading bootstrap, so with methods operating
/// files with changing their offset won't bring errors. But we still use `pread` now so as
/// to make this method more stable and robust. Even dup(2) can't give us a separated file struct.
Load a inode prefetch table from a reader.
Note: Generally, prefetch happens after loading bootstrap, so with methods operating
files with changing their offset won't bring errors. But we still use `pread` now so as
to make this method more stable and robust. Even dup(2) can't give us a separated file struct.
Load a inode prefetch table from a reader . Note : Generally prefetch happens after loading bootstrap so with methods operating files with changing their offset won ' t bring errors . But we still use ` pread ` now so as to make this method more stable and robust . Even dup ( 2 ) can ' t give us a separated file struct .
pub fn load_prefetch_table_from(
        &mut self,
        r: &mut RafsIoReader,
        offset: u64,
        entries: usize,
    ) -> Result<usize> {
        self.inodes = vec![0u32; entries];
        let (_, data, _) = unsafe { self.inodes.align_to_mut::<u8>() };
        r.seek_to_offset(offset)?;
        r.read_exact(data)?;
        Ok(data.len())
    }
pub fn load_prefetch_table_from ( & mut self , r : & mut RafsIoReader , offset : u64 , entries : usize , ) -> Result < usize > { self . inodes = vec ! [ 0u32 entries ] ; let ( _ , data , _ ) = unsafe { self . inodes . align_to_mut :: < u8 > ( ) } ; r . seek_to_offset ( offset ) ? ; r . read_exact ( data ) ? ; Ok ( data . len ( ) ) }
Load a inode prefetch table from a reader.
Load a inode prefetch table from a reader .
&mut self
r
&mut RafsIoReader
offset
u64
entries
usize