Replace VmFrame::zero with VmWriter::fill

This commit is contained in:
LI Qing
2024-01-31 15:43:32 +09:00
committed by Tate, Hongliang Tian
parent 195c6a0739
commit 12d338dd9b
4 changed files with 23 additions and 22 deletions

View File

@ -845,7 +845,7 @@ impl InodeImpl_ {
debug_assert!(field::DIRECT.contains(&(bid as usize)));
if self.blocks_hole_desc.is_hole(bid as usize) {
block.zero();
block.writer().fill(0);
return Ok(());
}
let device_bid = Bid::new(self.desc.data[bid as usize] as _);

View File

@ -414,7 +414,7 @@ impl RamInode {
impl PageCacheBackend for RamInode {
fn read_page(&self, _idx: usize, frame: &VmFrame) -> Result<()> {
// Initially, any block/page in a RamFs inode contains all zeros
frame.zero();
frame.writer().fill(0);
Ok(())
}