fn alloc(&mut self, seq: u32, off: usize, buf: &[u8]) -> Result<()> {
        self.writeback()?;
        let mut page = if self.map[seq as usize].is_some() {
            info!("{:?}: load #{} (write)", self.name, seq);
            Page::load(&self.map, &self.backend, seq)?
        } else {
            debug!("{:?}: zero #{} (write)", self.name, seq);
            self.zero_page.clone().set_seq(seq)
        };
        page.update(off, buf);
        self.dirty.put(seq, page);
        Ok(())
    }
/// Creates a new page in the dirty cache either from disk or as empty page. Writes `buf` into
/// that page.
Creates a new page in the dirty cache either from disk or as empty page. Writes `buf` into
that page.
Creates a new page in the dirty cache either from disk or as empty page . Writes ` buf ` into that page .
fn alloc(&mut self, seq: u32, off: usize, buf: &[u8]) -> Result<()> {
        self.writeback()?;
        let mut page = if self.map[seq as usize].is_some() {
            info!("{:?}: load #{} (write)", self.name, seq);
            Page::load(&self.map, &self.backend, seq)?
        } else {
            debug!("{:?}: zero #{} (write)", self.name, seq);
            self.zero_page.clone().set_seq(seq)
        };
        page.update(off, buf);
        self.dirty.put(seq, page);
        Ok(())
    }
fn alloc ( & mut self , seq : u32 , off : usize , buf : & [ u8 ] ) -> Result < ( ) > { self . writeback ( ) ? ; let mut page = if self . map [ seq as usize ] . is_some ( ) { info ! ( " " self name seq ) ; Page :: load ( & self . map , & self . backend , seq ) ? } else { debug ! ( " " self name seq ) ; self . zero_page . clone ( ) . set_seq ( seq ) } ; page . update ( off , buf ) ; self . dirty . put ( seq , page ) ; Ok ( ( ) ) }
Creates a new page in the dirty cache either from disk or as empty page.
Creates a new page in the dirty cache either from disk or as empty page .
&mut self
seq
u32
off
usize
buf
&[u8]
&mut self
seq
u32
off
usize
buf
&[u8]