@@ -75,6 +75,39 @@ class FATFileSystem : public FileSystem {
75
75
*/
76
76
virtual int unmount ();
77
77
78
+ /* * Reformats a filesystem, results in an empty and mounted filesystem
79
+ *
80
+ * @param bd
81
+ * BlockDevice to reformat and mount. If NULL, the mounted
82
+ * block device will be used.
83
+ * Note: if mount fails, bd must be provided.
84
+ * Default: NULL
85
+ *
86
+ * @param allocation_unit
87
+ * This is the number of bytes per cluster size. The valid value is N
88
+ * times the sector size. N is a power of 2 from 1 to 128 for FAT
89
+ * volume and upto 16MiB for exFAT volume. If zero is given,
90
+ * the default allocation unit size is selected by the underlying
91
+ * filesystem, which depends on the volume size.
92
+ *
93
+ * @return 0 on success, negative error code on failure
94
+ */
95
+ virtual int reformat (BlockDevice *bd, int allocation_unit);
96
+
97
+ /* * Reformats a filesystem, results in an empty and mounted filesystem
98
+ *
99
+ * @param bd BlockDevice to reformat and mount. If NULL, the mounted
100
+ * block device will be used.
101
+ * Note: if mount fails, bd must be provided.
102
+ * Default: NULL
103
+ * @return 0 on success, negative error code on failure
104
+ */
105
+ virtual int reformat (BlockDevice *bd = NULL )
106
+ {
107
+ // required for virtual inheritance shenanigans
108
+ return reformat (bd, 0 );
109
+ }
110
+
78
111
/* * Remove a file from the filesystem.
79
112
*
80
113
* @param path The name of the file to remove.
0 commit comments