Skip to content

Commit

Permalink
nvme: What is this nonsense 🤣
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaofengli committed May 14, 2021
1 parent 412829d commit 2be7bee
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions domains/sys/driver/nvme/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,23 +71,18 @@ impl interface::bdev::NvmeBDev for Nvme {
write: bool,
) -> RpcResult<Result<(usize, RRefDeque<BlkReq, 128>, RRefDeque<BlkReq, 128>)>> {
Ok((|| {
let mut submit = Some(submit);
let mut collect = Some(collect);
let mut ret = 0;

let device = &mut self.device.borrow_mut();
let device = device.as_mut().ok_or(ErrorKind::UninitializedDevice)?;
let (num, _, _, _, submit_, collect_) = device.device.submit_and_poll_rref(
submit.take().unwrap(),
collect.take().unwrap(),
let (num, _, _, _, submit, collect) = device.device.submit_and_poll_rref(
submit,
collect,
write,
);
ret = num;

submit.replace(submit_);
collect.replace(collect_);

Ok((ret, submit.unwrap(), collect.unwrap()))
Ok((ret, submit, collect))
})())
}

Expand Down

0 comments on commit 2be7bee

Please sign in to comment.