pub struct VolumeMapper { /* private fields */ }Expand description
Manages a driver-backed MapperSession for an EROFS volume.
Implementations§
Source§impl VolumeMapper
impl VolumeMapper
Sourcepub fn new(
session: MapperSessionSynchronousProxy,
mapping_vmo: Vmo,
file_offset: u64,
) -> Result<Self, Status>
pub fn new( session: MapperSessionSynchronousProxy, mapping_vmo: Vmo, file_offset: u64, ) -> Result<Self, Status>
Creates a new VolumeMapper over an established MapperSession and its mapping_vmo.
Sourcepub fn open_with_session(
file_offset: u64,
open_fn: impl FnOnce(Vmo, ServerEnd<MapperSessionMarker>) -> Result<(), Status>,
) -> Result<Self, Status>
pub fn open_with_session( file_offset: u64, open_fn: impl FnOnce(Vmo, ServerEnd<MapperSessionMarker>) -> Result<(), Status>, ) -> Result<Self, Status>
Allocates a mapping_vmo, invokes open_fn to bind the server end of a MapperSession,
and returns the initialized VolumeMapper.
Sourcepub fn get_or_create_vmo(
&self,
fs: &ErofsFilesystem,
node: &FileNode,
) -> Result<Vmo, Status>
pub fn get_or_create_vmo( &self, fs: &ErofsFilesystem, node: &FileNode, ) -> Result<Vmo, Status>
Returns a read-only VMO handle for node.
Driver-backed pager VMOs (FlatPlain and FlatInline) are cached in vmos_by_nid for the
lifetime of the VolumeMapper so that their driver mappings stay registered even if a VFS
node is evicted while a process still has the VMO mapped, and so subsequent opens reuse the
existing VMO. Anonymous VMOs created for empty or compressed files (key == None) are
returned directly so their memory can be reclaimed once the caller drops the VMO.
Sourcepub fn close_file(&self, key: u64)
pub fn close_file(&self, key: u64)
Closes a previously mapped file key in both the block driver and BlobPagerAndVerifier.
Auto Trait Implementations§
impl !Freeze for VolumeMapper
impl !RefUnwindSafe for VolumeMapper
impl Send for VolumeMapper
impl Sync for VolumeMapper
impl Unpin for VolumeMapper
impl UnsafeUnpin for VolumeMapper
impl UnwindSafe for VolumeMapper
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
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
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