From c1d3dea4f77d0ebebc27877ed5a3540fef2e96fd Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Mon, 3 Jan 2022 12:01:13 -0600 Subject: Implement flush operation --- src/fuse/ops.rs | 19 +++++++++++++++++++ src/fuse/session.rs | 3 +++ 2 files changed, 22 insertions(+) diff --git a/src/fuse/ops.rs b/src/fuse/ops.rs index 31b2b75..6bb307a 100644 --- a/src/fuse/ops.rs +++ b/src/fuse/ops.rs @@ -489,6 +489,25 @@ op! { } } +op! { + Flush { + type RequestBody = &'o proto::FlushIn; + type ReplyTail = (); + } + + impl Request { + pub fn handle(&self) -> u64 { + self.body.fh + } + } + + impl Reply { + pub fn ok(self) -> Done<'o> { + self.empty() + } + } +} + op! { Opendir { type RequestBody = &'o proto::OpendirIn; diff --git a/src/fuse/session.rs b/src/fuse/session.rs index 39e63b0..e3af41b 100644 --- a/src/fuse/session.rs +++ b/src/fuse/session.rs @@ -66,6 +66,7 @@ pub enum Dispatch<'o> { Getxattr(Incoming<'o, ops::Getxattr>), Listxattr(Incoming<'o, ops::Listxattr>), Removexattr(Incoming<'o, ops::Removexattr>), + Flush(Incoming<'o, ops::Flush>), Opendir(Incoming<'o, ops::Opendir>), Readdir(Incoming<'o, ops::Readdir>), Releasedir(Incoming<'o, ops::Releasedir>), @@ -237,6 +238,7 @@ impl<'o> Dispatch<'o> { Getxattr(incoming) => incoming.common, Listxattr(incoming) => incoming.common, Removexattr(incoming) => incoming.common, + Flush(incoming) => incoming.common, Opendir(incoming) => incoming.common, Readdir(incoming) => incoming.common, Releasedir(incoming) => incoming.common, @@ -311,6 +313,7 @@ impl Endpoint<'_> { Getxattr => dispatch!(Getxattr), Listxattr => dispatch!(Listxattr), Removexattr => dispatch!(Removexattr), + Flush => dispatch!(Flush), Opendir => dispatch!(Opendir), Readdir => dispatch!(Readdir), Releasedir => dispatch!(Releasedir), -- cgit v1.2.3