class Volume
Defined at line 34 of file ../../src/storage/lib/ftl/ftln/volume.h
Exposes the upper layer (block device) interface of the FTL.
Public Methods
const char * Init (std::unique_ptr<NdmDriver> driver)
Performs the object initialization. Returns an error string, or nullptr
on success. Will synchronously call FtlInstance::OnVolumeAdded on success.
The |driver| must be fully initialized when passed to this method.
const char * ReAttach ()
Removes the volume and re-attaches to it. This is roughly equivalent to
what a shutdown / restart would to in the real world (this functionality
is basically intended for testing). Returns an error string, or nullptr
on success. Does not Flush() on detach. Will synchronously call
FtlInstance::OnVolumeAdded on success.
zx_status_t Read (uint32_t first_page, int num_pages, void * buffer)
Synchronously Read or Write num_pages starting at first_page.
void Volume ()
Defined at line 63 of file ../../src/storage/lib/ftl/ftln/volume.h
zx_status_t Write (uint32_t first_page, int num_pages, const void * buffer)
zx_status_t Format ()
Issues a command to format the FTL (aka, delete all data).
zx_status_t FormatAndLevel ()
Issues a command to format the FTL (aka, delete all data), and also treat
all blocks as equally leveled (same number of erase cycles). Use this with
caution as losing wear leveling information is normally a bad thing.
zx_status_t Mount ()
Marks the volume as in use (Mount) or not (Unmount).
zx_status_t Unmount ()
zx_status_t Flush ()
Flushes all data to the device.
zx_status_t Trim (uint32_t first_page, uint32_t num_pages)
Marks num_pages starting from first_page as not-needed.
zx_status_t GarbageCollect ()
Goes through one cycle of synchronous garbage collection. Returns ZX_OK
on success and ZX_ERR_STOP where there is no more work to do.
zx_status_t GetStats (Stats * stats)
Returns basic stats about the device.
zx_status_t GetCounters (Counters * stats)
Returns basic counters about the device.
zx_status_t GetNewWearLeveling (bool * state)
Returns the status of using the new wear leveling algorithm.
zx_status_t SetNewWearLeveling (bool state)
Sets the new wear leveling algorithm on or off.
void ~Volume ()
Defined at line 64 of file ../../src/storage/lib/ftl/ftln/volume.h