pub struct FsMetadataStore { /* private fields */ }Expand description
SochFS Metadata Store
Manages filesystem metadata with ACID guarantees via LSCS system tables.
Implementations§
Source§impl FsMetadataStore
impl FsMetadataStore
Sourcepub fn create_inode(&self, file_type: FileType) -> Result<Inode>
pub fn create_inode(&self, file_type: FileType) -> Result<Inode>
Create a new inode
Sourcepub fn update_inode(&self, inode: &Inode) -> Result<()>
pub fn update_inode(&self, inode: &Inode) -> Result<()>
Update an inode
Sourcepub fn delete_inode(&self, id: InodeId) -> Result<()>
pub fn delete_inode(&self, id: InodeId) -> Result<()>
Delete an inode
Sourcepub fn add_dir_entry(
&self,
parent_id: InodeId,
name: &str,
child_id: InodeId,
file_type: FileType,
) -> Result<()>
pub fn add_dir_entry( &self, parent_id: InodeId, name: &str, child_id: InodeId, file_type: FileType, ) -> Result<()>
Add directory entry
Sourcepub fn remove_dir_entry(&self, parent_id: InodeId, name: &str) -> Result<()>
pub fn remove_dir_entry(&self, parent_id: InodeId, name: &str) -> Result<()>
Remove directory entry
Sourcepub fn list_dir(&self, parent_id: InodeId) -> Vec<DirEntryRow>
pub fn list_dir(&self, parent_id: InodeId) -> Vec<DirEntryRow>
List directory entries
Sourcepub fn lookup(&self, parent_id: InodeId, name: &str) -> Option<InodeId>
pub fn lookup(&self, parent_id: InodeId, name: &str) -> Option<InodeId>
Lookup entry in directory
Sourcepub fn resolve_path(&self, path: &str) -> Result<InodeId>
pub fn resolve_path(&self, path: &str) -> Result<InodeId>
Resolve path to inode
O(d) where d = path depth
Sourcepub fn create_file(&self, parent_id: InodeId, name: &str) -> Result<Inode>
pub fn create_file(&self, parent_id: InodeId, name: &str) -> Result<Inode>
Create file in directory
Sourcepub fn create_dir(&self, parent_id: InodeId, name: &str) -> Result<Inode>
pub fn create_dir(&self, parent_id: InodeId, name: &str) -> Result<Inode>
Create directory in parent
Sourcepub fn delete(&self, parent_id: InodeId, name: &str) -> Result<()>
pub fn delete(&self, parent_id: InodeId, name: &str) -> Result<()>
Delete file or empty directory
Sourcepub fn superblock(&self) -> Superblock
pub fn superblock(&self) -> Superblock
Get superblock
Sourcepub fn update_superblock(&self, sb: &Superblock) -> Result<()>
pub fn update_superblock(&self, sb: &Superblock) -> Result<()>
Update superblock
Sourcepub fn replay_wal_op(&self, op: &FsWalOp) -> Result<()>
pub fn replay_wal_op(&self, op: &FsWalOp) -> Result<()>
Recover from WAL operations
Auto Trait Implementations§
impl !Freeze for FsMetadataStore
impl !RefUnwindSafe for FsMetadataStore
impl Send for FsMetadataStore
impl Sync for FsMetadataStore
impl Unpin for FsMetadataStore
impl !UnwindSafe for FsMetadataStore
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
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