Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bootreer committed Apr 8, 2024
1 parent d3a5791 commit 5f34ff1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions examples/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub fn main() -> Result<(), Box<dyn Error>> {
let bytes = 512 * blocks;
let ns_blocks = nvme.namespaces.get(&1).unwrap().blocks - blocks - 1;

let mut buffer: Dma<u8> = Dma::allocate(HUGE_PAGE_SIZE, true)?;
let mut buffer: Dma<u8> = Dma::allocate(HUGE_PAGE_SIZE)?;

let n = 1_000_000;
let mut read = std::time::Duration::new(0, 0);
Expand Down Expand Up @@ -104,7 +104,7 @@ fn qd32(mut nvme: NvmeDevice) -> Result<NvmeDevice, Box<dyn Error>> {

let mut read = std::time::Duration::ZERO;
let mut write = std::time::Duration::ZERO;
let mut buffer: Dma<u8> = Dma::allocate(HUGE_PAGE_SIZE, true).unwrap();
let mut buffer: Dma<u8> = Dma::allocate(HUGE_PAGE_SIZE).unwrap();

// buggy when completely saturating queue for some reason
let mut qpair = nvme
Expand Down Expand Up @@ -203,7 +203,7 @@ fn qd32_test(mut nvme: NvmeDevice, write: bool) -> Result<NvmeDevice, Box<dyn Er
let bytes = 512 * blocks;

let mut elapsed = std::time::Duration::ZERO;
let mut buffer: Dma<u8> = Dma::allocate(HUGE_PAGE_SIZE, true).unwrap();
let mut buffer: Dma<u8> = Dma::allocate(HUGE_PAGE_SIZE).unwrap();

// buggy when completely saturating queue for some reason
let mut qpair = nvme
Expand Down
6 changes: 3 additions & 3 deletions examples/io_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ fn qd1(
random: bool,
time: Option<Duration>,
) -> Result<NvmeDevice, Box<dyn Error>> {
let mut buffer: Dma<u8> = Dma::allocate(HUGE_PAGE_SIZE, true)?;
let mut buffer: Dma<u8> = Dma::allocate(HUGE_PAGE_SIZE)?;

let blocks = 8;
let bytes = 512 * blocks;
Expand Down Expand Up @@ -126,7 +126,7 @@ fn qd_n(
let mut rng = rand::thread_rng();
let bytes = 512 * blocks as usize;
let mut total = std::time::Duration::ZERO;
let mut buffer: Dma<u8> = Dma::allocate(HUGE_PAGE_SIZE, true).unwrap();
let mut buffer: Dma<u8> = Dma::allocate(HUGE_PAGE_SIZE).unwrap();

let mut qpair = nvme
.lock()
Expand Down Expand Up @@ -236,7 +236,7 @@ fn qd_n(
}

fn fill_ns(nvme: &mut NvmeDevice) {
let buffer: Dma<u8> = Dma::allocate(HUGE_PAGE_SIZE, true).unwrap();
let buffer: Dma<u8> = Dma::allocate(HUGE_PAGE_SIZE).unwrap();
let max_lba = nvme.namespaces.get(&1).unwrap().blocks - buffer.size as u64 / 512 - 1;
let blocks = buffer.size as u64 / 512;
let mut lba = 0;
Expand Down

0 comments on commit 5f34ff1

Please sign in to comment.