Refactor the source structure in aster_frame::mm

This commit is contained in:
Zhang Junyang
2024-06-02 11:00:34 +00:00
committed by Tate, Hongliang Tian
parent e8595b95fe
commit 7095b37e7e
38 changed files with 177 additions and 129 deletions

View File

@ -122,7 +122,7 @@ where
// Create a guard array that only hold the root node lock.
let guards = core::array::from_fn(|i| {
if i == 0 {
Some(pt.root.copy_handle().lock())
Some(pt.root.clone_shallow().lock())
} else {
None
}
@ -313,7 +313,7 @@ where
// Drop the lock on the guard level.
self.guards[C::NR_LEVELS - self.guard_level] = None;
// Re-walk the page table to retreive the locks.
self.guards[0] = Some(self.pt.root.copy_handle().lock());
self.guards[0] = Some(self.pt.root.clone_shallow().lock());
self.level = C::NR_LEVELS;
let cur_pte = self.read_cur_pte();
let cur_child_is_pt = cur_pte.is_present() && !cur_pte.is_last(self.level);