struct ramdisk_client
Defined at line 51 of file ../../src/storage/lib/ramdevice_client/cpp/ramdisk.cc
TODO(https://446695911): Remove the C interface. Clients should use `ramdevice_client::Ramdisk`.
A client library for creating, configuring and manipulating ramdisks.
When creating a ramdisk always wait for the ramctl device to be ready to avoid racing with
device start up. The ramctl device is normally located at "sys/platform/ram-disk/ramctl".
```
ASSERT_EQ(ZX_OK, device_watcher::RecursiveWaitForFile("/dev/sys/platform/ram-disk/ramctl",
zx::sec(60)).status_value());
```
Then a ram device can be created and opened.
```
ramdisk_client_t* client;
ASSERT_EQ(ramdisk_create(512, 2048,
&client
), ZX_OK);
zx_handle_t block_client = ramdisk_get_block_interface(client);
```
Public Methods
ramdisk_client & operator= (const ramdisk_client & )
Defined at line 53 of file ../../src/storage/lib/ramdevice_client/cpp/ramdisk.cc
ramdisk_client & operator= (ramdisk_client && )
Defined at line 53 of file ../../src/storage/lib/ramdevice_client/cpp/ramdisk.cc
void ramdisk_client (const ramdisk_client & )
Defined at line 53 of file ../../src/storage/lib/ramdevice_client/cpp/ramdisk.cc
void ramdisk_client (ramdisk_client && )
Defined at line 53 of file ../../src/storage/lib/ramdevice_client/cpp/ramdisk.cc
zx_status_t Create (int dev_root_fd, std::string_view instance_name, zx::duration duration, std::unique_ptr<ramdisk_client> * out)
Defined at line 55 of file ../../src/storage/lib/ramdevice_client/cpp/ramdisk.cc
zx_status_t CreateV2 (fidl::ClientEnd<fuchsia_io::Directory> outgoing_directory, zx::eventpair lifeline, std::unique_ptr<ramdisk_client> * out)
Defined at line 117 of file ../../src/storage/lib/ramdevice_client/cpp/ramdisk.cc
zx_status_t Rebind ()
Defined at line 155 of file ../../src/storage/lib/ramdevice_client/cpp/ramdisk.cc
zx_status_t Destroy ()
Defined at line 196 of file ../../src/storage/lib/ramdevice_client/cpp/ramdisk.cc
zx_status_t Forget ()
Destroy all open handles to the ramdisk, while leaving the ramdisk itself attached.
After calling this method, destroying this object will have no effect.
Defined at line 220 of file ../../src/storage/lib/ramdevice_client/cpp/ramdisk.cc
zx::result<fidl::ClientEnd<fuchsia_storage_block::Block>> Connect ()
Defined at line 230 of file ../../src/storage/lib/ramdevice_client/cpp/ramdisk.cc
fidl::UnownedClientEnd<fuchsia_device::Controller> controller_interface ()
Defined at line 242 of file ../../src/storage/lib/ramdevice_client/cpp/ramdisk.cc
fidl::UnownedClientEnd<fuchsia_hardware_ramdisk::Ramdisk> ramdisk_interface ()
Defined at line 246 of file ../../src/storage/lib/ramdevice_client/cpp/ramdisk.cc
fidl::UnownedClientEnd<fuchsia_storage_block::Block> block_interface ()
Defined at line 250 of file ../../src/storage/lib/ramdevice_client/cpp/ramdisk.cc
fidl::UnownedClientEnd<fuchsia_device::Controller> block_controller_interface ()
Defined at line 254 of file ../../src/storage/lib/ramdevice_client/cpp/ramdisk.cc
const fbl::String & path ()
Defined at line 258 of file ../../src/storage/lib/ramdevice_client/cpp/ramdisk.cc
void ~ramdisk_client ()
Defined at line 260 of file ../../src/storage/lib/ramdevice_client/cpp/ramdisk.cc