INNER CODE UNIT · Rust

mkfs

openebs/mayastor · io-engine-tests/src/lib.rs:300

pub fn mkfs(path: &str, fstype: &str) -> bool {
    let (fs, args) = match fstype {
        "xfs" => ("mkfs.xfs", vec!["-i", "nrext64=0", "-f", path]),
        "ext4" => ("mkfs.ext4", vec!["-F", path]),
        _ => {
            panic!("unsupported fstype");
        }
    };

    let output = Command::new(fs)
        .args(args)
        .output()
        .expect("mkfs exec error");

    io::stdout().write_all(&output.stderr).unwrap();
    io::stdout().write_all(&output.stdout).unwrap();
    output.status.success()
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…