Rename various concepts related to memory management

This commit is contained in:
Zhang Junyang
2024-05-26 17:53:44 +00:00
committed by Tate, Hongliang Tian
parent 03a39c94ca
commit 14e1b1a9fc
97 changed files with 331 additions and 353 deletions

View File

@ -21,7 +21,7 @@ mod test {
bio::{BioEnqueueError, BioStatus, BioType, SubmittedBio},
BlockDevice,
};
use aster_frame::vm::{VmAllocOptions, VmIo, VmSegment};
use aster_frame::mm::{Segment, VmAllocOptions, VmIo};
use rand::{rngs::SmallRng, RngCore, SeedableRng};
use crate::{
@ -37,10 +37,10 @@ mod test {
/// Followings are implementations of memory simulated block device
pub const SECTOR_SIZE: usize = 512;
struct ExfatMemoryBioQueue(VmSegment);
struct ExfatMemoryBioQueue(Segment);
impl ExfatMemoryBioQueue {
pub fn new(segment: VmSegment) -> Self {
pub fn new(segment: Segment) -> Self {
ExfatMemoryBioQueue(segment)
}
@ -54,7 +54,7 @@ mod test {
}
impl ExfatMemoryDisk {
pub fn new(segment: VmSegment) -> Self {
pub fn new(segment: Segment) -> Self {
ExfatMemoryDisk {
queue: ExfatMemoryBioQueue::new(segment),
}
@ -100,7 +100,7 @@ mod test {
static EXFAT_IMAGE: &[u8] = include_bytes!("../../../../../regression/build/exfat.img");
/// Read exfat disk image
fn new_vm_segment_from_image() -> VmSegment {
fn new_vm_segment_from_image() -> Segment {
let vm_segment = {
VmAllocOptions::new(EXFAT_IMAGE.len() / PAGE_SIZE)
.is_contiguous(true)