pub struct LinuxWritableEngine<B, S> { /* private fields */ }Expand description
Writable existing-file engine with injected durable local staging.
Implementations§
Source§impl<B, S> LinuxWritableEngine<B, S>where
B: CloudFilesBackend + 'static,
S: LinuxWritebackStore + 'static,
impl<B, S> LinuxWritableEngine<B, S>where
B: CloudFilesBackend + 'static,
S: LinuxWritebackStore + 'static,
Sourcepub async fn activate(
readonly: LinuxReadOnlyEngine<B>,
store: Arc<S>,
session_generation: SessionGeneration,
) -> Result<Self>
pub async fn activate( readonly: LinuxReadOnlyEngine<B>, store: Arc<S>, session_generation: SessionGeneration, ) -> Result<Self>
Activates one mount generation and restores durable dirty snapshots before exposure.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub async fn activate_with_namespace<N>(
readonly: LinuxReadOnlyEngine<B>,
store: Arc<S>,
namespace_store: Arc<N>,
session_generation: SessionGeneration,
) -> Result<Self>where
N: LinuxNamespaceMutationStore + 'static,
pub async fn activate_with_namespace<N>(
readonly: LinuxReadOnlyEngine<B>,
store: Arc<S>,
namespace_store: Arc<N>,
session_generation: SessionGeneration,
) -> Result<Self>where
N: LinuxNamespaceMutationStore + 'static,
Activates writeback plus a durable namespace port for native regular-file creation.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub async fn activate_with_namespace_and_remote<N>(
readonly: LinuxReadOnlyEngine<B>,
store: Arc<S>,
namespace_store: Arc<N>,
remote_entries: Vec<LinuxRemoteEntry>,
session_generation: SessionGeneration,
) -> Result<Self>where
N: LinuxNamespaceMutationStore + 'static,
pub async fn activate_with_namespace_and_remote<N>(
readonly: LinuxReadOnlyEngine<B>,
store: Arc<S>,
namespace_store: Arc<N>,
remote_entries: Vec<LinuxRemoteEntry>,
session_generation: SessionGeneration,
) -> Result<Self>where
N: LinuxNamespaceMutationStore + 'static,
Activates namespace/writeback state with product-persisted remote inode mappings.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub fn readonly(&self) -> &LinuxReadOnlyEngine<B>
pub fn readonly(&self) -> &LinuxReadOnlyEngine<B>
Returns the underlying read-only engine used for metadata and directory operations.
Sourcepub fn session_generation(&self) -> SessionGeneration
pub fn session_generation(&self) -> SessionGeneration
Returns the durable mount generation that owns this engine’s writeback sessions.
Sourcepub async fn restore_remote_overlay(
&self,
entries: impl IntoIterator<Item = LinuxRemoteEntry>,
) -> Result<()>
pub async fn restore_remote_overlay( &self, entries: impl IntoIterator<Item = LinuxRemoteEntry>, ) -> Result<()>
Restores product-persisted remote entries before the mount is exposed to the kernel.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub async fn apply_remote_change(
&self,
change: LinuxRemoteChange,
) -> Result<Vec<LinuxInvalidation>>
pub async fn apply_remote_change( &self, change: LinuxRemoteChange, ) -> Result<Vec<LinuxInvalidation>>
Applies one already-durable remote namespace transition and returns kernel invalidations.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub async fn getattr(
&self,
inode: LinuxInode,
handle: Option<LinuxFileHandle>,
) -> Result<LinuxNode>
pub async fn getattr( &self, inode: LinuxInode, handle: Option<LinuxFileHandle>, ) -> Result<LinuxNode>
Loads attributes, overlaying the current staged size when a writable handle is supplied.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub async fn lookup(&self, parent: LinuxInode, name: &str) -> Result<LinuxNode>
pub async fn lookup(&self, parent: LinuxInode, name: &str) -> Result<LinuxNode>
Resolves one child and overlays its current dirty staging size.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub async fn open_file(
&self,
inode: LinuxInode,
access: LinuxFileAccess,
) -> Result<LinuxFileHandle>
pub async fn open_file( &self, inode: LinuxInode, access: LinuxFileAccess, ) -> Result<LinuxFileHandle>
Opens an existing file for remote reads or durable local writeback.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub async fn create_file(
&self,
parent: LinuxInode,
name: &str,
mode: u32,
umask: u32,
access: LinuxFileAccess,
) -> Result<(LinuxNode, LinuxFileHandle)>
pub async fn create_file( &self, parent: LinuxInode, name: &str, mode: u32, umask: u32, access: LinuxFileAccess, ) -> Result<(LinuxNode, LinuxFileHandle)>
Atomically accepts a durable regular-file create and returns its entry plus open handle.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub async fn create_directory(
&self,
parent: LinuxInode,
name: &str,
mode: u32,
umask: u32,
) -> Result<LinuxNode>
pub async fn create_directory( &self, parent: LinuxInode, name: &str, mode: u32, umask: u32, ) -> Result<LinuxNode>
Atomically accepts a durable directory create and exposes its stable inode.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub async fn rename(
&self,
parent: LinuxInode,
name: &str,
new_parent: LinuxInode,
new_name: &str,
no_replace: bool,
) -> Result<()>
pub async fn rename( &self, parent: LinuxInode, name: &str, new_parent: LinuxInode, new_name: &str, no_replace: bool, ) -> Result<()>
Atomically renames or moves one namespace entry while preserving stable identity.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub async fn remove(
&self,
parent: LinuxInode,
name: &str,
expected_kind: LinuxNodeKind,
) -> Result<()>
pub async fn remove( &self, parent: LinuxInode, name: &str, expected_kind: LinuxNodeKind, ) -> Result<()>
Atomically accepts unlink or rmdir and hides the durable tombstone from new lookups.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub async fn open_directory(
&self,
inode: LinuxInode,
) -> Result<LinuxDirectoryHandle>
pub async fn open_directory( &self, inode: LinuxInode, ) -> Result<LinuxDirectoryHandle>
Opens a directory snapshot that includes durable local creates accepted before this call.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub fn directory_snapshot(
&self,
inode: LinuxInode,
handle: LinuxDirectoryHandle,
) -> Result<LinuxDirectorySnapshot>
pub fn directory_snapshot( &self, inode: LinuxInode, handle: LinuxDirectoryHandle, ) -> Result<LinuxDirectorySnapshot>
Returns the immutable writable-directory snapshot for one handle.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub fn release_directory(&self, handle: LinuxDirectoryHandle) -> Result<()>
pub fn release_directory(&self, handle: LinuxDirectoryHandle) -> Result<()>
Releases one writable-directory snapshot handle.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub async fn read_file(
&self,
inode: LinuxInode,
handle: LinuxFileHandle,
offset: u64,
size: u32,
) -> Result<Bytes>
pub async fn read_file( &self, inode: LinuxInode, handle: LinuxFileHandle, offset: u64, size: u32, ) -> Result<Bytes>
Reads from the remote revision or current durable staging, depending on the handle mode.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub async fn write_file(
&self,
inode: LinuxInode,
handle: LinuxFileHandle,
offset: u64,
bytes: Bytes,
) -> Result<u32>
pub async fn write_file( &self, inode: LinuxInode, handle: LinuxFileHandle, offset: u64, bytes: Bytes, ) -> Result<u32>
Durably applies a positioned write before reporting accepted bytes to FUSE.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub async fn truncate_file(
&self,
inode: LinuxInode,
handle: LinuxFileHandle,
size: u64,
) -> Result<LinuxNode>
pub async fn truncate_file( &self, inode: LinuxInode, handle: LinuxFileHandle, size: u64, ) -> Result<LinuxNode>
Durably truncates or extends the staged file.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub async fn truncate_once(
&self,
inode: LinuxInode,
size: u64,
) -> Result<LinuxNode>
pub async fn truncate_once( &self, inode: LinuxInode, size: u64, ) -> Result<LinuxNode>
Opens, truncates, and releases one existing file for handle-less setattr requests.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub async fn sync_file(
&self,
inode: LinuxInode,
handle: LinuxFileHandle,
data_only: bool,
) -> Result<()>
pub async fn sync_file( &self, inode: LinuxInode, handle: LinuxFileHandle, data_only: bool, ) -> Result<()>
Applies an idempotent flush or explicit fsync durability boundary.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub async fn release_file(&self, handle: LinuxFileHandle) -> Result<()>
pub async fn release_file(&self, handle: LinuxFileHandle) -> Result<()>
Releases one file handle and its product-owned writeback session.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.