File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,22 @@ class BlockDevice
96
96
return 0 ;
97
97
}
98
98
99
+ /* * Mark blocks as no longer in use
100
+ *
101
+ * This function provides a hint to the underlying block device that a region of blocks
102
+ * is no longer in use and may be erased without side effects. Erase must still be called
103
+ * before programming, but trimming allows flash-translation-layers to schedule erases when
104
+ * the device is not busy.
105
+ *
106
+ * @param addr Address of block to mark as unused
107
+ * @param size Size to mark as unused in bytes, must be a multiple of erase block size
108
+ * @return 0 on success, negative error code on failure
109
+ */
110
+ virtual int trim (bd_addr_t addr, bd_size_t size)
111
+ {
112
+ return 0 ;
113
+ }
114
+
99
115
/* * Get the size of a readable block
100
116
*
101
117
* @return Size of a readable block in bytes
You can’t perform that action at this time.
0 commit comments