mirror of https://github.com/ARMmbed/mbed-os.git
bd: Added trim function to let filesystems give erase hints to FTLs
parent
e798c5359e
commit
6e1b9e153c
|
@ -96,6 +96,22 @@ public:
|
|||
return 0;
|
||||
}
|
||||
|
||||
/** Mark blocks as no longer in use
|
||||
*
|
||||
* This function provides a hint to the underlying block device that a region of blocks
|
||||
* is no longer in use and may be erased without side effects. Erase must still be called
|
||||
* before programming, but trimming allows flash-translation-layers to schedule erases when
|
||||
* the device is not busy.
|
||||
*
|
||||
* @param addr Address of block to mark as unused
|
||||
* @param size Size to mark as unused in bytes, must be a multiple of erase block size
|
||||
* @return 0 on success, negative error code on failure
|
||||
*/
|
||||
virtual int trim(bd_addr_t addr, bd_size_t size)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** Get the size of a readable block
|
||||
*
|
||||
* @return Size of a readable block in bytes
|
||||
|
|
Loading…
Reference in New Issue