diff options
| author | Alejandro Soto <alejandro@34project.org> | 2021-12-29 06:11:24 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2021-12-29 06:11:42 -0600 |
| commit | 36e6ca83518c5afec980561ae9dbd6bdf4118420 (patch) | |
| tree | edc0fda0d2ee148d0dc90e1c7307d38068427986 /src/fuse | |
| parent | 95ae1b7cfaa92ac0fc10a362ed9cdd29a37b0781 (diff) | |
Refactor FsInfo API
Diffstat (limited to 'src/fuse')
| -rw-r--r-- | src/fuse/io.rs | 3 | ||||
| -rw-r--r-- | src/fuse/ops.rs | 5 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/fuse/io.rs b/src/fuse/io.rs index 7ba2944..db33ab3 100644 --- a/src/fuse/io.rs +++ b/src/fuse/io.rs @@ -41,6 +41,7 @@ pub struct Entry<'a, K> { pub ttl: Ttl, } +#[derive(Copy, Clone)] pub struct FsInfo(proto::StatfsOut); impl<'o, O: Operation<'o>> Request<'o, O> { @@ -296,7 +297,7 @@ impl FsInfo { }) } - pub fn filenames(self, max: u32) -> Self { + pub fn max_filename(self, max: u32) -> Self { FsInfo(proto::StatfsOut { namelen: max, ..self.0 diff --git a/src/fuse/ops.rs b/src/fuse/ops.rs index bfb45b8..01d671e 100644 --- a/src/fuse/ops.rs +++ b/src/fuse/ops.rs @@ -311,9 +311,8 @@ op! { impl Reply { /// Replies with filesystem statistics. - pub fn info(self, statfs: FsInfo) -> Done<'o> { - let statfs: proto::StatfsOut = statfs.into(); - self.single(&statfs) + pub fn info(self, statfs: &FsInfo) -> Done<'o> { + self.single(&proto::StatfsOut::from(*statfs)) } } } |
