diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/fuse/io.rs | 6 | ||||
| -rw-r--r-- | src/fuse/ops.rs | 10 | ||||
| -rw-r--r-- | src/lib.rs | 10 |
3 files changed, 13 insertions, 13 deletions
diff --git a/src/fuse/io.rs b/src/fuse/io.rs index 823eb76..e3938d6 100644 --- a/src/fuse/io.rs +++ b/src/fuse/io.rs @@ -7,7 +7,7 @@ use std::{ ops::{ControlFlow, FromResidual, Try}, }; -use crate::{proto, FuseResult, Ino, TimeToLive, Timestamp}; +use crate::{proto, FuseResult, Ino, Ttl, Timestamp}; use super::{Done, Operation, Reply, Request}; @@ -26,7 +26,7 @@ pub enum Interruptible<'o, O: Operation<'o>, T> { pub trait Known { fn ino(&self) -> Ino; fn inode_type(&self) -> EntryType; - fn attrs(&self) -> (Attrs, TimeToLive); + fn attrs(&self) -> (Attrs, Ttl); fn unveil(self); } @@ -37,7 +37,7 @@ pub struct Entry<N, K> { pub offset: u64, pub name: N, pub inode: K, - pub ttl: TimeToLive, + pub ttl: Ttl, } pub struct FsInfo(proto::StatfsOut); diff --git a/src/fuse/ops.rs b/src/fuse/ops.rs index 4a526e0..d9e7167 100644 --- a/src/fuse/ops.rs +++ b/src/fuse/ops.rs @@ -8,7 +8,7 @@ use std::{ use crate::{ proto, util::{page_size, OutputChain}, - Errno, Ino, TimeToLive, + Errno, Ino, Ttl, }; use super::{ @@ -60,7 +60,7 @@ op! { impl Reply { /// The requested entry was found. The FUSE client will become aware of the found inode if /// it wasn't before. This result may be cached by the client for up to the given TTL. - pub fn found(self, entry: impl Known, ttl: TimeToLive) -> Done<'o> { + pub fn found(self, entry: impl Known, ttl: Ttl) -> Done<'o> { let (attrs, attrs_ttl) = entry.attrs(); let attrs = attrs.finish(&entry); @@ -72,7 +72,7 @@ op! { /// The requested entry was not found in this directory. The FUSE clint may include this /// response in negative cache for up to the given TTL. - pub fn not_found(self, ttl: TimeToLive) -> Done<'o> { + pub fn not_found(self, ttl: Ttl) -> Done<'o> { self.single(&make_entry((Ino::NULL, ttl), (Zeroable::zeroed(), Default::default()))) } @@ -361,8 +361,8 @@ fn c_to_os(string: &CStr) -> &OsStr { } fn make_entry( - (Ino(ino), entry_ttl): (Ino, TimeToLive), - (attrs, attr_ttl): (proto::Attrs, TimeToLive), + (Ino(ino), entry_ttl): (Ino, Ttl), + (attrs, attr_ttl): (proto::Attrs, Ttl), ) -> proto::EntryOut { proto::EntryOut { nodeid: ino, @@ -33,7 +33,7 @@ pub use nix::errno::Errno; pub use util::{FuseError, FuseResult}; #[derive(Copy, Clone, Default, Eq, PartialEq)] -pub struct TimeToLive { +pub struct Ttl { seconds: u64, nanoseconds: u32, } @@ -72,15 +72,15 @@ impl std::fmt::Display for Ino { } } -impl TimeToLive { - pub const MAX: Self = TimeToLive { +impl Ttl { + pub const MAX: Self = Ttl { seconds: u64::MAX, nanoseconds: u32::MAX, }; - pub fn new(seconds: u64, nanoseconds: u32) -> TimeToLive { + pub fn new(seconds: u64, nanoseconds: u32) -> Ttl { assert!(nanoseconds < 1_000_000_000); - TimeToLive { + Ttl { seconds, nanoseconds, } |
