Skip to main content

BlobPagerAndVerifier

Struct BlobPagerAndVerifier 

Source
pub struct BlobPagerAndVerifier { /* private fields */ }
Expand description

Coordinates between FxBlob, the block driver, and the kernel to manage pager-backed blobs such that page requests can be handled at the driver instead of the filesystem layer.

BlobPagerAndVerifier uses a dedicated Pager to create pager-backed VMOs for blobs. Kernel page faults on these VMOs are routed directly to the block driver, which reads and decompresses the raw data. The driver then passes this data back to BlobPagerAndVerifier for cryptographic verification and page fault resolution.

Implementations§

Source§

impl BlobPagerAndVerifier

Source

pub fn delivery_vmo(&self) -> &Vmo

Returns a reference to the shared delivery queue VMO.

Source

pub fn clear_cache(&self)

Evicts all unreferenced blobs from the internal LRU cache.

Source

pub async fn new( mapping_provider: &MappingProviderProxy, mapper: &MapperProxy, ) -> Result<Self, Error>

Creates a new BlobPagerAndVerifier with the default LRU cache capacity.

Establishes a mapping_provider session with FxBlob to receive a shared VMO that will be used to communicate opened blob extent mappings as well as any closed blobs. Then, opens a mapper session with the block driver, forwarding the mapping VMO alongside a Zircon port (for the driver to receive page faults) and a delivery queue VMO (for the driver to emit unverified data for verification).

Source

pub async fn new_with_cache_capacity( mapping_provider: &MappingProviderProxy, mapper: &MapperProxy, cache_capacity: usize, ) -> Result<Self, Error>

Creates a new BlobPagerAndVerifier with the specified unreferenced-blob LRU cache capacity.

Source

pub async fn start_profile( &self, name: impl Into<String>, ) -> Result<ProfileRecording, Status>

Starts recording a profile for name and replaying any existing profile of the same name.

Source

pub async fn record_and_replay_profile( &self, name: impl Into<String>, duration: MonotonicDuration, )

Starts recording and replaying the named profile, stopping and committing the profile in the background after duration elapses.

Source

pub async fn create_vmo(&self, identifier: &[u8; 32]) -> Result<Vmo, Error>

Create pager owned VMO for the blob identified by its Merkle Root Hash.

Source

pub async fn open_child_session( &self, identifier: &[u8; 32], mapping_vmo: Vmo, session: ServerEnd<MapperSessionMarker>, ) -> Result<(), Status>

Opens a child MapperSession backed by the blob identified by its Merkle root hash.

Child VMOs created on session are backed by self.pager and a dedicated child_port passed to the driver. When a child VMO faults, the driver reads the corresponding parent blob chunks and sends DeliveryCommand::ChildData over the shared delivery queue so BlobPagerAndVerifier can verify the parent data before supplying pages to the child VMO.

Source

pub fn get_file_mapper_handler( self: &Arc<Self>, scope: ExecutionScope, ) -> Arc<Service> ⓘ

Returns a VFS vfs::service::Service that serves fuchsia.storage.mapping/FileMapper by resolving vmo_blob::VmoBlob tokens in scope and opening child mapper sessions on self.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

Source§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
Source§

impl<T, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

Source§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoAny for T
where T: 'static + Send + Sync,

Source§

fn into_any(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Cast the given object into a dyn std::any::Any.
Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.