class Ramdisk
Defined at line 107 of file ../../src/storage/lib/ramdevice_client/cpp/include/ramdevice-client/ramdisk.h
Manages a ramdisk instance.
Public Members
static Options kDefaultOptions
Public Methods
void Ramdisk ()
Defined at line 141 of file ../../src/storage/lib/ramdevice_client/cpp/include/ramdevice-client/ramdisk.h
void Ramdisk (Ramdisk && other)
Defined at line 142 of file ../../src/storage/lib/ramdevice_client/cpp/include/ramdevice-client/ramdisk.h
Ramdisk & operator= (Ramdisk && other)
Defined at line 143 of file ../../src/storage/lib/ramdevice_client/cpp/include/ramdevice-client/ramdisk.h
void ~Ramdisk ()
Defined at line 153 of file ../../src/storage/lib/ramdevice_client/cpp/include/ramdevice-client/ramdisk.h
void Reset ()
Frees the resources associated with the Ramdisk. It is an error to call any methods after this
has been called.
Defined at line 157 of file ../../src/storage/lib/ramdevice_client/cpp/include/ramdevice-client/ramdisk.h
bool is_valid ()
Defined at line 164 of file ../../src/storage/lib/ramdevice_client/cpp/include/ramdevice-client/ramdisk.h
ramdisk_client_t * client ()
TODO(https://fxbug.dev/446695911: Remove.
Defined at line 167 of file ../../src/storage/lib/ramdevice_client/cpp/include/ramdevice-client/ramdisk.h
std::string path ()
Returns the path to the device.
Defined at line 170 of file ../../src/storage/lib/ramdevice_client/cpp/include/ramdevice-client/ramdisk.h
zx::result<> Rebind ()
Reinds the ramdisk (synchronously, so the ramdisk will be ready after this returns).
Defined at line 179 of file ../../src/storage/lib/ramdevice_client/cpp/include/ramdevice-client/ramdisk.h
zx::result<> SleepAfter (uint64_t block_count)
Puts the ramdisk to sleep after |blk_count| blocks written. After this, transactions will no
longer be immediately persisted to disk.
If the |RAMDISK_FLAG_RESUME_ON_WAKE| flag has been set, transactions will be processed when
|ramdisk_wake| is called, otherwise they will fail immediately.
Defined at line 185 of file ../../src/storage/lib/ramdevice_client/cpp/include/ramdevice-client/ramdisk.h
zx::result<> Wake ()
Wakes up the ramdisk.
Defined at line 190 of file ../../src/storage/lib/ramdevice_client/cpp/include/ramdevice-client/ramdisk.h
zx::result<> SetFlags (uint32_t flags)
Sets flags on the ramdisk (see fuchsia.hardware.ramdisk.RamdiskFlag).
Defined at line 193 of file ../../src/storage/lib/ramdevice_client/cpp/include/ramdevice-client/ramdisk.h
zx::result<ramdisk_block_write_counts_t> GetBlockCounts ()
Returns the ramdisk's current failed, successful, and total block counts.
Defined at line 198 of file ../../src/storage/lib/ramdevice_client/cpp/include/ramdevice-client/ramdisk.h
zx::result<Ramdisk> Create (int block_size, uint64_t block_count, std::optional<int> svc_root_fd, const Options & options)
Creates a ram-disk with |block_count| blocks of |block_size| bytes.
`svc_root_fd` can be overridden if desired; otherwise, "/svc" is opened to find
fuchsia.hardware.ramdisk.Service.
Defined at line 550 of file ../../src/storage/lib/ramdevice_client/cpp/ramdisk.cc
zx::result<Ramdisk> CreateLegacy (int block_size, uint64_t block_count, std::optional<int> devfs_root_fd, const Options & options)
Creates a legacy ram-disk with |block_count| blocks of |block_size| bytes.
`devfs_root_fd` can be overridden if desired; otherwise, "/dev" is opened.
Defined at line 569 of file ../../src/storage/lib/ramdevice_client/cpp/ramdisk.cc
zx::result<Ramdisk> CreateWithVmo (zx::vmo vmo, uint64_t block_size, std::optional<int> svc_root_fd, const Options & options)
Creates a ram-disk with the given VMO. If block_size is zero, a default block size is used.
`svc_root_fd` can be overridden if desired; otherwise, "/svc" is opened to find
fuchsia.hardware.ramdisk.Service.
Defined at line 588 of file ../../src/storage/lib/ramdevice_client/cpp/ramdisk.cc
zx::result<Ramdisk> CreateLegacyWithVmo (zx::vmo vmo, uint64_t block_size, std::optional<int> devfs_root_fd, const Options & options)
Creates a ram-disk with the given VMO. If block_size is zero, a default block size is used.
`devfs_root_fd` can be overridden if desired; otherwise, "/dev" is opened.
Defined at line 607 of file ../../src/storage/lib/ramdevice_client/cpp/ramdisk.cc
zx::result<fidl::ClientEnd<fuchsia_storage_block::Block>> ConnectBlock ()
Creates a new connection to the Block protocol served by the ramdisk.
Defined at line 626 of file ../../src/storage/lib/ramdevice_client/cpp/ramdisk.cc
fidl::UnownedClientEnd<fuchsia_device::Controller> LegacyController ()
Gets the Controller proxy for the ramdisk (only valid with legacy ramdisks).
Defined at line 630 of file ../../src/storage/lib/ramdevice_client/cpp/ramdisk.cc