vmm: use unwrap_or instead of match for prefault

Signed-off-by: Yu Li <liyu.yukiteru@bytedance.com>
This commit is contained in:
Yu Li 2023-05-25 19:43:30 +08:00 committed by Bo Chen
parent fce202a90c
commit ce0f30bb54

View File

@ -494,10 +494,7 @@ impl MemoryManager {
file_offset,
region_start,
region_size,
match prefault {
Some(pf) => pf,
None => zone.prefault,
},
prefault.unwrap_or(zone.prefault),
zone.shared,
zone.hugepages,
zone.hugepage_size,
@ -573,10 +570,7 @@ impl MemoryManager {
guest_ram_mapping.file_offset,
GuestAddress(guest_ram_mapping.gpa),
guest_ram_mapping.size as usize,
match prefault {
Some(pf) => pf,
None => zone_config.prefault,
},
prefault.unwrap_or(zone_config.prefault),
zone_config.shared,
zone_config.hugepages,
zone_config.hugepage_size,
@ -997,10 +991,7 @@ impl MemoryManager {
0,
start_addr,
hotplug_size as usize,
match prefault {
Some(pf) => pf,
None => zone.prefault,
},
prefault.unwrap_or(zone.prefault),
zone.shared,
zone.hugepages,
zone.hugepage_size,