class BlobfsTestSetupBase

Defined at line 44 of file ../../src/storage/blobfs/test/blobfs_test_setup.h

Provides the base Blobfs setup without providing a message loop. See the variants below.

Blobfs shutdown is tricky. The message loop must process any pending messages (so the vmo free

notifications can be delivered and the Blobs can unregister themselves first). Then, the VFS

instance must be shut down to make sure the pager threads are terminated and that there are no

outstanding references to blobs. Then the Blobfs instance can be deleted. This must happen in the

derived class' destructors so the loop gets destroyed last.

Protected Members

unique_ptr decompressor_connector_
unique_ptr vfs_
unique_ptr blobfs_

Public Methods

zx_status_t CreateFormatMount (uint64_t block_count, uint64_t block_size, const FilesystemOptions & fs_options, const MountOptions & mount_options)

Creates a fake block device, formats it with the given options, and mounts it.

Defined at line 30 of file ../../src/storage/blobfs/test/blobfs_test_setup.cc

zx_status_t Mount (std::unique_ptr<BlockDevice> device, const MountOptions & options)

Defined at line 39 of file ../../src/storage/blobfs/test/blobfs_test_setup.cc

async::Loop & loop ()

Defined at line 46 of file ../../src/storage/blobfs/test/blobfs_test_setup.h

async_dispatcher_t * dispatcher ()

Defined at line 47 of file ../../src/storage/blobfs/test/blobfs_test_setup.h

fs::PagedVfs * vfs ()

These pointers will be null when not mounted.

Defined at line 50 of file ../../src/storage/blobfs/test/blobfs_test_setup.h

Blobfs * blobfs ()

Defined at line 51 of file ../../src/storage/blobfs/test/blobfs_test_setup.h

std::unique_ptr<BlockDevice> Unmount ()

Defined at line 78 of file ../../src/storage/blobfs/test/blobfs_test_setup.cc

zx::result<DecompressorCreatorConnector *> GetDecompressorCreatorConnector ()

Initializes the decompressor creator if needed and returns a connector.

Defined at line 67 of file ../../src/storage/blobfs/test/blobfs_test_setup.cc

zx_status_t Remount (const MountOptions & options)

Unmounts and remounts using the given options.

Any Blob references that the test holds will need to be released before this function is

called or the BlobCache destructor will assert that there are live blobs.

Defined at line 85 of file ../../src/storage/blobfs/test/blobfs_test_setup.cc

Protected Methods

async::Loop & GetLoop ()

Provided by the derived classes that set up the loop.

void ShutdownVfs ()