mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-26 10:53:25 +00:00
Optimize the page cache within a RamInode
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
44629e4627
commit
f194514100
@ -519,7 +519,11 @@ impl RamInode {
|
|||||||
impl PageCacheBackend for RamInode {
|
impl PageCacheBackend for RamInode {
|
||||||
fn read_page_async(&self, _idx: usize, frame: &Frame) -> Result<BioWaiter> {
|
fn read_page_async(&self, _idx: usize, frame: &Frame) -> Result<BioWaiter> {
|
||||||
// Initially, any block/page in a RamFs inode contains all zeros
|
// Initially, any block/page in a RamFs inode contains all zeros
|
||||||
frame.writer().fill(0);
|
frame
|
||||||
|
.writer()
|
||||||
|
.to_fallible()
|
||||||
|
.fill_zeros(frame.size())
|
||||||
|
.unwrap();
|
||||||
Ok(BioWaiter::new())
|
Ok(BioWaiter::new())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user