diff options
| author | Alejandro Soto <alejandro@34project.org> | 2022-01-03 12:01:13 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2022-01-03 12:01:13 -0600 |
| commit | c1d3dea4f77d0ebebc27877ed5a3540fef2e96fd (patch) | |
| tree | 3f2ee65339f6294ed4a3696d9bf214b6e4f0de57 /src/fuse | |
| parent | 988ce8bbc2a33f6a90adecb7547a88cfbf7acaf2 (diff) | |
Implement flush operation
Diffstat (limited to '')
| -rw-r--r-- | src/fuse/ops.rs | 19 | ||||
| -rw-r--r-- | src/fuse/session.rs | 3 |
2 files changed, 22 insertions, 0 deletions
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 @@ -490,6 +490,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; type ReplyTail = (); 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), |
