Inline a few functions
This commit is contained in:
parent
58ee7769d8
commit
95f6309d37
|
@ -22,6 +22,7 @@ trait OptionExt<R> {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<R> OptionExt<R> for Option<R> {
|
impl<R> OptionExt<R> for Option<R> {
|
||||||
|
#[inline]
|
||||||
fn enoent(self) -> IoResult<R> {
|
fn enoent(self) -> IoResult<R> {
|
||||||
match self {
|
match self {
|
||||||
Some(r) => Ok(r),
|
Some(r) => Ok(r),
|
||||||
|
@ -82,6 +83,7 @@ impl EncryptedFs {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
fn get_path(&self, ino: u64) -> Option<&PathBuf> {
|
fn get_path(&self, ino: u64) -> Option<&PathBuf> {
|
||||||
self.inode_cache.get_path(ino)
|
self.inode_cache.get_path(ino)
|
||||||
}
|
}
|
||||||
|
@ -119,6 +121,7 @@ impl EncryptedFs {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
fn lookup_impl(
|
fn lookup_impl(
|
||||||
&mut self,
|
&mut self,
|
||||||
parent: u64,
|
parent: u64,
|
||||||
|
@ -146,6 +149,7 @@ impl EncryptedFs {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
fn read_dir_impl(
|
fn read_dir_impl(
|
||||||
&mut self,
|
&mut self,
|
||||||
ino: u64,
|
ino: u64,
|
||||||
|
@ -213,6 +217,7 @@ impl EncryptedFs {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
fn read_impl(
|
fn read_impl(
|
||||||
&mut self,
|
&mut self,
|
||||||
ino: u64,
|
ino: u64,
|
||||||
|
|
|
@ -68,6 +68,7 @@ impl ContentEnc {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return the decrypted size of a file, based on the encrypted size.
|
/// Return the decrypted size of a file, based on the encrypted size.
|
||||||
|
#[inline]
|
||||||
pub fn get_real_size(encrypted_size: u64) -> u64 {
|
pub fn get_real_size(encrypted_size: u64) -> u64 {
|
||||||
if encrypted_size == 0 {
|
if encrypted_size == 0 {
|
||||||
0
|
0
|
||||||
|
|
Loading…
Reference in New Issue