pub struct GitFs {
pub repos_dir: PathBuf,
pub mount_point: PathBuf,
pub repos_map: DashMap<String, u16>,
pub handles: FileHandles,
/* private fields */
}Fields§
§repos_dir: PathBuf§mount_point: PathBufUse helpers self.insert_repo and self.delete_repo
<repo_id, repo>
repos_map: DashMap<String, u16>Use helpers self.insert_repo and self.delete_repo
<repo_name, repo_id>
handles: FileHandlesImplementations§
Source§impl GitFs
impl GitFs
pub fn new( repos_dir: PathBuf, mount_point: PathBuf, read_only: bool, notifier: Arc<OnceLock<Notifier>>, ) -> Result<Arc<Self>>
pub fn load_repo(&self, repo_name: &str) -> Result<()>
pub fn new_repo( &self, repo_name: &str, url: Option<&str>, ) -> Result<Arc<GitRepo>>
pub fn open( &self, ino: u64, read: bool, write: bool, truncate: bool, ) -> Result<u64>
pub fn opendir(&self, ino: u64) -> Result<u64>
pub fn readlink(&self, ino: u64) -> Result<Vec<u8>>
pub fn read( &self, ino: u64, offset: u64, buf: &mut [u8], fh: u64, ) -> Result<usize>
pub fn write(&self, ino: u64, offset: u64, buf: &[u8], fh: u64) -> Result<usize>
pub fn release(&self, fh: u64) -> Result<bool>
pub fn getattr(&self, target: u64) -> Result<FileAttr>
pub fn mkdir(&self, parent: u64, os_name: &OsStr) -> Result<FileAttr>
pub fn link( &self, ino: u64, newparent: u64, newname: &OsStr, ) -> Result<FileAttr>
pub fn create( &self, parent: u64, name: &OsStr, read: bool, write: bool, ) -> Result<(FileAttr, u64)>
pub fn unlink(&self, parent: u64, name: &OsStr) -> Result<()>
pub fn rename( &self, parent: u64, name: &OsStr, new_parent: u64, new_name: &OsStr, ) -> Result<()>
pub fn rmdir(&self, parent: u64, name: &OsStr) -> Result<()>
pub fn readdir(&self, parent: u64) -> Result<Vec<DirectoryEntry>>
pub fn readdirplus(&self, parent: u64) -> Result<Vec<DirectoryEntryPlus>>
pub fn lookup(&self, parent: u64, name: &OsStr) -> Result<Option<FileAttr>>
pub fn copy_file_range( &self, ino_in: u64, fh_in: u64, off_in: u64, ino_out: u64, fh_out: u64, off_out: u64, len: u64, ) -> Result<usize>
pub fn prepare_virtual_file(&self, ino: VirtualIno) -> Result<FileAttr>
pub fn prepare_virtual_folder(&self, attr: FileAttr) -> Result<FileAttr>
Source§impl GitFs
impl GitFs
pub fn insert_repo( &self, repo: &Arc<GitRepo>, repo_name: &str, repo_id: u16, ) -> Result<()>
pub fn delete_repo(&self, repo_name: &str) -> Result<()>
pub fn update_repo(&self, repo_name: &str, remote: Option<String>) -> Result<()>
pub fn refresh_medata_using_path<P: AsRef<Path>>( &self, path: P, ino_flag: InoFlag, ) -> Result<FileAttr>
Sourcepub fn refresh_metadata_from_disk(&self, ino: NormalIno) -> Result<FileAttr>
pub fn refresh_metadata_from_disk(&self, ino: NormalIno) -> Result<FileAttr>
Finds the file on disk using an inode
pub fn update_db_metadata( &self, stored_attr: SetFileAttr, ) -> Result<DbReturn<FileAttr>>
pub fn get_repo(&self, ino: u64) -> Result<Arc<GitRepo>>
Sourcepub fn get_parent_commit(&self, ino: u64) -> Result<Oid>
pub fn get_parent_commit(&self, ino: u64) -> Result<Oid>
Used in InoFlag::InsideSnap.
Will go up the directory tree and the commit_oid from the root Snap folder
Sourcepub fn is_active(&self, target_ino: u64) -> Result<bool>
pub fn is_active(&self, target_ino: u64) -> Result<bool>
Used bu release
When releasing a filehandle, returns true if the inode can safely be deleted from storage
pub fn count_children(&self, parent_ino: NormalIno) -> Result<usize>
pub fn read_children( &self, parent_ino: NormalIno, build_dir: bool, ) -> Result<Vec<DirectoryEntry>>
pub fn get_all_parents(&self, ino: u64) -> Result<Vec<u64>>
pub fn get_single_parent(&self, ino: u64) -> Result<u64>
pub fn repo_id_to_ino(repo_id: u16) -> u64
pub fn ino_to_repo_id(ino: u64) -> u16
pub fn get_metadata_by_name( &self, parent_ino: NormalIno, child_name: &OsStr, ) -> Result<DbReturn<FileAttr>>
pub fn get_metadata(&self, target_ino: u64) -> Result<DbReturn<FileAttr>>
Sourcepub fn exists(&self, ino: Inodes) -> Result<bool>
pub fn exists(&self, ino: Inodes) -> Result<bool>
Takes Inodes as virtual inodes do not “exist”
pub fn is_virtual(&self, ino: u64) -> bool
pub fn write_dentry(&self, dentry: Dentry) -> Result<()>
pub fn parent_commit_build_session(&self, ino: NormalIno) -> Result<Oid>
pub fn get_ino_flag_from_db(&self, ino: NormalIno) -> Result<InoFlag>
pub fn get_name_from_db(&self, ino: u64) -> Result<OsString>
Auto Trait Implementations§
impl !Freeze for GitFs
impl !RefUnwindSafe for GitFs
impl !UnwindSafe for GitFs
impl Send for GitFs
impl Sync for GitFs
impl Unpin for GitFs
impl UnsafeUnpin for GitFs
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more