Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor FUSE #1047

Merged
merged 11 commits into from
Feb 15, 2024
8 changes: 2 additions & 6 deletions src/drivers/fs/virtio_fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,17 +153,13 @@ impl VirtioFsDriver {
}

impl FuseInterface for VirtioFsDriver {
fn send_command<S, T>(&mut self, cmd: &fuse::Cmd<S>, rsp: &mut fuse::Rsp<T>)
where
S: fuse::FuseIn + core::fmt::Debug,
T: fuse::FuseOut + core::fmt::Debug,
{
fn send_command<O: fuse::ops::Op>(&mut self, cmd: &fuse::Cmd<O>, rsp: &mut fuse::Rsp<O>) {
if let Some(mut buff_tkn) = self.ready_queue.pop() {
let cmd_len = Some(cmd.len());
let rsp_len = Some(rsp.len());
buff_tkn.restr_size(cmd_len, rsp_len).unwrap();

let transfer_tkn = buff_tkn.write(Some(cmd), Some(rsp)).unwrap();
let transfer_tkn = buff_tkn.write(Some(cmd), None::<&fuse::Rsp<O>>).unwrap();
let transfer = transfer_tkn.dispatch_blocking().unwrap();
let (_, response) = transfer.ret_cpy().unwrap();
let tkn = transfer.reuse().unwrap();
Expand Down
Loading