class NdmBaseDriver
Defined at line 101 of file ../../src/storage/lib/ftl/ftln/ndm-driver.h
Base functionality for a driver implementation.
Public Methods
void NdmBaseDriver (FtlLogger logger)
Defined at line 103 of file ../../src/storage/lib/ftl/ftln/ndm-driver.h
bool volume_data_saved ()
Returns true when volume data is saved on disk, either from a previous run
or written by this run.
Defined at line 151 of file ../../src/storage/lib/ftl/ftln/ndm-driver.h
void ~NdmBaseDriver ()
Defined at line 210 of file ../../src/storage/lib/ftl/ftln/ndm-driver.cc
bool IsNdmDataPresent (const VolumeOptions & options, bool use_format_v2)
Returns true if known data appears to be present on the device. This does
not imply that creating a volume will not find errors, just that calling
CreateNdmVolume after this method returns false will result in a freshly
minted (aka empty) volume.
This method should be called after Init(), but before CreateNdmVolume(),
for the result to be meaningful, but calling this is not required.
|use_format_v2| tells NDM to use the latest file format for the volume, if
a new volume is eventually created.
Defined at line 212 of file ../../src/storage/lib/ftl/ftln/ndm-driver.cc
bool BadBbtReservation ()
Returns true if the size of the bad block reservation cannot be used.
The size to use (options.max_bad_blocks) may be too small to hold the
current known bad blocks, or some internal value may be inconsistent if
this size is used.
This only makes sense when comparing the desired options with the data
already stored on a volume, and in general should only be used to attempt
to reduce the reserved space (increasing it would reduce the size of the
visible volume, and that is not supported).
This method should only be called right after calling IsNdmDataPresent(),
before calling CreateNdmVolume().
Defined at line 221 of file ../../src/storage/lib/ftl/ftln/ndm-driver.cc
const char * CreateNdmVolume (const Volume * ftl_volume, const VolumeOptions & options, bool save_volume_data)
Creates the underlying NDM volume, with the provided parameters. Setting
|save_volume_data| to true enables writing of NDM control data version 2.
Defined at line 236 of file ../../src/storage/lib/ftl/ftln/ndm-driver.cc
bool RemoveNdmVolume ()
Deletes the underlying NDM volume.
Defined at line 296 of file ../../src/storage/lib/ftl/ftln/ndm-driver.cc
bool SaveBadBlockData ()
Saves and restores bad block data for volume extension.
Defined at line 304 of file ../../src/storage/lib/ftl/ftln/ndm-driver.cc
bool RestoreBadBlockData ()
Defined at line 306 of file ../../src/storage/lib/ftl/ftln/ndm-driver.cc
bool IsEmptyPageImpl (const uint8_t * data, uint32_t data_len, const uint8_t * spare, uint32_t spare_len)
Inspects |data_len| bytes from |data| and |spare_len| bytes from |spare|
looking for a typical empty (erased) page. Returns true if all bits are 1.
Defined at line 308 of file ../../src/storage/lib/ftl/ftln/ndm-driver.cc
const VolumeOptions * GetSavedOptions ()
Returns the settings used for the volume. The NDM volume has to be created
with |save_volume_data| set to true.
Defined at line 328 of file ../../src/storage/lib/ftl/ftln/ndm-driver.cc
bool WriteVolumeData ()
Writes volume information to storage. Returns true on success.
This should only be called after a successful call to CreateNdmVolume with
save_volume_data set to true.
Defined at line 346 of file ../../src/storage/lib/ftl/ftln/ndm-driver.cc
bool IncompletePageWrite (uint8_t * spare)
Defined at line 386 of file ../../src/storage/lib/ftl/ftln/ndm-driver.cc
uint32_t PageSize ()
Defined at line 382 of file ../../src/storage/lib/ftl/ftln/ndm-driver.cc
uint8_t SpareSize ()
Defined at line 384 of file ../../src/storage/lib/ftl/ftln/ndm-driver.cc
Protected Methods
ndm * GetNdmForTest ()
This is exposed for unit tests only.
Defined at line 165 of file ../../src/storage/lib/ftl/ftln/ndm-driver.h
void FillNdmDriver (const VolumeOptions & options, bool use_format_v2, NDMDrvr * driver)
This is exposed for unit tests only.
Defined at line 354 of file ../../src/storage/lib/ftl/ftln/ndm-driver.cc