mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-16 08:38:26 +00:00
optimize journal resolution code
We have the journals tracked in a HashSet, so, use the hashing properties instead of an O(N) search.
This commit is contained in:
parent
0bdf21b3ac
commit
4f1f4a3907
1 changed files with 4 additions and 6 deletions
|
|
@ -451,12 +451,10 @@ impl PddbOs {
|
|||
/// Pages drawn from disk might already have come from the FSCB. We need to make the journal number
|
||||
/// of these consistent with those in the FSCB so later on when they are retired we don't have journal conflicts.
|
||||
fn resolve_pp_journal(&self, pp: &mut PhysPage) {
|
||||
for fs_pp in self.fspace_cache.iter() {
|
||||
if pp.page_number() == fs_pp.page_number() {
|
||||
if pp.journal() < fs_pp.journal() {
|
||||
log::debug!("bumping journal {}->{}: {:x?}", pp.journal(), fs_pp.journal(), pp);
|
||||
pp.set_journal(fs_pp.journal());
|
||||
}
|
||||
if let Some(fs_pp) = self.fspace_cache.get(pp) {
|
||||
if pp.journal() < fs_pp.journal() {
|
||||
log::debug!("bumping journal {}->{}: {:x?}", pp.journal(), fs_pp.journal(), pp);
|
||||
pp.set_journal(fs_pp.journal());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue