Inline a few functions

This commit is contained in:
oupson 2022-10-16 13:26:27 +02:00
parent 58ee7769d8
commit 95f6309d37
Signed by: oupson
GPG Key ID: 3BD88615552EFCB7
2 changed files with 6 additions and 0 deletions

View File

@ -22,6 +22,7 @@ trait OptionExt<R> {
}
impl<R> OptionExt<R> for Option<R> {
#[inline]
fn enoent(self) -> IoResult<R> {
match self {
Some(r) => Ok(r),
@ -82,6 +83,7 @@ impl EncryptedFs {
}
}
#[inline]
fn get_path(&self, ino: u64) -> Option<&PathBuf> {
self.inode_cache.get_path(ino)
}
@ -119,6 +121,7 @@ impl EncryptedFs {
})
}
#[inline]
fn lookup_impl(
&mut self,
parent: u64,
@ -146,6 +149,7 @@ impl EncryptedFs {
}
}
#[inline]
fn read_dir_impl(
&mut self,
ino: u64,
@ -213,6 +217,7 @@ impl EncryptedFs {
Ok(())
}
#[inline]
fn read_impl(
&mut self,
ino: u64,

View File

@ -68,6 +68,7 @@ impl ContentEnc {
}
/// Return the decrypted size of a file, based on the encrypted size.
#[inline]
pub fn get_real_size(encrypted_size: u64) -> u64 {
if encrypted_size == 0 {
0