Skip to content

Commit

Permalink
debug: force sqe async
Browse files Browse the repository at this point in the history
For debug purpose

Signed-off-by: Ming Lei <[email protected]>
  • Loading branch information
ming1 committed Feb 5, 2025
1 parent 3e8cdff commit 79e7f31
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/zoned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use libublk::{ctrl::UblkCtrl, io::UblkDev, io::UblkIOCtx, io::UblkQueue};

use anyhow::bail;
use bitflags::bitflags;
use io_uring::{opcode, types};
use io_uring::{opcode, squeue, types};
use libc::{c_void, memset, pread, pwrite};
use log::trace;
use std::fs::{File, OpenOptions};
Expand Down Expand Up @@ -804,7 +804,8 @@ async fn handle_read(
//read to temp buffer from backed-file
let sqe = opcode::Read::new(types::Fd(zfd), buf_addr as *mut u8, bytes as u32)
.offset(zf_offset)
.build();
.build()
.flags(squeue::Flags::ASYNC);
let res = q.ublk_submit_sqe(sqe).await;
if res < 0 {
return Err(anyhow::anyhow!("io uring read failure {}", res));
Expand Down Expand Up @@ -846,7 +847,8 @@ async fn handle_plain_write(
// handle the write
let sqe = opcode::Write::new(types::Fd(zfd), buf_addr as *const u8, bytes as u32)
.offset(zf_offset)
.build();
.build()
.flags(squeue::Flags::ASYNC);
q.ublk_submit_sqe(sqe).await
} else {
let off = start_sector << 9;
Expand Down

0 comments on commit 79e7f31

Please sign in to comment.