+int exfat_flush_nodes(struct exfat* ef)
+{
+ return flush_nodes(ef, ef->root);
+}
+
+int exfat_flush(struct exfat* ef)
+{
+ if (ef->cmap.dirty)
+ {
+ if (exfat_pwrite(ef->dev, ef->cmap.chunk,
+ BMAP_SIZE(ef->cmap.chunk_size),
+ exfat_c2o(ef, ef->cmap.start_cluster)) < 0)
+ {
+ exfat_error("failed to write clusters bitmap");
+ return -EIO;
+ }
+ ef->cmap.dirty = false;
+ }
+
+ return 0;
+}
+
+static bool set_next_cluster(const struct exfat* ef, bool contiguous,