class RamdiskRef

Defined at line 132 of file ../../src/storage/fvm/test_support.h

Provides a Ramdisk device that is destroyed upon leaving the scope.

Public Methods

std::unique_ptr<RamdiskRef> Create (const fbl::unique_fd & devfs_root, uint64_t block_size, uint64_t block_count, std::optional<zx::vmo> vmo)

Creates a block device with the respective block count and size. If `vmo` is specified,

the size of the `vmo` must be `block_size * block_count`.

Returns nullptr on failure.

Defined at line 108 of file ../../src/storage/fvm/test_support.cc

void RamdiskRef (const fbl::unique_fd & devfs_root, uint64_t block_size, zx::vmo vmo, ramdevice_client::Ramdisk ramdisk)

Defined at line 141 of file ../../src/storage/fvm/test_support.h

void RamdiskRef (const RamdiskRef & )

Defined at line 147 of file ../../src/storage/fvm/test_support.h

void RamdiskRef (RamdiskRef && )

Defined at line 148 of file ../../src/storage/fvm/test_support.h

RamdiskRef & operator= (const RamdiskRef & )

Defined at line 149 of file ../../src/storage/fvm/test_support.h

RamdiskRef & operator= (RamdiskRef && )

Defined at line 150 of file ../../src/storage/fvm/test_support.h

zx::result<std::unique_ptr<RamdiskRef>> Clone (uint64_t target_size)

Clones this ramdisk into a new ram-disk with given `target_size`.

Defined at line 153 of file ../../src/storage/fvm/test_support.cc

zx::result<fidl::ClientEnd<fuchsia_storage_block::Block>> Connect ()

Defined at line 155 of file ../../src/storage/fvm/test_support.h