class PageLoader

Defined at line 79 of file ../../src/storage/blobfs/page_loader.h

Encapsulates a user pager, its associated thread and transfer buffer.

Public Methods

void PageLoader (const PageLoader & )

Defined at line 81 of file ../../src/storage/blobfs/page_loader.h

void PageLoader (PageLoader && )

Defined at line 81 of file ../../src/storage/blobfs/page_loader.h

PageLoader & operator= (const PageLoader & )

Defined at line 81 of file ../../src/storage/blobfs/page_loader.h

PageLoader & operator= (PageLoader && )

Defined at line 81 of file ../../src/storage/blobfs/page_loader.h

zx::result<std::unique_ptr<PageLoader>> Create (std::vector<std::unique_ptr<WorkerResources>> resources, BlobfsMetrics * metrics, DecompressorCreatorConnector * decompression_connector)

Creates an instance of PageLoader.

A new thread is created and started to process page fault requests.

|uncompressed_buffer| is used to retrieve and buffer uncompressed data from the underlying

storage. |resources| is a set of resources needed for each individual |Worker| so only as many

pager threads are supported as there are sets of resources. |decompression_buffer_size| is the

size of the scratch buffer to use for decompression. If |decompression_connector| is nullptr,

the driver will be used for decompression.

Defined at line 523 of file ../../src/storage/blobfs/page_loader.cc

PagerErrorStatus TransferPages (const PageSupplier & page_supplier, uint64_t offset, uint64_t length, const LoaderInfo & info)

Invoked on a read request. Reads in the requested byte range [|offset|, |offset| + |length|)

for the inode associated with |info->identifier| into the |transfer_buffer_|, and then moves

those pages to the destination |vmo|. If |verifier_info| is not null, uses it to verify the

pages prior to transferring them to the destination vmo.

How the pages are supplied to the caller is defined by the PageSupplier callback parameter.

If an error is encountered, the error code is returned as a |PagerErrorStatus|. This error code

is communicated to the kernel with the zx_pager_op_range(ZX_PAGER_OP_FAIL) syscall.

|PagerErrorStatus| wraps the supported error codes for ZX_PAGER_OP_FAIL.

1. ZX_ERR_IO - Failure while reading the required data from the block device.

2. ZX_ERR_IO_DATA_INTEGRITY - Failure while verifying the contents read in.

3. ZX_ERR_BAD_STATE - Any other type of failure which prevents us from successfully completing

the page request, e.g. failure while decompressing, or while transferring pages from the

transfer buffer etc.

Defined at line 559 of file ../../src/storage/blobfs/page_loader.cc

Records