pub struct FxFilesystem { /* private fields */ }Implementations§
Source§impl FxFilesystem
impl FxFilesystem
pub async fn new_empty(device: DeviceHolder) -> Result<OpenFxFilesystem, Error>
pub async fn open(device: DeviceHolder) -> Result<OpenFxFilesystem, Error>
pub fn root_parent_store(&self) -> Arc<ObjectStore> ⓘ
pub fn layer_pager(&self) -> Option<&Arc<dyn LayerPager>>
pub async fn close(&self) -> Result<(), Error>
pub fn device(&self) -> Arc<dyn Device> ⓘ
pub fn root_store(&self) -> Arc<ObjectStore> ⓘ
pub fn allocator(&self) -> Arc<Allocator> ⓘ
Sourcepub fn enable_allocations(&self)
pub fn enable_allocations(&self)
Enables allocations for the allocator. This is only used in image_builder_mode where it must be called before any allocations can take place.
pub fn object_manager(&self) -> &Arc<ObjectManager> ⓘ
pub fn journal(&self) -> &Arc<Journal> ⓘ
pub async fn sync(&self, options: SyncOptions<'_>) -> Result<(), Error>
pub fn block_size(&self) -> BlockSize
pub fn get_info(&self) -> Info
pub fn super_block_header(&self) -> SuperBlockHeader
pub fn graveyard(&self) -> &Arc<Graveyard> ⓘ
pub fn trace(&self) -> bool
pub fn options(&self) -> &Options
pub fn scope(&self) -> &Scope
Sourcepub async fn lock_commits(&self) -> MutexGuard<'_, ()>
pub async fn lock_commits(&self) -> MutexGuard<'_, ()>
Returns a guard that must be taken before any transaction can commence. This guard takes a
shared lock on the filesystem. fsck will take an exclusive lock so that it can get a
consistent picture of the filesystem that it can verify. It is important that this lock is
acquired before all other locks. It is also important that this lock is not taken twice
by the same task since that can lead to deadlocks if another task tries to take a write
lock.
pub async fn commit_transaction<R: Send>( &self, transaction: &mut Transaction<'_>, callback: impl FnOnce(u64) -> R + Send, ) -> Result<R, Error>
pub fn lock_manager(&self) -> &LockManager
pub fn hooks(&self) -> &Arc<HooksHandle> ⓘ
Source§impl FxFilesystem
impl FxFilesystem
pub async fn truncate_guard( &self, store_id: u64, object_id: u64, ) -> TruncateGuard<'_>
pub async fn truncate_guard_owned( self: &Arc<Self>, store_id: u64, object_id: u64, ) -> TruncateGuard<'static>
Sourcepub async fn tombstone_object(
&self,
store_id: u64,
object_id: u64,
truncate_guard: Option<&TruncateGuard<'_>>,
) -> Result<(), Error>
pub async fn tombstone_object( &self, store_id: u64, object_id: u64, truncate_guard: Option<&TruncateGuard<'_>>, ) -> Result<(), Error>
Immediately tombstones (purges) an object in the graveyard, deallocating its extents,
removing its graveyard entry, and inserting an LSM-tree tombstone record
(ObjectValue::None) that deletes all remaining records for the object during compaction.
Use this when space should be reclaimed immediately (e.g. when deleting a volume or
unlinking a file with no open references) or when the background graveyard reaper is not
running. Use Graveyard::queue_tombstone_object instead when tombstoning from a
non-async context (such as Drop) or when work can be deferred to the background (such as
initial mount-time reaping).
Sourcepub async fn tombstone_attribute(
&self,
store_id: u64,
object_id: u64,
attribute_id: AttributeId,
) -> Result<(), Error>
pub async fn tombstone_attribute( &self, store_id: u64, object_id: u64, attribute_id: AttributeId, ) -> Result<(), Error>
Immediately tombstones (purges) an attribute in the graveyard, deallocating its extents,
removing its graveyard entry, and inserting an LSM-tree tombstone record
(ObjectValue::None) that deletes the attribute record during compaction.
See FxFilesystem::tombstone_object for when to use this vs.
Graveyard::queue_tombstone_attribute.
Trait Implementations§
Source§impl Filesystem for FxFilesystem
impl Filesystem for FxFilesystem
Source§fn is_remote(&self) -> bool
fn is_remote(&self) -> bool
Source§fn ensure_local(&self) -> &FxFilesystem
fn ensure_local(&self) -> &FxFilesystem
FxFilesystem instance. Read moreSource§fn layer_pager(&self) -> Option<&Arc<dyn LayerPager>>
fn layer_pager(&self) -> Option<&Arc<dyn LayerPager>>
Source§fn queue_tombstone_object(&self, store_object_id: u64, object_id: u64)
fn queue_tombstone_object(&self, store_object_id: u64, object_id: u64)
Source§fn tombstone_object<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
store_object_id: u64,
object_id: u64,
truncate_guard: Option<&'life1 TruncateGuard<'life2>>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn tombstone_object<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
store_object_id: u64,
object_id: u64,
truncate_guard: Option<&'life1 TruncateGuard<'life2>>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn block_size(&self) -> BlockSize
fn block_size(&self) -> BlockSize
Source§fn sync<'life0, 'life1, 'async_trait>(
&'life0 self,
options: SyncOptions<'life1>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn sync<'life0, 'life1, 'async_trait>(
&'life0 self,
options: SyncOptions<'life1>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn truncate_guard<'life0, 'async_trait>(
&'life0 self,
store_id: u64,
object_id: u64,
) -> Pin<Box<dyn Future<Output = TruncateGuard<'_>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn truncate_guard<'life0, 'async_trait>(
&'life0 self,
store_id: u64,
object_id: u64,
) -> Pin<Box<dyn Future<Output = TruncateGuard<'_>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§impl TransactionSink for FxFilesystem
impl TransactionSink for FxFilesystem
Source§fn new_transaction<'a, 'async_trait>(
self: Arc<Self>,
txn_locks: LockKeys,
options: Options<'a>,
) -> Pin<Box<dyn Future<Output = Result<Transaction<'a>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
fn new_transaction<'a, 'async_trait>(
self: Arc<Self>,
txn_locks: LockKeys,
options: Options<'a>,
) -> Pin<Box<dyn Future<Output = Result<Transaction<'a>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
txn_locks. See Options for details.Source§fn check_space<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn check_space<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn reserve(
&self,
owner_object_id: Option<u64>,
amount: u64,
) -> Option<Reservation>
fn reserve( &self, owner_object_id: Option<u64>, amount: u64, ) -> Option<Reservation>
None if there is insufficient space.Source§fn image_builder_mode(&self) -> bool
fn image_builder_mode(&self) -> bool
Source§fn commit<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
transaction: &'life1 mut Transaction<'life2>,
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn commit<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
transaction: &'life1 mut Transaction<'life2>,
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn commit_with_callback<'a, 'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
transaction: &'life1 mut Transaction<'life2>,
callback: Box<dyn FnOnce(u64) + Send + 'a>,
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn commit_with_callback<'a, 'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
transaction: &'life1 mut Transaction<'life2>,
callback: Box<dyn FnOnce(u64) + Send + 'a>,
) -> Pin<Box<dyn Future<Output = Result<u64, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self::commit, but invokes a callback upon completion, before dropping locks.Source§fn downgrade_locks(&self, lock_keys: &LockKeys)
fn downgrade_locks(&self, lock_keys: &LockKeys)
Source§fn drop_transaction(&self, transaction: &mut Transaction<'_>)
fn drop_transaction(&self, transaction: &mut Transaction<'_>)
Transaction::drop, allowing for additional work to be
performed on drop.Source§fn lock_manager(&self) -> &LockManager
fn lock_manager(&self) -> &LockManager
Source§fn transaction_limiter(&self) -> &TransactionConcurrencyLimiter
fn transaction_limiter(&self) -> &TransactionConcurrencyLimiter
Source§fn metadata_reservation(&self) -> Option<&Reservation>
fn metadata_reservation(&self) -> Option<&Reservation>
Source§fn is_system_store(&self, store_id: u64) -> bool
fn is_system_store(&self, store_id: u64) -> bool
store_id is a system store (root_store or root_parent_store).Auto Trait Implementations§
impl !Freeze for FxFilesystem
impl !RefUnwindSafe for FxFilesystem
impl !UnwindSafe for FxFilesystem
impl Send for FxFilesystem
impl Sync for FxFilesystem
impl Unpin for FxFilesystem
impl UnsafeUnpin for FxFilesystem
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<F, N> FidlIntoNative<Box<N>> for Fwhere
F: FidlIntoNative<N>,
impl<F, N> FidlIntoNative<Box<N>> for Fwhere
F: FidlIntoNative<N>,
fn fidl_into_native(self) -> Box<N>
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> ⓘ
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> ⓘ
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