pub struct PageCache {
    priority: usize,
    block_ids: [usize; 8],
    page_ptr: &'static mut [u8; 4096],
    tracker: Arc<FrameTracker>,
}
Expand description

PageCache is used for kernel. Each PageCache contains PAGE_BUFFERS(8) BufferCache.

Fields

priority: usize

Priority is used for out of memory Every time kernel tried to alloc this pagecache this number will increase 1(at most 3) Every time out of memory occurred this number will decrease 1(at least 0) When it’s 0 and Arc’s strong count is 1(one in inode) this PageCache will be dropped

block_ids: [usize; 8]

If block_id is usize::Max, content in this block won’t be writed back

page_ptr: &'static mut [u8; 4096]tracker: Arc<FrameTracker>

Implementations

Trait Implementations

The read-only mapper to the block cache

The mutable mapper to the block cache

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.