Skip to content

Commit

Permalink
Merge pull request #1047 from cagatay-y/fuse-refactor-2
Browse files Browse the repository at this point in the history
Refactor FUSE
  • Loading branch information
mkroening authored Feb 15, 2024
2 parents 34ce81b + bd900cd commit 294fabd
Show file tree
Hide file tree
Showing 4 changed files with 857 additions and 1,126 deletions.
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

0 comments on commit 294fabd

Please sign in to comment.